Why Am I getting this error with my MVC5 project? I already added System.Data.SqlClient 4.0.0-beta-23019 nuget package in mu project.json. Any suggestions?
Error message:
FileNotFoundException: Could not load file or assembly
'System.Data.SqlClient, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The
system cannot find the file specified.
Related
I have an ASP.Net MVC Entity Framework project which is working fine on local machine. But when I upload it to Azure Web App, I get following error:
Could not load file or assembly 'System.Web.WebPages.Razor,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or
one of its dependencies.
Full screenshot
The version I have referenced in project is 3.0.0.0 and same is present in bin folder. I have cleaned and rebuild project several times and also deleted obj and bin directories but in vain.
Why is it trying to find version 2.0.0.0 when I have referenced 3.0.0.0?
I have upgraded my MVC3 application using the Nuget UpgradeFromMvc3ToMvc4 which has worked fine, except for one component. I did uninstall the V3 of this "MvcSiteMapProvider" component before upgrading, and then installed "MvcSiteMap Core V4" after the MVC4 upgrade.
Ther error I get is:
Error 41 Assembly 'MvcSiteMapProvider, Version=4.6.18.0,
Culture=neutral, PublicKeyToken=1923abe4657913cc' uses 'System.Web.Mvc,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which
has a higher version than referenced assembly 'System.Web.Mvc,
Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
d:\..\MvcSiteMapProvider.MVC4.Core.4.6.18\lib\net45
\MvcSiteMapProvider.dll
There is no reference to 3.0.0.0 in my solution. I have done a "find" in "all files". So am confused.
Any help appreciated. Thanks.
Drop refference to System.Web.MVC and readd it.
Sometimes this just happends.
After installing ASP.NET MVC Fixed DisplayModes package, I get the following error when building my MVC4 website:
ASPNETCOMPILER : error ASPRUNTIME: [A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B]System.Web.WebPages.Razor.Configuration.HostSection. Type A originates from 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'. Type B originates from 'System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Users\Muhammad\AppData\Local\Temp\Temporary ASP.NET Files\temp\8b747d93\6b897626\assembly\dl3\00bbd837\ffb45330_28d7ce01\System.Web.WebPages.Razor.dll'.
I searched the project configuration and references for and mention of version 2.0 of System.Web.WebPages.Razor and removed it with no success.
I know this a old post, but try this:
http://www.asp.net/mvc/tutorials/mvc-5/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2
I have a ASP.NET MVC 2 website (VS2010) that I have upgraded to ASP.NET MVC 3 (VS2012) and this works fin on local IIS7 but when publishing it I get this exception on host :
Could not load file or assembly 'System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
After some seartch I found this that states that I should set CopyLocal on some of the references(inlcuding the System.Web.WebPages) and also use the publish tool in VS2012, but this generated the following exception?
Could not load file or assembly 'System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
And I canĀ“t find any Deployment dll to set copyLocal?
How could I solve this?
Have a read of http://joel.net/getting-asp.net-mvc-3-working-on-discountasp.net
You need to add a reference to System.Web.WebPages.Deployment and set that also to CopyLocal.
I'm having an issue with FSlex/FSyacc crashing on my machine.
In context this is inside Visual Studio 11 beta running on Windows 8 Consumer Preview (32 bit) running inside a Parallels virtual machine.
------ Build started: Project: Basis, Configuration: Debug Any CPU ------ C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1546,5):
warning MSB3245: Could not resolve this reference. Could not locate
the assembly "log4net, Version=1.2.11.0, Culture=neutral,
PublicKeyToken=669e0ddf0bb1aa2a". Check to make sure the assembly
exists on disk. If this reference is required by your code, you may
get compilation errors. Basis ->
C:\Users\nexus\Desktop\Statical\trunk\Statical\Basis\bin\Debug\Basis.dll
------ Build started: Project: Syntax, Configuration: Debug Any CPU ------ cd C:\Users\nexus\Desktop\Statical\trunk\Statical\Syntax\ CALL C:\Users\nexus\Desktop\Statical\trunk\Statical\Syntax\fsyacc.cmd CALL
C:\Users\nexus\Desktop\Statical\trunk\Statical\Syntax\fslex.cmd
Running fsyacc.cmd... CalParser.fsp Running fsyacc.exe... Unhandled
Exception: System.IO.FileNotFoundException: Could not load file or
assembly 'FSharp.Core, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The
system cannot find the file specified. File name: 'FSharp.Core,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at .$FSharp.PowerPack.FsYacc.Driver.main#() WRN:
Assembly binding logging is turned OFF. To enable assembly bind
failure logging, set the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There
is some performance penalty associated with assembly bind failure
logging. To turn this feature off, remove the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog]. Running fslex.cmd... Not
running fslex.exe as CalLexer.fs is newer than CalLexer.fsl
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1036,5):
error MSB3073: The command "cd
C:\Users\nexus\Desktop\Statical\trunk\Statical\Syntax\ CALL
C:\Users\nexus\Desktop\Statical\trunk\Statical\Syntax\fsyacc.cmd CALL
C:\Users\nexus\Desktop\Statical\trunk\Statical\Syntax\fslex.cmd"
exited with code -532459699. Done building project "Syntax.fsproj" --
FAILED.
The relevant piece seems to be this:
Unhandled Exception: System.IO.FileNotFoundException: Could not load
file or assembly 'FSharp.Core, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The
system cannot find the file specified. File name: 'FSharp.Core,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at .$FSharp.PowerPack.FsYacc.Driver.main#()
Not sure why it can't locate the FSharp.Core assembly.
Ideas?
I had forgotten to install F# 2.0. There was a dependency on that.