简体   繁体   English

System.Web.WebPages.Html.HtmlHelper不包含定义

[英]System.Web.WebPages.Html.HtmlHelper does not contain a defintion

I know there a lot of questions asking this same question, but I've tried most of them and I cannot find where I messed up. 我知道有很多问题问同样的问题,但是我已经尝试了其中的大多数,但找不到我搞砸的地方。 I have a solution that has multiple projects in it. 我有一个包含多个项目的解决方案。 Because they were on different .net versions, I ended up upgrading to .Net 4.5 and from MVC 4 to MVC 5. My current problem is that in view files, it won't recognize any of the razor syntax (forgive me if this the wrong term) such as @model, ViewBag, ActionLink, DisplayNameFor, etc. 由于它们使用的是不同的.net版本,因此我最终升级到.Net 4.5并从MVC 4升级到MVC5。我当前的问题是,在视图文件中,它无法识别任何剃刀语法(请原谅,错误的术语),例如@ model,ViewBag,ActionLink,DisplayNameFor等。

I've made sure my packages are up-to-date and webconfig files are pointing correctly (I think). 我确保我的软件包是最新的,并且webconfig文件指向正确(我认为)。 Does it need to point to the last decimal version or just the top decimal for example <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" / or <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" /> regardless I've tried both. 是否需要指向最后一个十进制版本或仅指向最高十进制版本,例如<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" /<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />不管我是否都尝试过。

I've also deleted bin, obj, cleared my temp, cleaned, and rebuilt. 我还删除了bin,obj,清除了临时文件,清理并重建了它。 Can you see what I'm missing? 可以看到我所缺少的吗?

web.config web.config

<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <configSections>
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
  </configSections>
  <connectionStrings>
    <add name="TintagliaContext" connectionString="Data Source=SLD-GZQTHS1\SQLEXPRESS;Initial Catalog=coverpools;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
   <!--<add name="TintagliaContext" connectionString="Data Source=SLD-GZQTHS1\SQLEXPRESS;Initial Catalog=coverpools-NEW;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />-->
  </connectionStrings>
  <appSettings>
    <!--<add key="webpages:Version" value="2.0.0.0" />-->
    <add key="webpages:Version" value="3.0.0.0" />

    <add key="webpages:Enabled" value="false" />
    <add key="PreserveLoginUrl" value="true" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
    <add key="CoverpoolsUrlNewQuote" value="http%3A%2F%2Fcoverpools.cloudapp.net%2Fecon2012%2FeConEngineHtml.aspx%3Fenvironment%3Ddefault%26model%3D%3Cmodel%3E%26modelversion%3D%3Cmodelversion%3E%26context%3D%3Ccontextid%3E%26language%3Ddefault%26formatlanguage%3Ddefault%26configtype%3Dconfiguration%26type%3D1%26saveas%3D%3Cconfigid%3E%26objectid%3D%3Cconfigid%3E%26user%3D%3Cdealerid%3E%26mobile%3Dtrue" />
    <add key="CoverpoolsUrlEditQuote" value="http%3A%2F%2Fcoverpools.cloudapp.net%2Fecon2012%2FeConEngineHtml.aspx%3Fenvironment%3Ddefault%26model%3D%3Cmodel%3E%26modelversion%3D%3Cmodelversion%3E%26context%3D%3Ccontextid%3E%26language%3Ddefault%26formatlanguage%3Ddefault%26configtype%3Dconfiguration%26type%3D1%26configuration%3D%3Cconfigid%3E%26saveas%3D%3Cconfigid%3E%26objectid%3D%3Cconfigid%3E%26user%3D%3Cdealerid%3E%26mobile%3Dtrue" />
    <add key="CoverpoolsUrlTracking" value="%3Ctrackingid%3E" />
    <add key="CoverpoolsUrlPrint" value="http%3A%2F%2Fcoverpools.cloudapp.net%2Fecon2012%2FeConPrintReport.aspx%3Fkey%3D%3Ckey%3E%26report%3D%3Creport%3E%26file%3D.pdf%26content%3Dapplication%2Fpdf" />
    <add key="CoverpoolsUrlConnectEcon" value="http%3A%2F%2Fcoverpools.cloudapp.net%2Fecon2012%2FeConBackendProcessing.aspx%3Fenvironment%3Ddefault%26model%3D%3Cmodel%3E%26modelversion%3D%3Cmodelversion%3E%26action%3Dconnect%26configuration%3D%3Cconfigid%3E%26keyonly%3Dtrue" />
  </appSettings>
  <!--
    For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.

    The following attributes can be set on the <httpRuntime> tag.
      <system.Web>
        <httpRuntime targetFramework="4.5.2" />
      </system.Web>
  -->
  <system.web>
    <!--Added SimpleMemberShip based on http://stackoverflow.com/questions/15753864/to-call-this-method-the-membership-provider-property-must-be-an-instance-of-->
        <roleManager enabled="true" defaultProvider="SimpleRoleProvider">
        <providers>
            <clear />
            <add name="SimpleRoleProvider" type="WebMatrix.WebData.SimpleRoleProvider, WebMatrix.WebData" />
        </providers>
    </roleManager>
    <membership defaultProvider="SimpleMembershipProvider">
        <providers>
            <clear />
            <add name="SimpleMembershipProvider" type="WebMatrix.WebData.SimpleMembershipProvider, WebMatrix.WebData" />
        </providers>
    </membership>
    <sessionState mode="InProc" customProvider="DefaultSessionProvider">
        <providers>
            <add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" />
        </providers>
    </sessionState>
    <!--END ADDEDSimpleMemberShip-->

    <compilation debug="true" targetFramework="4.5.2" />
    <httpRuntime />
    <authentication mode="Forms">
      <forms loginUrl="~/Account/Login" timeout="2880" name=".ASPXFORMSAUTH" protection="All" />
    </authentication>
    <pages controlRenderingCompatibilityVersion="4.0">
      <namespaces>
        <add namespace="System.Web.Helpers" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.WebPages" />
      </namespaces>
    </pages>
  </system.web>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />

    <!-- added per https://www.asp.net/mvc/overview/releases/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2-->
    <modules>
      <remove name="RoleManager" />
    </modules>
    <!-- /added -->

  <handlers>
      <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
      <remove name="OPTIONSVerbHandler" />
      <remove name="TRACEVerbHandler" />
      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
  </system.webServer>

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246" />
        <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246" />
        <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.2.3.0" newVersion="3.2.3.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.2.3.0" newVersion="3.2.3.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-3.2.3.0" newVersion="3.2.3.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="v11.0" />
      </parameters>
    </defaultConnectionFactory>
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
  </entityFramework>
  <log4net>
    <appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
      <file value="App_Data\Logs.txt" />
      <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
      <appendToFile value="true" />
      <rollingStyle value="Date" />
      <maximumFileSize value="5MB" />
      <maxSizeRollBackups value="2" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger [%ndc] - %message%newline" />
      </layout>
    </appender>
    <root>
      <level value="INFO" />
      <appender-ref ref="RollingFile" />
    </root>
  </log4net>
</configuration>

views/web.config views / web.config

<?xml version="1.0"?>

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

  <system.web.webPages.razor>
    <!--<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />-->
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

    <pages pageBaseType="System.Web.Mvc.WebViewPage">
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Optimization"/>
        <add namespace="System.Web.Routing" />
      </namespaces>
    </pages>
  </system.web.webPages.razor>

  <appSettings>
    <add key="webpages:Enabled" value="false" />
  </appSettings>

  <system.web>
    <httpHandlers>
      <add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
    </httpHandlers>

    <!--
        Enabling request validation in view pages would cause validation to occur
        after the input has already been processed by the controller. By default
        MVC performs request validation before a controller processes the input.
        To change this behavior apply the ValidateInputAttribute to a
        controller or action.
    -->
    <!--<pages
        validateRequest="false"
        pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
        pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
        userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">-->
    <pages
    validateRequest="false"
    pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <controls>
        <!--<add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />-->
        <add assembly="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />

      </controls>
    </pages>
  </system.web>

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />

    <handlers>
      <remove name="BlockViewHandler"/>
      <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
    </handlers>
  </system.webServer>
</configuration>

CodeFirst Project app.config CodeFirst Project app.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <connectionStrings>
    <add name="TintagliaContext" connectionString="Data Source=SLD-GZQTHS1\SQLEXPRESS;Initial Catalog=coverpools;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
    <!--<add name="TintagliaContext" connectionString="Data Source=SLD-GZQTHS1\SQLEXPRESS;Initial Catalog=coverpools-NEW;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />-->
  </connectionStrings>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
  </startup>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
  </entityFramework>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.2.3.0" newVersion="3.2.3.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

Packages.config Packages.config

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="EntityFramework" version="6.1.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.WebApi" version="5.2.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.WebHelpers" version="3.2.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.WebPages.Data" version="3.2.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.WebPages.WebData" version="3.2.3" targetFramework="net452" />
  <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net452" />
  <package id="Newtonsoft.Json" version="6.0.4" targetFramework="net452" />
  <package id="PagedList" version="1.17.0.0" targetFramework="net45" />
  <package id="PagedList.Mvc" version="4.5.0.0" targetFramework="net45" />
</packages>

Here's what I am getting when I compile: Could not load file or assembly 'System.Web.Helpers' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) 这是编译时得到的信息: Could not load file or assembly 'System.Web.Helpers' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Could not load file or assembly 'System.Web.Helpers' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 


=== Pre-bind state information ===
LOG: DisplayName = System.Web.Helpers
 (Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: System.Web.Helpers | Domain ID: 2
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///F:/sites/OnlineOrder/Coverpools Dealer Portal/Infotech Coverpools Portal Tintaglia/Source/Infotech.Coverpools.Portal.Tintaglia.Web/
LOG: Initial PrivatePath = F:\sites\OnlineOrder\Coverpools Dealer Portal\Infotech Coverpools Portal Tintaglia\Source\Infotech.Coverpools.Portal.Tintaglia.Web\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: F:\sites\OnlineOrder\Coverpools Dealer Portal\Infotech Coverpools Portal Tintaglia\Source\Infotech.Coverpools.Portal.Tintaglia.Web\web.config
LOG: Using host configuration file: C:\Users\joshua.mcgee\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Users/joshua.mcgee/AppData/Local/Temp/Temporary ASP.NET Files/root/0af143ab/206c340/System.Web.Helpers.DLL.
LOG: Attempting download of new URL file:///C:/Users/joshua.mcgee/AppData/Local/Temp/Temporary ASP.NET Files/root/0af143ab/206c340/System.Web.Helpers/System.Web.Helpers.DLL.
LOG: Attempting download of new URL file:///F:/sites/OnlineOrder/Coverpools Dealer Portal/Infotech Coverpools Portal Tintaglia/Source/Infotech.Coverpools.Portal.Tintaglia.Web/bin/System.Web.Helpers.DLL.
LOG: Using application configuration file: F:\sites\OnlineOrder\Coverpools Dealer Portal\Infotech Coverpools Portal Tintaglia\Source\Infotech.Coverpools.Portal.Tintaglia.Web\web.config
LOG: Using host configuration file: C:\Users\joshua.mcgee\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Redirect found in application configuration file: 3.0.0.0 redirected to 3.2.3.0.
LOG: Post-policy reference: System.Web.Helpers, Version=3.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///C:/Users/joshua.mcgee/AppData/Local/Temp/Temporary ASP.NET Files/root/0af143ab/206c340/System.Web.Helpers.DLL.
LOG: Attempting download of new URL file:///C:/Users/joshua.mcgee/AppData/Local/Temp/Temporary ASP.NET Files/root/0af143ab/206c340/System.Web.Helpers/System.Web.Helpers.DLL.
LOG: Attempting download of new URL file:///F:/sites/OnlineOrder/Coverpools Dealer Portal/Infotech Coverpools Portal Tintaglia/Source/Infotech.Coverpools.Portal.Tintaglia.Web/bin/System.Web.Helpers.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.


Stack Trace:


[FileLoadException: Could not load file or assembly 'System.Web.Helpers' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]

[FileLoadException: Could not load file or assembly 'System.Web.Helpers, Version=3.2.3.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)]
   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
   System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +36
   System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +21
   System.Reflection.Assembly.Load(String assemblyString) +28
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38

[ConfigurationErrorsException: Could not load file or assembly 'System.Web.Helpers, Version=3.2.3.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)]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +738
   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +217
   System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170
   System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +92
   System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +290
   System.Web.Compilation.BuildManager.ExecutePreAppStart() +157
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +531

[HttpException (0x80004005): Could not load file or assembly 'System.Web.Helpers, Version=3.2.3.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)]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9946132
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +90
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261

Your error tells you what the problem is. 您的错误告诉您问题出在哪里。 Whatever DLL version you have for System.Web.Helpers in your references is not matching a project file somewhere. 引用中为System.Web.Helpers提供的任何DLL版本都与某个地方的项目文件都不匹配。 You can right click each project and Unload Project, then right-click again on the unavailable project and select Edit Project. 您可以右键单击每个项目并卸载项目,然后再次右键单击不可用的项目并选择“编辑项目”。 Look for the System.Web.Helpers and make sure the version numbers are consistent through each project, 寻找System.Web.Helpers,并确保每个项目的版本号均一致,

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 &#39;System.Web.WebPages.Html.HtmlHelper&#39;不包含&#39;ActionLink的定义 - 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'ActionLink Umbraco MVC构建错误-Collection.cshtml-&#39;System.Web.WebPages.Html.HtmlHelper&#39;不包含&#39;ViewData&#39;或&#39;EditorFor&#39;的定义 - Umbraco MVC build error - Collection.cshtml - 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'ViewData' or 'EditorFor' System.Web.Mvc.HtmlHelper不包含MvcSiteMap的定义 - System.Web.Mvc.HtmlHelper does not contain a definition for MvcSiteMap 系统.Web.Mvc.HtmlHelper<ModelName> 不包含定义 - System.Web.Mvc.HtmlHelper<ModelName> does not contain a definition for System.Web.Mvc.HtmlHelper不包含“ DropDownListFor”的定义 - System.Web.Mvc.HtmlHelper does not contain a definition for 'DropDownListFor' System.Web.Mvc.HtmlHelper&#39;不包含CheckBox的定义 - System.Web.Mvc.HtmlHelper' does not contain a definition for CheckBox 如何实例化Web.Webpages.Html.HtmlHelper? - How can I instantiate Web.Webpages.Html.HtmlHelper? “System.Web.Mvc.HtmlHelper”不包含“RenderPartial”的定义 - ASP.Net MVC - 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'RenderPartial' - ASP.Net MVC CS1928:“ System.Web.Mvc.HtmlHelper”不包含“ DropDownListFor”的定义 - CS1928: 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'DropDownListFor' IServiceCollection不包含AddHttpClient的定义 - IServiceCollection does not contain a defintion for AddHttpClient
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM