"Could not create type..." error deploying webservice
I know this question has been asked a billion times already because I've found several instances on the net, but none of the proposed solutions seems to solve my problem, so I'd appreciate any help.
I've created a C# webservice on my local machine that runs fine. Now I'm trying to deploy it to a webserver. The server is Windows 2003 with IIS 6. I created a new virtual directory in IIS, set it to be an application, and gave it "scripts only" execute permissions. I've manually copied all the files from my local webservice directoy to the virtual directory on the server. When I try to access the page, I get the dreaded "Could not create type 'Service'" message. Here is some additional interesting information:
1. I'm new to VS 2005 / .NET 2.0, and still kind of new to webservices in general. I've noticed that when I build the webservice on my local machine, it doesn't create a .dll for my service like webservices I created with VS 2003. Instead the App_Code directory sits in the virtual directory containing my code file, and apparently the website is dynamically compiling it. There is no 'Bin' directory (well, technically there is because I added a reference to a class library, and it's dll sits there, but there's nothing compiled from my project there). Is this copacetic? I read up on the "publish web site" feature that is supposed to generate an already-compiled dll, but when I tried it it didn't work either.
2. My local machine is running IIS 5. On the settings for the local virtual directory, I've noticed that the web service is set to use integrated windows authentication (might have set that myself manually, don't remember). By default it's not on the production web server, but turning that on does not make it work.
3. On the ASP.NET tab of the virtual directory properties, by default the asp version was set to 1.1 (under which I get the "Could not create type" error). When I try changing it to 2.0 (which I figure is what I need, given that I developed the service under 2.0), I get a "Page cannot be displayed" error instead.
4. I tried at one point creating a web deployment project, which created an msi file I ran on the webserver. All that seemed to do was do exactly what I did manually, still resulting in a non-working web service.
Why is setting up a virtually trivial web service so stinking hard?
[2454 byte] By [
awesj] at [2007-12-23]
I am getting the same error.
I have Visual Studio 2005 Team Edition for Software Developers.
I am doing the following steps
1. Create New Web Service
2. Right Click on Project and Publish at http://localhost/Website2
First it gives the following error
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: <!-- |
Source File: c:\inetpub\wwwroot\Website2\web.config Line: 12
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032
Now remove the
<
appSettings/>
<connectionStrings/>
lines from the code
and Right Click and Publish again at the same location
Now if you access http://localhost/WebSite2/Service.asmx
You will find the following error
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="vb" CodeBehind="~/App_Code/Service.vb" Class="Service" %> |
Source File: c:\inetpub\wwwroot\WebSite2\Service.asmx Line: 1
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032
Any Idea how to remove it?
Any other work around to distribute a website without code?
akois wrote: |
| i got the solution.. make sure set your 1. webservice.asmx file properties > Build set to Contents 2. webservice.asmx.vb file properties > Build set to Compile |
|
think running on the local server is a starter part of the problem.After thousands of forum and resource search i came over the deployement problem of web services.
This answer may not match the question but someone should concern about the problems while deploying web service to web.
First of all you have correct the problems depends on the configurations on web.config file.Remove the authantication setting and define custom error tag like below.Also before deploying, you may set compilation debug to "false".
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm"/>
<error statusCode="404" redirect="FileNotFound.htm"/>
</customErrors>
Be sure web service is running on local.After this upload the directory, enter the control panel of your hosting (plesk or cpanel) create virtual directory which shows the real one.
Open internet explorer and write the url of virtual directory.
The reason i wrote these is that i have searched a lot about this but the is no answer about this problem.At last i found it and wanted to share this information.I appologise If there is any grammer or spelling mistakes.
Thanks everybody... Kvtlv