We have a large .NET web application that was MVC3, using T4MVC. We recently upgraded it to MVC4, and all is good except for T4MVCExtensions (version 3.6.5 from NuGet) is s
I had a very similar assembly binding issue, after manually upgrading a set of MVC3 projects to MVC4. Despite having the assembly binding elements in web.config, I was getting errors similar to T4MVC errors but from the Telerik MVC Extensions.
The Fusion Log viewer was useful as it confirmed that two versions of system.web.mvc were being loaded into the application domain.
In the end, removing the namespace from the root configuration element in the project's root web.config resolved the issue.
So, the web.config was like this:
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<!--... elements deleted for clarity ...-->
</configuration>
And after removing the namespace it looks like this:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!--... elements deleted for clarity ...-->
</configuration>
This blog post has more information about the erroneous namespace: http://www.dotnetish.com/runtime/xmlnshttpschemas-microsoft-com-netconfigurationv2-0/
To isolate, I would try creating a tiny dummy assembly that is built against MVC3 to see if it behaves similarly. There shouldn't be anything special about the T4MVC helper assembly.
Also, please look at my test project https://github.com/davidebbo/T4MVCSampleApp. This is an MVC4 project that uses the latest T4MVC, and it runs fine for me. Does it run for you?
If all else fails, if you can share a repro project (e.g. on github), I can try to take a look.