title: ReactJS.Net on MVC5 fails to resolve dependency
body: <p>I'm trying to set up an ASP.Net MV5 application to work with <a href="http://reactjs.net" rel="nofollow">ReactJS.Net</a>, including server side rendering and bundling.</p>
  
  <p>Unfortunately, it fails with this exception:</p>
  
  <blockquote>
    <p>An exception of type 'React.TinyIoC.TinyIoCResolutionException' occurred in React.dll but was not handled in user code</p>
    
    <p>Additional information: Unable to resolve type: React.ReactEnvironment</p>
  </blockquote>
  
  <p>This exception occurs on this line:</p>
  
  <pre><code> @Scripts.Render("~/bundles/ui-components")
  </code></pre>
  
  <p>This line is taken my <code>_layouts.cshtml</code> file.</p>
  
  <p><strong>How should I solve my issue?</strong></p>
  
  <hr>
  
  <p>To give of details, here what I've done:</p>
  
  <ol>
  <li><p>in BundleConfig.cs:</p>
  
  <pre><code>    bundles.Add(new ScriptBundle("~/bundles/reactjs").Include(
                  "~/Scripts/react/react-{version}.js"));
      bundles.Add(new JsxBundle("~/bundles/ui-components")
                  .Include("~/content/ui/components/*.jsx"));
  </code></pre>
  
  <p>I created a folder "Content/ui/components" with all my jsx files (actually only one "commentsbox.jsx" file taken from the tutorial.</p></li>
  <li><p>In ReactConfig.cs, I removed the <code>WebActivatorEx.PreApplicationStartMethod</code> attribute, because I've this is no more supported with MVC5, in profit of Owin component. It stills contains :</p>
  
  <pre><code>public static class ReactConfig
  {
      public static void Configure()
      {
          ReactSiteConfiguration.Configuration
              .AddScript("~/content/ui/*.jsx");
      }
  }
  </code></pre></li>
  <li><p>In my <code>Global.asax.cs</code> file, I explicitly call <code>ReactConfig.Configure</code> method to replace the <code>WebActivatorEx.PreApplicationStartMethod</code> hook:</p>
  
  <pre><code>public class MvcApplication : System.Web.HttpApplication
  {
      protected void Application_Start()
      {
          ReactConfig.Configure();
          AreaRegistration.RegisterAllAreas();
          FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
          RouteConfig.RegisterRoutes(RouteTable.Routes);
          BundleConfig.RegisterBundles(BundleTable.Bundles);
      }
  }
  </code></pre></li>
  <li><p>My <code>_layouts.cshtml</code> view contains (at the bottom of the file):</p>
  
  <pre><code>@Scripts.Render("~/bundles/jquery")
  @Scripts.Render("~/bundles/bootstrap")
  @Scripts.Render("~/bundles/reactjs")
  @Scripts.Render("~/bundles/ui-components")
  @RenderSection("scripts", required: false)
  @Html.ReactInitJavaScript()
  </code></pre></li>
  <li><p>In one of my view:</p>
  
  <pre><code>@{
      ViewBag.Title = "Home Page";
  }
  
  &lt;div id="content"&gt;&lt;/div&gt;      
  
  @section scripts
  {
      @Html.React("CommentBox", new {}, containerId:"content")        
  }
  </code></pre></li>
  <li><p>And finally, my jsx file:</p>
  
  <pre><code>var CommentBox = React.createClass({
    render: function() {
      return (
          &lt;div class="row"&gt;
              &lt;div class="col-md-4"&gt;
              hello
              &lt;/div&gt;
  
          &lt;/div&gt;
      );
    }
  });
  </code></pre></li>
  </ol>