Deploying a Web Service (VS 2005 Beta 2) Problem
Hello,
I am having the most difficult time trying to deploy a web service created with Visual Studio 2005, Beta 2. I'm hoping that I'm just missing one small detail and that someone can point it out to me.
I have stripped this down to the most basic "Hello World" web service. In fact, all I did for this was create a new web site, ASP.NET web service and left everything as is. Here are the steps to reproduce:
1) In Visual Studio 2005 beta 2, create a new web site, ASP.NET web service and leave everything as is. The HelloWorld web method will work fine.
2) Compile the application/Build the website. Right click on the service.asmx file in the Solution Explorer and select View in Browser. Verify that everything works correctly.
3a) Go back to Visual Studio and under the Website menu and select the Copy web site menu item. In the remote web site, browse to a directory on the same computer to deploy your files to. I deployed every file in the application.
3b) Make that directory that you deployed the files to a virtual directory. Then fire up your web browser and navigate to the web service. For example: http://localhost/deploy/service.asmx.
3c) View the error "Could not create type 'Service'"
OR replace step 3 with step 4. Both end up not working.
4a) Go back to Visual Studio and under the Build menu select the Publish ... menu item.
4b) Follow the steps to publish the web site to a folder on the same computer. Make the folder a virtual directory. Fire up your web browser and navigate to the web service. For example: http://localhost/deploy/service.asmx.
4c) Again, no go, view the error.
What am I missing here? What do I need to do to get the web service to work? I know that it actually does work from the results in step 1. I'm missing something ...
Thank you for any help with this!
I have been encoutering this same problem and am interested in the solution
Did you create a Web application in the new vroot?
I'm not sure what you mean by create a new web application. The virtual directory is set up, and all of the web services files are there.
Open up the IIS manager and take a look at the directory - in particular the icon shown beside it. Is it a normal folder icon? Or does it look like a box with some stuff in it?
The folder icon indicates a virtual directory - the box indicates a web application. To change it, right click on the directory and select properties. You should see an "Application Name" field, which I'm guessing is set to "Default Application" and greyed out. Beside it is a Create button. Click on that, and it'll create the application (changing your folder to a web application).
Hi Glenfar,
It is a web application. The machine is Windows Server 2003, so the stuffed box looks like a gear, but the same thing; the application name is there. Thx!
Cindy, I think you missed what Glenfar meant.
When you create a new web service from inside Studio, it marks that subdir as an Application in the IIS metabase.
When you create a subdir manually and copy to it, it is just a subdir.
Try right clicking on the sub you created and select properties.
On the Directory tab you should see Application Settings. If you can click the create button, do so and then hit apply.
If the above does not help, you will need to compare the properties of the webservice that works and the one you created to find the difference.
It sounds to me though, that your "copy" of the webservice is not an Application.
Hi Robert,
Sorry, I am sure that the application is created. The Create button is not there (it is actually Remove since it is created). I tried Removing it and re-Creating it, but that didn't help.
It seems that the application is not compiled (or compiling what is in the app_code directory), or it should recognize that class, right? I thought that the Build menu -> Publish Web Site menu item would work. When the files are deployed to the target location, I see the PrecompiledApp.config file in the root, the Service.asmx file in the root, and the files in the bin. However, still accessing this (http://localhost/MyService/Service.asmx) returns a parser errors "Could not create type 'Service'."
It would seem that the application is not compiled? Or something of that nature.
Yes! Solved it!!!

It was in the IIS settings, in the ASP.NET tab. The ASP.NET version selected in the drop down list was incorrect. It defaulted to 1.1.4322.0, when it should have been 2.0.xxxx. Finally, it works!!! 
For anyone else who is having this problem, here is what you need to do to fix it:
* Open up IIS manager
* Right click on the web application that you have defined for your web service, select properties.
* Click the ASP.NET tab.
* In the ASP.NET version drop down list, make sure that version 2.xxxx is selected!
* Click Apply
* Click OK
Then deploy your web service and see it work.
Thank you everyone for your help!
I'm using IIS under XP Professional.
What if there is no "ASP.NET" tab in IIS Manager under properties for the website?
There's nothing in there about ASP.NET at all, so I can't implement this fix...
Hi Jeff,
Make sure that you have the 2.0 framework installed on the machine.
I have a similar problem and I think its because of the way webservice dev is set up. I will like to know what files needs tobe copied to a production service in order for the webservice to work.
I developed my webserivice whose working folder is located at C:\Documents and Settings\Administrator\My Document\Visual Studio 2005\WebSites\Mywebservice
In this folder is the App_Code(which contains service.cs) , App_Data, App_WebWebreference, mywebservice.asmx and web.config.
Now when i compile this is vs, it works just fine.
In order to move the web service to the production server
I published the site to the location C:\Documents and Settings\Administrator\My Document\Visual Studio 2005\Projects\MywebserviceSolution\PrecompiledWeb\ Mywebservice and in that folder contains the bin (which contains App_code.dll and App_Code.compiled) , mywebservice.asmx, PrecompiledApp.config and web.config.
I created a web application in IIS and copied the files in C:\Documents and Settings\Administrator\My Document\Visual Studio 2005\Projects\MywebserviceSolution\PrecompiledWeb\ Mywebservice but that didnt work
So, right click on the webservice site in VS and then to > copy web site and copied the content of C:\Documents and Settings\Administrator\My Document\Visual Studio 2005\WebSites\Mywebservice onto my IIS web application folder but that didnt work either (i know it wouldnt really work because it doesnt have any dll's)
Is there any easier way of deploying webservice because this is just a mess. Please help ASAP.
FYI: I using VS 2005 Pro, not the beta version
Hi
Can you tell me what is the error you are getting while deploying the Issues? Here is something to check for you
1. Go to Visual studio2005 Command prompt then type Apnet_regiis –u .it will uninstall aspnet .Then type Apnet_regiis –I .it will again install aspnetIIS server
2. go to IIS->Your Virtual directory->property->asp net Tab Then make sure it is framework ver 2.xxxx
Hope this may help you. If not Can you type here what the error you are getting.