views:

273

answers:

4

I have an app built against MVC Preview 3 (referencing local copies of the MVC assemblies) that I'm trying to modify/test on a machine with the ASP.NET MVC beta installed. I am not interesting in updating this app to run against MVC beta yet - I just need to make a few small changes.

It's failing with MissingMethodExceptions on RouteCollection.IgnoreRoutes (in global.asax.cs) because at runtime, the CLR is always finding the beta version of System.Web.Mvc in the GAC and loading this instead of the preview 3 version in my site's \bin directory.

Since the assemblies have the same name, version and public key, I believe there's no way of distinguishing between them within web.config, so I think the only solution here is to remove the ASP.NET MVC beta assemblies from the GAC.

Only - I can't do this, because they're installed by Windows Installer, so I can't remove them using gacutil.exe /u, and I'm getting "Access is denied" when I try and remove them directly.

Anyone know how I can remove this assembly - or, failing that, how to run/host an app that needs System.Web.Mvc preview 3 on a system that has System.Web.Mvc beta in the GAC?

+2  A: 

You could possible download the ASP.NET MVC Preview 3 Source and compile it with your own SNK or give it a different version as the offical one and reference that in your website.

hangy
+1  A: 

I think your best bet, since the app was built on a preview release, is to upgrade the app to work with the beta release, knowing that eventually you will have to update it to work with the production release as well. I know this isn't what you want to hear but I think it's a fact of life with CTP releases and public betas.

tvanfosson
Dylan Beattie
+1  A: 

Hangy's answer seems to fit the bill here - if we end up having to maintain this app on multiple workstations, that's exactly what we'll do until we've got time to migrate the code to the beta/live release.

In the meantime, though, what I've actually done is to hack the registry so I can remove System.Web.Mvc from the GAC - full details are posted on my blog. Existing code is now running with no modifications to either the Preview 3 or the Beta projects.

Dylan Beattie
A: 

As per this question here and this reference link you need to delete the registry key

System.Web.Mvc,version="1.0.0.0",culture="neutral",publicKeyToken="31BF3856AD364E35",processorArchitecture="MSIL"

from

HKEY_CLASSES_ROOT\Installer\Assemblies\Global

//Edit - Oh that's your blog lol. Thanks for the post :-)

Graphain