Assembly System.Web.Mvc which has a higher version than referenced assembly

Created: 05/04/2018 06:52:27 p.m.


Event code: 3007 
Event message: A compilation error has occurred. 

Application information: 
    Application domain: /LM/W3SVC/1/ROOT/MyProj-7-131674308158875895 
    Trust level: Full 
    Application Virtual Path: /MyProj 
    Application Path: E:\Program Files\MyProj\ 
    Machine name: MyServer
Process information: 
    Process ID: 6020 
    Process name: w3wp.exe 
    Account name: TEST

Exception information: 
    Exception type: HttpCompileException 
    Exception message: (0): error CS1705: Assembly "XXXXXXX, Version=2011.6.3.1141, Culture=neutral, PublicKeyToken=null" uses "System.Web.Mvc, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35" which has a higher version than referenced assembly "System.Web.Mvc, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
   at System.Web.Compilation.AssemblyBuilder.Compile()
   at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
   at System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp)
   at System.Web.Compilation.BuildManager.CompileGlobalAsax()
   at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()
   at System.Web.Compilation.BuildManager.CallAppInitializeMethod()
   at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)


In your pc you have the following folder: C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies

Inside you have System.Web.Mvc.dll in this case this file was version

So when you compile in your Vs2017 your project, it references to this folder and to that particular file.

So just find older version of System.Web.Mvc.dll ( somewhere and put it in that directory, and finally recompile your project. Now it will references to the proper version.

It wont say in Properties of that file, it will be somthing like:
Product version: 3.0.20105.0

Product version: 3.0.50813.1

In my case to obtain older version i took directly from the project BIN filder from production environment.


Go to Comments