Moving to a WIN 10 machine from a WIN 7 and getting Could not load file or assembly 'System.Web.Mvc,

Daniel Main asked on March 26, 2019 21:30

Running into an odd problem, Got a new development machine running windows 10, was on a Win 7. We house our changes in TFS, and I have installed the version of Kentico we are using 9.X onto my new development machine.

So I grab the latest version of the site and clean it then build it in VS, then I attempt to run it...

Here i the full error I am getting:

Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: Reference.svcmap: Could not load file or assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Source Error: 


[No relevant source lines]

Source File: /App_WebReferences/KenticoLicenseServiceReference/    Line: 1 

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.


=== Pre-bind state information ===
LOG: DisplayName = System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
 (Fully-specified)
LOG: Appbase = file:///C:/NJH Kentico/CMS/
LOG: Initial PrivatePath = C:\NJH Kentico\CMS\bin
Calling assembly : LinqToTwitter, Version=2.1.12.0, Culture=neutral, PublicKeyToken=957107be965c25d9.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\NJH Kentico\CMS\web.config
LOG: Using host configuration file: C:\Users\maind\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///C:/Users/maind/AppData/Local/Temp/Temporary ASP.NET Files/vs/6035c4ce/e3464f34/System.Web.Mvc.DLL.
LOG: Attempting download of new URL file:///C:/Users/maind/AppData/Local/Temp/Temporary ASP.NET Files/vs/6035c4ce/e3464f34/System.Web.Mvc/System.Web.Mvc.DLL.
LOG: Attempting download of new URL file:///C:/NJH Kentico/CMS/bin/System.Web.Mvc.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Major Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3163.0

Any ideas on what is happening? This refrence:

<dependentAssembly>
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31BF3856AD364E35" culture="neutral"/>
    <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
</dependentAssembly> 

is commented out in the web config (works in WIN 7) and the site is running on .net 4.5.

Recent Answers


Roman Hutnyk answered on March 27, 2019 11:25

What .Net Framework version is installed on your machine?

Did you get any errors during package restore?

0 votesVote for this answer Mark as a Correct answer

Daniel Main answered on March 27, 2019 16:26

Currently it is supposed to be 4.7.2 but as you can see in the copy it seems to be using Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3163.0

I did mange to resolve one issue, but another has crept up, I got the reference that was commoneted out fixed, but now coming up with this:

Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: Reference.svcmap: Inheritance security rules violated by type: 'LinqToTwitter.MvcOAuthActionResult'. Derived types must either match the security accessibility of the base type or be less accessible.

Source Error: 


[No relevant source lines]

Source File: /App_WebReferences/KenticoLicenseServiceReference/    Line: 1 

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3163.0

It is almost looking like LinqToTwitter does not like Win 10.

0 votesVote for this answer Mark as a Correct answer

Daniel Main answered on March 27, 2019 17:51

Ok, after some more fiddleing, I may have narrowed down the problem, seems to be residing in the System.Linq not sure how that reference fell off, in the version that is on the Win7 box it is alive and well.

Currently stumped.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.