views:

67

answers:

3

Hello.

I have created a folder and published my webservice to this folder. I then created an application (in IIS 7) and pointed it at this folder location. When I try and hit the ASMX file from a browser on the local machine I get the following error:

HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid.

Can someone tell me why?

A: 

It seems to be something related with the web.config file, check it first.

Also, ,maybe you missed registering asp.Net in IIS, you can run aspnet_regiis.exe on the server, with the -i flag

C:\WINDOWS\Microsoft.NET\Framework\<your framework version here>>aspnet_regiis.exe -i
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis.exe -i

Reading your error report, I see you have not installed the System.Web.Extensions dll, Install it and/or put it on your bin folder (System.Web.Extensions.dll)

Jhonny D. Cano -Leftware-
I performed the asnet_regiis but with no change.
Nick
A: 

Try this the other way around. Publish directly to IIS, taking the option to create the virtual directory. Let Visual Studio configure the virtual directory (or application) the way it wants to.

John Saunders
Same thing. It complains specifically about this line in the config:<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
Nick
Check the IIS configuation and make sure of which .NET Framework version you have deployed there. Also, please post the complete error message.
John Saunders
John- I'm giving you credit for the fix because it led me to the solution. The application pool was running on .NET 4.0. Changing this back to 2.0 fixed the issue. But why doesn't 4.0 work? There must be new configuration changes in the new framework.. I suppose.
Nick
@Nick: issues like this have happened before because of new configuration sections. In particular, a .NET 2.0 config file won't work if the site is configured for .NET 1.1 - not so much because of the differences in the Framework, but because the config section types simply don't exist in .NET 1.1.
John Saunders
A: 

Give permissions to the folder for the IIS_IUSRS group. Also, see what is the Identity of the application pool for the application in IIS manager->"Application Pools".Set it as "LocalSystem".

Shishir