0

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=&quot;data source=someip;initial catalog=db_90;User ID=user1;Password=access2;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>
</configuration>
HopelessN00b
  • 53,795
  • 33
  • 135
  • 209
Juw
  • 127
  • 1
  • 10
  • has your IIS 7.5 been configured to run ASP 32 bit application pools? – kafka Oct 03 '12 at 14:00
  • Don´t know. How can i check that? Also why can´t i post my config file...do i need to indent all rows with 4 spaces=tidius work. – Juw Oct 03 '12 at 14:01
  • Copy and paste the contents, select all of them, then click the Code icon to wrap it. – Brent Pabst Oct 03 '12 at 14:03
  • Thx Brent for the help. Config file posted. – Juw Oct 03 '12 at 14:04
  • Since your are installing the service in 'D:\services\' double check the permission settings. – Erwin Oct 03 '12 at 14:29
  • @Erwin yes, it seems to be an issue with permissions. Check my update. But i don´t know how to fix it. – Juw Oct 03 '12 at 15:20
  • The servers event log should tell you more about the issue. You could also enable the error pages as well. Please note as well that a standard IIS 7.5 will come with minimum http handlers installed. Even the StaticFileModule might be missing, so you could start by comparing the Modules list on the server compared to your dev machine. – jishi Oct 03 '12 at 15:22
  • Thx guys for the help. Check my initial post under Update 2. – Juw Oct 04 '12 at 09:05

1 Answers1

0

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.

Scott Forsyth
  • 16,449
  • 3
  • 37
  • 56
  • Here is the error...NOTE. I changed the Application pool to run in Classic mode (the dev server also run in this mode) no more 500 errors. I get a blank page and when i check the headers returned i get 404 error. He is the log from the IIS 7.5 server: 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 – Juw Oct 03 '12 at 15:11
  • That's a 404.2 error code which suggests that it's something with the ISAPI settings: http://forums.iis.net/t/1160971.aspx. What's the substatus code for the 500 error back in Integrated mode? Also, testing with a test.aspx page is worth doing early on too. – Scott Forsyth Oct 03 '12 at 16:19
  • Thx guys for the help. Check my initial post under Update 2. – Juw Oct 04 '12 at 09:05
  • Hi Juw. That would do it. Excellent, glad you were able to track it down. – Scott Forsyth Oct 04 '12 at 14:56