2016-12-07 20 views
0

私はこの同じ質問に多くの質問をしていますが、私はそれらのほとんどを試してみました。私はそれに複数のプロジェクトを持つソリューションを持っています。彼らは異なった.netバージョン上にあったので、.Net 4.5に、MVC 4からMVC 5にアップグレードしました。私の現在の問題は、ビューファイルでは、それは剃刀の構文を認識しません。 @model、ViewBag、ActionLink、DisplayNameForなどの間違った用語)System.Web.WebPages.Html.HtmlHelperに定義が含まれていません

私のパッケージが最新であり、webconfigファイルが正しく指していることを確認しました。最後の小数点または最上位の小数点を指す必要がありますか?たとえば、両方とも試しても、 <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" />です。

私もbin、objを削除して、一時的なものを消去し、清掃し、再構築しました。私が逃しているものが見えますか?

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> 

ビュー/ 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プロジェクト 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

<?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> 

は、ここで私は、コンパイル時に私が取得しています何: 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 
+0

コンパイル時にどうなりますか?どのようなエラーが出ますか? – CodingYoshi

+0

@ CodeYoshiこれはコンパイル時に発生するエラーです。ファイルまたはアセンブリ 'System.Web.Helpers'またはその依存関係の1つを読み込めませんでした。見つかったアセンブリのマニフェスト定義がアセンブリ参照と一致しません。 (例外HRESULTから:0x80131040)私は質問に完全なエラーを追加しました。 –

答えて

0

あなたのエラーは問題が何であるかがわかります。あなたの参照にSystem.Web.Helpersのために持っているどんなDLLバージョンでも、どこかにプロジェクトファイルが一致していません。各プロジェクトを右クリックして[プロジェクトをアンロード]をクリックし、使用できないプロジェクトを右クリックして[プロジェクトの編集]を選択します。 System.Web.Helpersを探し、各プロジェクトでバージョン番号が一貫していることを確認してください。

+0

ありがとうございました。 web.helpersを含む2つのプロジェクトを見ると、それらは同じであるように見えます。 .. \ .. \ packages \ Microsoft.AspNet.WebPages.3.2.3 \ lib \ net45 \ System.Web.Helpers.dll True '他にも何かがありますか? –

+0

私はそれを理解したと思う。 'Version = 3.0.0.0'を' 3.2.3.0'に変更した場合、System.Web.WebPagesの新しいエラーが発生します。同様のエラーごとに同じことをすれば、少なくともこのエラーを解決できるはずです。正しい? –

+0

だから私はこの変更を始めましたが、これで固まってしまった 'System.Web.WebPages.Razor、Version = 3.0.0.0'をファイルまたはアセンブリをロードできませんでした。これをバージョン3.2.3.0に変更するのか、そのままにしますat 3.0.0.0 –

関連する問題