drayne
asked on
Could not load file or assembly 'System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
I'm using visual studio 2013 pro. Every time I update all my nuget packages this error happens. I've been stuck on it for a week with no luck on fixing it. Please help. Here's the error message and my web.config:
-------------------------- -Error---- ---------- ---------- ---------- ----
Could not load file or assembly 'System.Web.WebPages.Razor , Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad3 64e35' or one of its dependencies. The system cannot find the file specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundExce ption: Could not load file or assembly 'System.Web.WebPages.Razor , Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad3 64e35' or one of its dependencies. The system cannot find the file specified.
Source Error:
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.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.WebPages.Razor , Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad3 64e35' could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad3 64e35
(Fully-specified)
LOG: Appbase = file:///E:/InboxLock/
LOG: Initial PrivatePath = E:\InboxLock\bin
Calling assembly : WebMatrix.WebData, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad3 64e35.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: E:\InboxLock\web.config
LOG: Using host configuration file: C:\Users\Digit0321\Documen ts\IISExpr ess\config \aspnet.co nfig
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\F ramework\v 4.0.30319\ config\mac hine.confi g.
LOG: Post-policy reference: System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad3 64e35
LOG: Attempting download of new URL file:///C:/Users/Digit0321 /AppData/L ocal/Temp/ Temporary ASP.NET Files/root/4e4a3b11/9d8785 40/System. Web.WebPag es.Razor.D LL.
LOG: Attempting download of new URL file:///C:/Users/Digit0321 /AppData/L ocal/Temp/ Temporary ASP.NET Files/root/4e4a3b11/9d8785 40/System. Web.WebPag es.Razor/S ystem.Web. WebPages.R azor.DLL.
LOG: Attempting download of new URL file:///E:/InboxLock/bin/S ystem.Web. WebPages.R azor.DLL.
LOG: Attempting download of new URL file:///E:/InboxLock/bin/S ystem.Web. WebPages.R azor/Syste m.Web.WebP ages.Razor .DLL.
LOG: Attempting download of new URL file:///C:/Users/Digit0321 /AppData/L ocal/Temp/ Temporary ASP.NET Files/root/4e4a3b11/9d8785 40/System. Web.WebPag es.Razor.E XE.
LOG: Attempting download of new URL file:///C:/Users/Digit0321 /AppData/L ocal/Temp/ Temporary ASP.NET Files/root/4e4a3b11/9d8785 40/System. Web.WebPag es.Razor/S ystem.Web. WebPages.R azor.EXE.
LOG: Attempting download of new URL file:///E:/InboxLock/bin/S ystem.Web. WebPages.R azor.EXE.
LOG: Attempting download of new URL file:///E:/InboxLock/bin/S ystem.Web. WebPages.R azor/Syste m.Web.WebP ages.Razor .EXE.
Stack Trace:
[FileNotFoundException: Could not load file or assembly 'System.Web.WebPages.Razor , Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad3 64e35' or one of its dependencies. The system cannot find the file specified.]
WebMatrix.WebData.PreAppli cationStar tCode.Star t() +0
[InvalidOperationException : The pre-application start initialization method Start on type WebMatrix.WebData.PreAppli cationStar tCode threw an exception with the following error message: Could not load file or assembly 'System.Web.WebPages.Razor , Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad3 64e35' or one of its dependencies. The system cannot find the file specified..]
System.Web.Compilation.Bui ldManager. InvokePreS tartInitMe thodsCore( ICollectio n`1 methods, Func`1 setHostingEnvironmentCultu res) +559
System.Web.Compilation.Bui ldManager. InvokePreS tartInitMe thods(ICol lection`1 methods) +132
System.Web.Compilation.Bui ldManager. CallPreSta rtInitMeth ods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +102
System.Web.Compilation.Bui ldManager. ExecutePre AppStart() +153
System.Web.Hosting.Hosting Environmen t.Initiali ze(Applica tionManage r appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParamete rs hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException ) +516
[HttpException (0x80004005): The pre-application start initialization method Start on type WebMatrix.WebData.PreAppli cationStar tCode threw an exception with the following error message: Could not load file or assembly 'System.Web.WebPages.Razor , Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad3 64e35' or one of its dependencies. The system cannot find the file specified..]
System.Web.HttpRuntime.Fir stRequestI nit(HttpCo ntext context) +9913572
System.Web.HttpRuntime.Ens ureFirstRe questInit( HttpContex t context) +101
System.Web.HttpRuntime.Pro cessReques tNotificat ionPrivate (IIS7Worke rRequest wr, HttpContext context) +254
-------------------------- -----Web.c onfig----- ---------- ----------
<?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>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.I nternal.Co nfigFile.E ntityFrame workSectio n, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c56193 4e089" requirePermission="false" />
</configSections>
<connectionStrings>
<add name="DefaultConnection" connectionString="myConnec tion" providerName="System.Data. SqlClient" />
</connectionStrings>
<system.web>
<customErrors mode="Off" />
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<pages>
<namespaces>
<add namespace="System.Web.Opti mization" />
<add namespace="Microsoft.AspNe t.Identity " />
</namespaces>
<controls>
<add assembly="Microsoft.AspNet .Web.Optim ization.We bForms" namespace="Microsoft.AspNe t.Web.Opti mization.W ebForms" tagPrefix="webopt" />
</controls>
</pages>
<membership>
<providers>
<!--
ASP.NET Membership is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
-->
<clear />
</providers>
</membership>
<profile>
<providers>
<!--
ASP.NET Membership Profile is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
-->
<clear />
</providers>
</profile>
<roleManager>
<!--
ASP.NET Membership Role is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
-->
<providers>
<clear />
</providers>
</roleManager>
<!--
If you are deploying to a cloud environment that has multiple web server instances,
you should change session state mode from "InProc" to "Custom". In addition,
change the connection string named "DefaultConnection" to connect to an instance
of SQL Server (including SQL Azure and SQL Compact) instead of to SQL Server Express.
-->
<sessionState mode="InProc" customProvider="DefaultSes sionProvid er">
<providers>
<add name="DefaultSessionProvid er" type="System.Web.Providers .DefaultSe ssionState Provider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad3 64e35" connectionStringName="Defa ultConnect ion" />
</providers>
</sessionState>
</system.web>
<runtime>
<assemblyBinding xmlns="urn:schemas-microso ft-com:asm .v1">
<dependentAssembly>
<assemblyIdentity name="WebGrease" culture="neutral" publicKeyToken="31bf3856ad 364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.5.2. 14234" newVersion="1.5.2.14234" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606 e9261f" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.5.0. 2" newVersion="3.5.0.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad 364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.2. 0" newVersion="2.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Secur ity" publicKeyToken="31bf3856ad 364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.2. 0" newVersion="2.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Secur ity.Cookie s" publicKeyToken="31bf3856ad 364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.1. 0" newVersion="2.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Secur ity.OAuth" publicKeyToken="31bf3856ad 364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.1. 0" newVersion="2.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="AWSSDK" publicKeyToken="9f476d3089 b52be3" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.2. 4" newVersion="2.0.2.4" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.I nfrastruct ure.LocalD bConnectio nFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory >
<providers>
<provider invariantName="System.Data .SqlClient " type="System.Data.Entity.S qlServer.S qlProvider Services, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>
-------------------------- ---------- ---------- ---------- ---------- ----
--------------------------
Could not load file or assembly 'System.Web.WebPages.Razor
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundExce
Source Error:
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.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.WebPages.Razor
=== Pre-bind state information ===
LOG: DisplayName = System.Web.WebPages.Razor,
(Fully-specified)
LOG: Appbase = file:///E:/InboxLock/
LOG: Initial PrivatePath = E:\InboxLock\bin
Calling assembly : WebMatrix.WebData, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad3
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: E:\InboxLock\web.config
LOG: Using host configuration file: C:\Users\Digit0321\Documen
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\F
LOG: Post-policy reference: System.Web.WebPages.Razor,
LOG: Attempting download of new URL file:///C:/Users/Digit0321
LOG: Attempting download of new URL file:///C:/Users/Digit0321
LOG: Attempting download of new URL file:///E:/InboxLock/bin/S
LOG: Attempting download of new URL file:///E:/InboxLock/bin/S
LOG: Attempting download of new URL file:///C:/Users/Digit0321
LOG: Attempting download of new URL file:///C:/Users/Digit0321
LOG: Attempting download of new URL file:///E:/InboxLock/bin/S
LOG: Attempting download of new URL file:///E:/InboxLock/bin/S
Stack Trace:
[FileNotFoundException: Could not load file or assembly 'System.Web.WebPages.Razor
WebMatrix.WebData.PreAppli
[InvalidOperationException
System.Web.Compilation.Bui
System.Web.Compilation.Bui
System.Web.Compilation.Bui
System.Web.Compilation.Bui
System.Web.Hosting.Hosting
[HttpException (0x80004005): The pre-application start initialization method Start on type WebMatrix.WebData.PreAppli
System.Web.HttpRuntime.Fir
System.Web.HttpRuntime.Ens
System.Web.HttpRuntime.Pro
--------------------------
<?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>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.I
</configSections>
<connectionStrings>
<add name="DefaultConnection" connectionString="myConnec
</connectionStrings>
<system.web>
<customErrors mode="Off" />
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<pages>
<namespaces>
<add namespace="System.Web.Opti
<add namespace="Microsoft.AspNe
</namespaces>
<controls>
<add assembly="Microsoft.AspNet
</controls>
</pages>
<membership>
<providers>
<!--
ASP.NET Membership is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
-->
<clear />
</providers>
</membership>
<profile>
<providers>
<!--
ASP.NET Membership Profile is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
-->
<clear />
</providers>
</profile>
<roleManager>
<!--
ASP.NET Membership Role is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
-->
<providers>
<clear />
</providers>
</roleManager>
<!--
If you are deploying to a cloud environment that has multiple web server instances,
you should change session state mode from "InProc" to "Custom". In addition,
change the connection string named "DefaultConnection" to connect to an instance
of SQL Server (including SQL Azure and SQL Compact) instead of to SQL Server Express.
-->
<sessionState mode="InProc" customProvider="DefaultSes
<providers>
<add name="DefaultSessionProvid
</providers>
</sessionState>
</system.web>
<runtime>
<assemblyBinding xmlns="urn:schemas-microso
<dependentAssembly>
<assemblyIdentity name="WebGrease" culture="neutral" publicKeyToken="31bf3856ad
<bindingRedirect oldVersion="0.0.0.0-1.5.2.
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606
<bindingRedirect oldVersion="0.0.0.0-3.5.0.
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad
<bindingRedirect oldVersion="0.0.0.0-2.0.2.
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Secur
<bindingRedirect oldVersion="0.0.0.0-2.0.2.
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Secur
<bindingRedirect oldVersion="0.0.0.0-2.0.1.
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Secur
<bindingRedirect oldVersion="0.0.0.0-2.0.1.
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="AWSSDK" publicKeyToken="9f476d3089
<bindingRedirect oldVersion="0.0.0.0-2.0.2.
</dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.I
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory
<providers>
<provider invariantName="System.Data
</providers>
</entityFramework>
</configuration>
--------------------------
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER