我正在尝试通过 System.Web.Optimization.React 使用 ASP.NET 缩小和优化来缩小我的 .JSX 文件。我已经安装了 MVC4 React 包以及优化包,但是每当我尝试包含一个包时,我都会得到以下信息:
React.TinyIoC.TinyIoCResolutionException: Unable to resolve type: React.IReactEnvironment
InnerException 总是 null
我的捆绑包设置如下:
bundles.Add(new ScriptBundle("~/Bundle/Scripts/ReactJS").Include(
"~/Scripts/React/react-0.12.2.js",
"~/Scripts/React/react-with-addons-0.12.2.js",
"~/Scripts/React/JSXTransformer-0.12.2.js"
));
bundles.Add(new JsxBundle("~/Bundle/Scripts/ReactCalendar").Include(
"~/Scripts/React/Calendar/Main.react.jsx",
"~/Scripts/React/Calendar/Components/Calendar.react.jsx",
"~/Scripts/React/Calendar/Components/CalendarEvent.react.jsx",
"~/Scripts/React/Calendar/Components/CalendarControls.react.jsx",
"~/Scripts/React/Calendar/Components/CalendarTimeSlots.react.jsx"
));
并包含在视图中:
@section scripts{
@Scripts.Render("~/Bundle/Scripts/ReactJS");
@Scripts.Render("~/Bundle/Scripts/ReactCalendar");
}
错误总是在线抛出:
@Scripts.Render("~/Bundle/Scripts/ReactCalendar");
有人对如何解决/调试这个问题有任何想法吗?如果需要更多信息,请告诉我。