Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add a web service project using Visual Studio 2010?

I don't want WCF, I only want web service. Thank you.

like image 896
Alan Avatar asked Aug 16 '10 15:08

Alan


2 Answers

They've obscured it, but it's easy enough:

  • Right-click on your solution, select Add New Project.
  • In the Framework selection dropdown, select .NET Framework 3.5
  • Select the Web installed templates listing and you'll find ASP.NET Web Service Application as the last one in the list.

In other words, you can create one in .NET 3.5, but not 4. Now, that being said, it seems like it may be possible to create a .NET 4 template for VS2010, but I'm not a VS2010 guru, so that's for someone else to elaborate on.

Edited to Add: Somebody else posted a response to your question that was also a good answer, I thought, but they deleted it themselves for some reason. I don't remember their user name. I'll repeat it here.

If you create a new Web Application in the solution, you can then Add New Item, and one of the options under Web is "Web Service" at the very bottom.

The only drawback to this is that besides the web service, you also have the usual default items for a web application, namely default.aspx, about.aspx, global.asax, and site.master, as well as the folders Account, Scripts, and Styles. But you can delete these, so no problem. Also keep in mind that the web.config in the Web Application project will be different from that of the Web Service, and that the assembly bindings for the web service will point to ASP.NET v2 & v3.5 (see its web.config), whereas the service in the web application project will default to ASP.NET v4 (through its project file). I don't know if any negative implications exist for either way of working, though I suspect that both will work just fine.

like image 107
Cyberherbalist Avatar answered Oct 12 '22 05:10

Cyberherbalist


If you select the framework like mentioned above to 3.5 you can select a web service application. If you want it to be targeted at .NET 4.0 framework, go into my project --> Compile --> Advanced Compile Options --> change the target framework to .net framework 4.

You can also change your compile options to target it at a x64 or x86 (32 bit) server.

like image 34
William Avatar answered Oct 12 '22 06:10

William