Problem hosting WCF service in IIS Express

2019-02-21 17:48发布

问题:

We are trying to host a WCF service in IIS Express 7.5 (7.5.1046). IIS Express starts correctly, but when trying to connect to our .svc file, we get an exception with the message "Unable to load DLL 'nativerd.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)".

We have searched for this dll and it is present at %WINDIR%\system32\inetsrv\nativerd.dll. The applicationHost.config file that we are using is based on the templates that IIS Express install in the user´s directory.

The system has Windows 7 as operating system, with Visual Studio 2010 SP 1 and IIS 7.5 configured to run WCF applications.

Anyone has experienced this same issue? Maybe IIS has any influence in IIS Express installation?

回答1:

After comparing a working installation of IIS Express and the one that one was failing, we have noticed that the problem was that in the user´s home directory there wasn´t an "IISExpress\config" folder with some configuration files. This folder is created only in the home directory of the user who installed IIS Express. Just copying the "config" folder to the home directory of the other user in "My Documents\IISExpress" we have been able to run the web service without further problems.

Hope this helps to other who could experience this same issue.



回答2:

In my case, the WCF project was being opened normally, then suddenly this error started (using IIS express as well).

Problem solved after changing the port in project Properties, under Web menu.

Changed from:

http://localhost:50206/

To:

http://localhost:50207/

Just added 1 to the port. Can't tell exactly why this happened, before that I tried even deleting bin and obj folders, IISExpress folder in My Documents, and neither the above solution helped me, though it helped others.

I hope this help someone one day.



回答3:

I think that when you upgrade IIS express it doesn't add some entries into your applicationhost.config file. I moved move config folder and re-ran my web project then it was fixed