[RESOLVED] C# Web Service publish problem(S)
OK I created a web service in C# with the default "HelloWorld" Class and a second Class of my design (OK copied from another example).
I was able to "run" it from the IDE, after a web.config tweak.
However when I publish it to C:\Inetpub\wwroot\MyWebService, and I then browse to it using IE, I get the following error page:
Server Error in '/' Application.--------------------------------------------------------------------------------
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Unrecognized configuration section 'connectionStrings'
Source Error:
Line 10: <configuration>
Line 11: <appSettings/>
Line 12: <connectionStrings/>
Line 13: <system.web>
Line 14: <webServices>
Source File: c:\inetpub\wwwroot\MyFlexService\web.config Line: 12
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2407; ASP.NET Version:1.1.4322.2407
1 Attachment(s)
Re: C# Web Service publish problem
OK I delete lines 11+12 out of that web.config but still have error:
Server Error in '/' Application.--------------------------------------------------------------------------------
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Source Error:
Line 29: ASP.NET to identify an incoming user.
Line 30: -->
Line 31: <authentication mode="Windows"/>
Line 32: <!--
Line 33: The <customErrors> section enables configuration
Source File: c:\inetpub\wwwroot\MyFlexService\web.config Line: 31
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2407; ASP.NET Version:1.1.4322.2407
Re: C# Web Service publish problem
OK I went to IIS Mangler and went to the WebFolder, right-click, properties.
On the Directory Tab, I did a "Create Application", but still get an error:
Server Error in '/MyFlexService' Application.--------------------------------------------------------------------------------
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not create type 'Service'.
Source Error:
Line 1: <%@ WebService Language="C#" CodeBehind="~/App_Code/Service.cs" Class="Service" %>
Source File: c:\inetpub\wwwroot\MyFlexService\Service.asmx Line: 1
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2407; ASP.NET Version:1.1.4322.2407
Re: C# Web Service publish problem(S)
The answer is at the bottom of the error message - you're running a .NET 2.0 application on .NET 1.1. Does your server have .NET 2.0?
Re: C# Web Service publish problem(S)
It should - Let me try to change this.
Re: C# Web Service publish problem(S)
Re: C# Web Service publish problem(S)
Yes, sorry for the delayed response. I am still baffled why a default project doesn't work.
ie... I'm not sure why I needed to do the web.config tweak. Let me look into this again this week to see if all my problems are related to the IIS ASP.NET (1.0 or 2.0) setting.
Re: C# Web Service publish problem(S)
Your default, in IIS, is probably set to 1.1. If you have no (other) important apps in IIS, you can right click on default website and set it to use (under the ASP.NET tab) ASP.NET 2.0. New virtual directories will then use .NET 2.0.
1 Attachment(s)
Re: C# Web Service publish problem(S)
It is already default ASP.NET = 2.0...
Re: C# Web Service publish problem(S)
Right click default website, create a new virtual directory. Look at its properties. What do you get?
1 Attachment(s)
Re: C# Web Service publish problem(S)
Re: C# Web Service publish problem(S)
OK, so I wonder if that was only a temporary thing.
Create a new .NET 2.0 web app in VS 2005. In the project properties, web tab, there is a button which lets you create a new IIS virtual directory. Try that out. Then publish/run the app...
Re: C# Web Service publish problem(S)
OK so my 2 problems were:
a) Default webseite needs to be ASP.NET 2.0, and
b) machine.config file needs a tweek , see http://www.vbforums.com/showthread.php?t=567742
I think these problems are resolved now.