Note that there are some explanatory texts on larger screens.

plurals
  1. POStepping through ASP.NET MVC 2 source
    text
    copied!<p>I've been trying to set up the <a href="http://aspnet.codeplex.com/releases/view/41742" rel="nofollow noreferrer">ASP.NET MVC 2 RTM Source</a> for use with my app, so I can step through things like model binding when debugging. However, I haven't been able to get it to work - <strong>I'm getting errors like:</strong></p> <pre><code>The type 'System.Web.Mvc.Controller' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The type 'System.Web.Mvc.Async.AsyncControllerActionInvoker' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. </code></pre> <p>Etc...</p> <p>I followed the steps in <a href="http://blog.stevensanderson.com/2009/02/03/using-the-aspnet-mvc-source-code-to-debug-your-app/" rel="nofollow noreferrer">Steve Sanderson's howto</a> (for MVC1), but perhaps there are different steps to get it to work in MVC2? </p> <p><strong>Steps I have taken so far:</strong></p> <ul> <li>Removed references to GAC based <code>System.Web.Mvc dll</code> from all of my projects.</li> <li>Added the MVC source as a project in the solution.</li> <li>Added references to the System.Web.Mvc project in each of my projects.</li> <li>Commented out the <code>&lt;add assembly="System.Web.Mvc...</code> item in the <code>&lt;compilation&gt;&lt;assemblies&gt;</code> section of the root <code>web.config</code></li> <li>Commented out the <code>&lt;add assembly="System.Web.Mvc...</code> item in the section of the <code>web.config</code> in the <code>Views</code> folder (and the <code>Views</code> folders of each of the areas)</li> <li>Find/replaced any of the references to <code>System.Web.Mvc, Version=2.0.0.0</code> and replaced their <code>PublicKeyToken</code> value with <code>null</code> (was 31bf3856ad364e35)</li> </ul> <p><strong>So, questions:</strong></p> <ul> <li>has anyone else got this working? (presumably yes!)</li> <li>Where are the <code>PublicKeyToken</code> numbers coming from in the errors?</li> <li>There are some other references to this same <code>PublicKeyToken</code> (31bf3856ad364e35) for other dlls in the <code>web.config</code> (e.g. <code>System.Web.Extensions</code>) is this relevant?</li> <li>Any idea what I'm doing wrong?! Steps I've missed?</li> </ul> <p>Thank you!</p> <p><strong>UPDATE:</strong> In response to Syd's questions, here's some extra info:</p> <p>1) Current assemblies node from web.config:</p> <pre><code>&lt;compilation debug="true"&gt; &lt;assemblies&gt; &lt;add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt; &lt;add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt; &lt;add assembly="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt; &lt;add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt; &lt;add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"/&gt; &lt;add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt; &lt;add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt; &lt;add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt; &lt;/assemblies&gt; &lt;/compilation&gt; </code></pre> <p>2) Yes, I am using MVC Futures, but have that project built in my solution too, and have referenced it to use the System.Web.Mvc in the solution.</p> <p>3) I am using a few non-standard references. Rather that a screenshot I'll list them here:</p> <pre><code>Autofac Autofac.Integration.Web Autofac.Integration.Web.Mvc Elmah FluentValidation FluentValidation.Mvc log4net MvcContrib MySql.Data NHibernate MvcFutures </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload