简体   繁体   中英

Could not load file or assembly 'System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

I am unable to tell where this name, version, culture and reference is being pulled from. I've enabled logging in the Registry as suggested by the error and have confirmed that the files in the verbose output don't have this reference. I'm using Umbraco 7.4 and VS 2015 Community.

I would appreciate any help in making this output useful.

=== Pre-bind state information ===
LOG: DisplayName = System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
 (Fully-specified)
LOG: Appbase = file:///C:/ESC_Test/ESCProject/
LOG: Initial PrivatePath = C:\ESC_Test\ESCProject\bin
Calling assembly : System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===

LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\ESC_Test\ESCProject\web.config
LOG: Using host configuration file: C:\Users\Mike\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.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///c:/tmp/Temporary ASP.NET Files/vs/f2aa3d7e/9192dbba/System.Web.WebPages.Razor.DLL.
LOG: Attempting download of new URL file:///c:/tmp/Temporary ASP.NET Files/vs/f2aa3d7e/9192dbba/System.Web.WebPages.Razor/System.Web.WebPages.Razor.DLL.
LOG: Attempting download of new URL file:///C:/ESC_Test/ESCProject/bin/System.Web.WebPages.Razor.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Major Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

Have a look at your Views\\Web.config :

  <configSections>
    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
    </sectionGroup>
  </configSections>

(copy from an ASP.Net MVC 5 project)

Being new, I wanted to learn about the available tools when volunteering for this project for my nonprofit organization. I installed Web Matrix, VS 2012 Web Edition, VS 2013 and VS 2015 Community along with VS Code. With each of these tools I accessed the VS project. Apparently the cause of this problem was the installation and use of various versions of the same NuGet updates and downloads.

One of the things learned from this experience is that Web Matrix, unlike VS, allows for searching the contents of project files. Although my Umbraco project contains 6 web.config files, none contained the original reference reported in the error. However, using Web Matrix, I did discover other files that contained that reference: web.config in the obj folder and ESCProject.csproj in the project root Please close this question because my solution, now that I have some painful familiarity with these tools, is to delete VS and the project and start all over again after cleaning up the environment.

I want to say a big thank you to all who offered help as it's comforting to know that when I've exhausted my efforts, that I can turn to a community to get some help.

Thanks again. Please close this question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM