How to un-GAC ASP.NET MVC RC2

If you are like me you might have developed lots of web applications using different versions of the ASP.NET MVC framework, and might wonder how the latest installations may affect the ability to run.

When upgrading to the latest Release Candidate 2 these old projects will probably build just fine, but there will most likely be some kind of run time error when running locally, like the one I just got and showing below.

aspnet-mvc-breakage

Why the breakage you might wonder and remembering that you been putting those old versions in your bin-folder and they should not be affected. Dylan Bettie gives us the explanation:

The CLR checks the GAC first when resolving assembly references - and if it finds a matching assembly in the GAC, it won't look anywhere else. The ASP.NET MVC previews and beta release all use the same assembly version, culture and public keys, so the CLR has no way of distinguishing between the preview 3 version of System.Web.Mvc and the beta version of the same assembly. They're different DLLs with different file versions, but because the assembly version is the same, the CLR regards them as the same assembly.

So what you need to do is to remove the ASP.NET MVC assemblies from your GAC and your old projects will run against the old ones in their bin.

Luckily I've done this before from the instructions in Dylans post and it's not that hard. Just make sure you backup your system before you do anything because it involves editing the registry which you knows is not always safe. For my safety I have just made a snapshot of my Windows 7 system I got running in WMware Fusion.

Remove the assembly from the registry

Firstly you need to run regedit and find HKEY_CLASSES_ROOT\Installer\Assemblies\Global and remove the key System.Web.Mvc,version="1.0.0.0",culture="neutral", publicKeyToken="31BF3856AD364E35",processorArchitecture="MSIL"-key

aspnet-mvc-regedit-assembly

Un-GAC it

Fire up a CMD prompt and locate your Gacutil.exe. On my Windows 7 system running team edition of Visual Studio 2008 it can be found here. C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin. Then run the command gacutil /u System.Web.Mvc

un-gac-aspnet-mvc

Test your projects

Your old projects made with the previews or betas should now run just fine as they will use the ddl:s you got in their respective bin folder. Mine is running fine as you can see.

code-odyssey-running

Comments

Hii, Thanks for the sharing nice posting with us. i’m really impressed. Call us any time at toll-free 0800-090-3288, if you need any support for web mail, broadband and technical support. bt broadband support bt broadband support virgin media support talk talk support

Really i appreciate the effort you made to share the knowledge. The topic here i found was really effective to the topic which i was researching for a long time.

Want to get help of a technical expert to remove all technical glitches of HP Printer then consult our technical executive by calling @ 0800-098-8371 HP printer help number UK.

want to get online support from Antivirus team call Norton Helpline Number UKlink text

want to get online support from Antivirus team call Norton Helpline Number UK

well written thanks for post.. want HP Printer Help Call HP Printer Help Number

On the off chance that you at all get into a circumstance where you are trying to send a mail through your hotmail account however couldn't do in light of present circumstances. In light of current conditions, taking everything in account you need to simply call Hotmail Support Number UK @800-098-8354 where you will get the help from the best specialists in the market.

We are really grateful for your blog. There are many approaches to visit the post office. Good work. Acer Help Acer tech Support

thanks for this awesome web page, i like it.

thanks for this awesome web page, i like it.

thanks for this awesome web page, i like it.

Hello, after reading this awesome post i am also cheerful to share my knowledge here with friends. hotmail Helpline uk hotmail help desk contact Hotmail Support Hotmail Issue

Outstanding Post.

This website is very knowledgeable, thanks for it. support for Belkin routers.

Hi, Thanks for the sharing nice posting with us. i am really impressed.

hotmail support number

If You Forget Your Hotmail Password Call Hotmail Support Number UK and get quick Support From Expert

I loved this story so thanks for the posting this article. This is awesome article..

http://best-printer-support.uk/support-for-samsung-printer

It is an amazing article that provides to us so thank you very much.

Samsung printer support

This post is extremely good so keep posting further thank you so much.

Asus laptop technical support number

Hello, after reading this awesome post i am also cheerful to share my knowledge here with friends.

microsoft customer support

Nice Post. Windows Support Number

Great Post... Hp printer support Number

Please fill out all the fields.

*
*