TIP: IIS6 & Multi .NET Framework Versions
This is a quick 'gotch' issue I ran into recently with a WebService.
I created a new WebService on a remote server (QA2) from working code on my local computer but when I tried to run the Web Service through a browser I got a 404 page not found error.
The remote server was running Win2003 w/ II6 and it already had ASP.NET apps successfully running on it. I checked the ISAPI extenstions to see that .asmx was in there and it was.
My first thought was the strict security of Win2003 and how it disables HTTP GET/POST for webservices by default. So I added the code to the web.config to enable HTTP GET/POST and still got nothing.
-
<webServices>
-
<protocols>
-
<add name="HttpGet"/>
-
<add name="HttpPost"/>
-
</protocols>
-
</webServices>
-
</system.web>
I checked the properties page in IIS of my WebServices virtual directory and made sure my directory was registered to run ASP.NET and it was. The weird part was that I could run .aspx pages from the same directory with no problems.
I went back into the Server properties and opened the Application Configuration utility. On the mappings tab is a list of all of the application extensions and the executable path. From here I selected the .asmx extension and saw that in the path it was mapped to .NET Framework v2.0 which we are not using. I changed the executable path to v1.1.4322 and retried the WebService and every thing worked fine.
Before
After
