Reputation: 32391
I've been trying to set up the ASP.NET MVC 2 RTM Source 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 - I'm getting errors like:
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'.
Etc...
I followed the steps in Steve Sanderson's howto (for MVC1), but perhaps there are different steps to get it to work in MVC2?
Steps I have taken so far:
System.Web.Mvc dll
from all of my projects.<add assembly="System.Web.Mvc...
item in the <compilation><assemblies>
section of the root web.config
<add assembly="System.Web.Mvc...
item in the section of the web.config
in the Views
folder (and the Views
folders of each of the areas)System.Web.Mvc, Version=2.0.0.0
and replaced their PublicKeyToken
value with null
(was 31bf3856ad364e35)So, questions:
PublicKeyToken
numbers coming from in the errors?PublicKeyToken
(31bf3856ad364e35) for other dlls in the web.config
(e.g. System.Web.Extensions
) is this relevant?Thank you!
UPDATE: In response to Syd's questions, here's some extra info:
1) Current assemblies node from web.config:
<compilation debug="true">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
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.
3) I am using a few non-standard references. Rather that a screenshot I'll list them here:
Autofac
Autofac.Integration.Web
Autofac.Integration.Web.Mvc
Elmah
FluentValidation
FluentValidation.Mvc
log4net
MvcContrib
MySql.Data
NHibernate
MvcFutures
Upvotes: 1
Views: 593
Reputation: 1038930
You don't need to download the source code or remove references from the GAC. Just follow the steps described in this blog post.
Microsoft Symbols Servers
, no need to enter url, in VS2008 you need to enter the urlCreate a new ASP.NET MVC application, put a breakpoint in your controller action and when the breakpoint gets hit, load the symbols for the System.Web.Mvc
assembly from the call stack and once the symbols are loaded you will be able to step through the source code (after accepting the terms and conditions).
Upvotes: 3
Reputation: 1546
Instead of commenting out the <assemblies><add assembly>
lines, you should set the PublicKeyToken=null instead.
Upvotes: 1