3

I'm receiving the following error when I run my ASP.NET web project:

Conflicting versions of ASP.NET Web Pages detected: specified version is "2.0.0.0", but the version in bin is "3.0.0.0". To continue, remove files from the application's bin directory or remove the version specification in web.config.

The answer on this question solves this problem - in my Web.config, switching

<add key="webpages:Version" value="2.0.0.0"/>

to

<add key="webpages:Version" value="3.0.0.0"/>

allows me to successfully run my site.

Unfortunately, a coworker who recently pulled down a clean copy of the repository is receiving the exact opposite error:

Conflicting versions of ASP.NET Web Pages detected: specified version is "3.0.0.0", but the version in bin is "2.0.0.0".

He can solve the problem by changing the webpages:Version value back to "2.0.0.0".

What is the root cause of this error, and how can my coworker and I use the same version in our Web.config?

Community
  • 1
  • 1
Nathan Friend
  • 12,155
  • 10
  • 75
  • 125
  • Your coworker is using an older version of the DLL, or at least the version in the bin is older than the version you have. Are you reference assemblies in source control? That's good to do because then all references stay in sync that way. – Brian Mains Jan 13 '15 at 19:11
  • Which DLL are you referring to? – Nathan Friend Jan 13 '15 at 20:26
  • Oh, forgot to mention. System.Web.WebPages DLL. – Brian Mains Jan 13 '15 at 20:32
  • I don't see a reference to that DLL in my project. Has the name of the DLL changed in recent versions of .NET (I'm on .NET 4.5.1)? – Nathan Friend Jan 13 '15 at 20:41
  • Well, by default, MVC relies on the web pages DLL (the webpages.razor DLL is defined in the Views/web.config file)... If you go to the default web.config, go to runtime/assemblyBinding, check to see if you can find the System.Web.WebPages as an assembly redirect. It is probably mapped to 2.0 or 3.0... – Brian Mains Jan 13 '15 at 20:48

0 Answers0