I am trying to install a webservice that some other guy wrote in .NET. I have some basic IIS understanding. The webservice works just fine on my dev computer, but when I try to move the webservice to a production server, bad things happens.
The webservice is located at C:\inetpub\wwwroot\
on the dev server. But on this production server it is to be located at D:\services\
.
I have managed to install an application on the production server and everything seems fine and dandy. But when I Test Settings
in the initial setup, I get an Invalid application path
error. I can just close it down and still install it, but then when I try to access the webservice (at http://myserver.com/webservice/GetData
) nothing happens. Just a blank page, and when I check the response headers, there's a 500
error.
I don´t know what is going on here or where the problem is. Here's the config file here so someone might notice something odd.
EDIT: The config file is from my dev server. I just copied it to my production server…but that obviously didn't work 🙂
UPDATE: I noticed that my dev server run in an Application pool with Net 4 and in "classic" "mode". On the production server it was in NET 4 but in "integrated" mode. So i changed it to "classic". I still get a blank page. But checking the log will output this:
2012-10-03 14:57:00 ip removed GET /boo/GetData – 80 – ip removed Mozilla/5.0+(Windows+NT+6.1;+WOW64;+rv:15.0)+Gecko/20100101+Firefox/15.0.1 404 2 1260 203
UPDATE 2: Thank you guys for your help. Your comments helped what to look for. After a lot of log looking, and rights management I found this Microsoft KB.
After checking ISAPI and CGI Restrictions on server level i found out that .NET 4 and .NET 4 64 was not allowed. After allowing both, FINALLY my webservice started to talk.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<identity impersonate="true" />
<!-- Impersonate NT AUTHORITY/IUSR -->
<compilation targetFramework="4.0">
<assemblies>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b7735c561131e089" />
</assemblies>
</compilation>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<httpErrors existingResponse="PassThrough" />
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
<directoryBrowse enabled="false" />
</system.webServer>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<standardEndpoints>
<webHttpEndpoint>
<!--
Configure the WCF REST service base address via the global.asax.cs file and the default endpoint
via the attributes on the <standardEndpoint> element below
-->
<standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true" />
</webHttpEndpoint>
</standardEndpoints>
</system.serviceModel>
<connectionStrings>
<add name="Entities" connectionString="metadata=res://*/DataModel.csdl|res://*/DataModel.ssdl|res://*/DataModel.msl;provider=System.Data.SqlClient;provider connection string="data source=someip;initial catalog=db_90;User ID=user1;Password=access2;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
</configuration>
Best Answer
This may be a better question for stackoverflow.com but I'll take a stab at it for now.
From an IIS perspective if you can find out the specific 500 error it may give a big clue. Check the IIS logs in c:\inetpub\logs\Logfiles\w3svc{siteid}. Find the records for your failed tests and towards the end of the records you should see a 500{space}{something}{space}{something}. It's the {something}'s that have further clues.
Another test is to create a simple test.aspx in the root folder of the site and make sure that the IIS site works well too.