Could not load file or assembly 'EntityFramework, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies - wcf

I am getting this error in a WCF web service when the program attempts to use a method that employs the entity framework. However, we know that the server has the entity framework (correct version) installed because it is hosting another WCF web service and an intranet site that use it successfully.
I've tried to set copy local to true, however this simply compiles the Entity Framework dll into the debug/release folder of the project that uses it, not the web service project that gets deployed (the project that gets deployed contains a references the project that uses the entity framework).
Has anyone run into this kind of issue before and know a work-around either with or without using copy local?

The solution to this problem was to simply place the EntityFramework.dll and .xml file generated in the bin of the project that uses the Entity Framework and place that in the bin of the service project that was being deployed.

Check to see that the Application Pool for the IIS Site in question is set to use to correct .NET Framework version. In the case of EF 4.1, the Application Pool should be running on .NET Framework version 4 or higher.
To identify the version of .NET being used by the site, first find out the Application pool in use (in IIS, click on Basic Settings for the site), then identify the appropriate pool under the Application Pools node. The .NET Framework version should be listed.

Check whether bit versions are compatible between entity framework and server. If the server is 64 bit and you are using 32 bit entity framework dll you can get this error. Then change app pool setting to enable 32 bit applications.

Related

IIS + ASP.NET Core 6 + Hosting Pack resulting in default document/directory listing error

I'm attempting to get IIS to serve our ASP.NET 6 web application, but every time it complains of needing a default document. If I run the exe (kestrel) one it will serve it, but we want it to be hosted by IIS with the other components of the site.
I installed the 6.0.10 runtime w/ hosting package and these are the results when listing runtimes:
When looking at the site modules, I think it should have what is needed (think the AspNetCoreModuleV2 one handles the compiled routing scenario?):
Have rebooted the server and the app pool specifically, set to No Managed Code, and whenever I attempt to load the page at the localhost level, I get:
The views are compiled so I don't think I even need IIS to open views locally in any capacity.
Everything you've posted ticks off the major deployment steps for hosting a .NET 6 project on IIS:
Installed the .NET Core 6.0 Runtime Windows Hosting Bundle
Set up the IIS app pool with "No Managed Code"
Rebooted the server: "Have you turned it off and on again?"
After our exchange in the comments, the only thing that appeared to be missing is to use the .NET publish command; not the build command.
When deploying to IIS, you'll want to run the dotnet publish command and then deploy those artifacts to your IIS server. From the docs:
The dotnet publish command's output is ready for deployment to a hosting system (for example, a server, PC, Mac, laptop) for execution. It's the only officially supported way to prepare the application for deployment. Depending on the type of deployment that the project specifies, the hosting system may or may not have the .NET shared runtime installed on it.
You also may want to review: Publish .NET apps with the .NET CLI.

Do i need to install asp.net mvc4 on iis server

I am going to deploy my application tomorrow ,so i have few questions.I want to deploy asp.net mvc4 application on 2003 server where .net framework 4.0 is installed.My question is do i need to install asp.net mvc4 also there.Or if i copy the dll responsible for mvc in to that system is sufficient?
another question is i am using entityframework and oracle database so using ODP.NET, if this is the case do i need to install ODP.NET over there or just copying DLL system.dataaccess dll is sufficient?
Rest all i follow this two links will it work
The two links are http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx/
How to deploy MVC application in 2003 server IIS
UPDATE
today i tried and unfortunately i came to know that the framework which i was running .net 4.5 will not be supported in 2003.I made my project in to .net 4.0 and everything working fine in local system,but remote system lot of errors are coming.Method not found etc. I came to know that i have to degrade EF 5.0 to 4.4 i did it like replaced dll and changed one line begin with section but no luck as of now.I have to change somewhere else also.Do you know any proper mechanism which i need to carry forward for this?
No need to install anything explicitly except .Net 4.0. All you need is make sure that all dependencies (assemblies) of your application i.e. MVC, ODP.Net etc are present in bin directory of your application. Also make sure that ASP.Net v4.0 Web service extension is enabled in IIS.
Steps to enable web service extension.
Open IIS 6.0 Manager
Click Web Service Extensions
Enable ASP.NET 4.0
Check below screenshot.

Why would Development Server be finding a specific assembly in the GAC and IIS not?

I wrote a WCF Data Service, when running it on the Development Server it runs without any issues; however, once I deploy it to IIS it throws this error System.IO.FileNotFoundException.
The assembly it can not find is located in the GAC. Why would Development Server be finding a specific assembly and IIS not?
Enabling 32 bit applications on the Application Pool fixed the issue.
Just my guess, but I reckon the assembly is compiled as .net 4 and IIS is running under .net 3.5. Check here.

Retrieving the COM class factory for component with CLSID {XXXX} failed due to the following error: 80040154

I am running 32 bit Windows 7 Operation System which has IIS 7.5 installed.
In Visual Studio 2010, I open my solution having the web site project hosting WCF service. I have created an application in the IIS which points to the website project. The web site's bin folder has many assemblies which I need to refer. But those assemblies also have built using .NET 4 on the same computer.
I can browse the WCF service using both HTTP & HTTPS.
However, when i access the service from the test windows application (using the proxy class of the WCF contract), I get the error in question. Everything was working without problem earlier.
Anyone can help to fix the issue?. How to investigate this issue?
Error 0x80040154 means "Class Not Registered", which usually means you're depending on a COM component that hasn't been installed properly on the machine.
Is any of those Assemblies you reference a COM Interop Assembly? If so, find out what it uses and then install the appropriate COM component.

WCF Server Application Unavailable - how to run application written in .NET4.0 (IIS6+)

I am trying to run simple application (e.g. generated from template by VS.NET 2010) on IIS6.
I changed it to run with .NET 4.0 (its application pool) and checked with regiis (this pool has 4.0). I also changed all possible httpHandlers (svc etc), to run with NET4.0. All possible rights are checked (i think so).
Almost every request results in "Server Application Unavailable" (sometimes it is empty page with -2146232576 (0x80131700) value) and "...Please review this log entry to discover what caused this error to occur." but EventViewer and IIS Log are empty.
Any ideas? Where to find error details?
Do you run any 2.0 apps on the same server? If yes it could be the issue in case they bot use the same application pool. The application tool itself doesn't have any .NET version setting, it's per virtual directory (application). But you can't use the same application pool to run applications with different versions of .NET Framework apps.
Create two seperate app pools one for your CLR 2.0 and CLR 4.0, the older clr can not host both CLRs, there was a similar issue with 1.1 and 2.0.
cheers
A little bit old question, but still could help someone...
If you installed the higher .NET f/w recently, check, if your apps written for lower versions of .NET f/w were not (automatically) moved to new app pool for the higher f/w.
Many years ago something similar happenned to me after f/w 3.5 installation. Then my 3.5 application worked fine, but after any of the 2.0 apps was firstly called, the app pool crashed.
Needed to move every app to corresponding app pool.