Could not load file or assembly System.Web.Entity... - what am I missing?
I've tried deploying my asp.net app to a new server and I get this error:
Could not load file or assembly 'S开发者_StackOverflow中文版ystem.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
Sure enough, System.Web.Entity isn't found in C:\Windows\Assembly. However, the server has MS .NET Framework 3.5 installed and also MS ASP.NET 2.0 AJAX Extensions 1.0.
Is this something I need to deploy with my app, or something I need to be installed on the server? It's not my own server so xcopy deployment within my app folder would be much better if that's possible.
(Sorry this is probably a real newbie question.)
thanks!
Do you really use/need the EntityDataSource on the deployment server ?
If not, just remove this line.
Could not load file or assembly 'System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
Some information about EntityDataSource.
EntityDataSource is a new DataSource control for ASP.Net (just like ObjectDataSource and SQLDataSource and more recent - LinqDataSource) which makes declaratively binding ASP.NET UI controls to Entity Data Models very easy.
more on
http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/05/12/EntityDataSource-Entity-Data-Source.aspx
In my web.config this does not exist neither on 2008/2010 vs projects.
It turned out the dependency was on .NET framework 3.5 SP1
But also I was able to do without the reference, as @Aristos suggested.
I was getting the same error but for .Net 4.5 assemblies.
Could not load file or assembly 'System.Web.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
Solution:
Through detailed debugging log in VS 2012 output i found the following location missing the dll. I had to copy from another machine to resolve.
C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Entity\v4.0_4.0.0.0__b77a5c561934e089
Please don't copy from C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5 which is a reference assembly throws same error again.
精彩评论