ASP.NET Web Service template not exist?

I have a full installation of Visual Studio 2010 with .Net framework 4. I want create my first web service. but not exist web service template.
In visual studio 2010 I go to File -> New Web Site menu , but in the New Web Site dialog box not exist ASP.NET Web Service template.

enter image description here

How to create a Web Service?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Use File->New Project->WCF Service Application.

“ASP.NET Web Services” (aka ASMX) is a legacy technology. It exists only to support existing ASMX services. Do not use it for new development.

Method 2

create ASP.net Empty Web Site and add asmx file. that’s it.

Or You can Target the .Net Framework to 3.5 when you create the project and web service template available for .net 3.5, create the project and re target it to 4.0 or 4.5

But You better move to Windows Communication Foundation (WCF)

Method 3

Go to File –> New –>Asp.Net Empty Web application.
on that Right click –> Add New item – >webservice template

Method 4

File > New Project > Visual C# > Web Service Application

You can create multiple projects under one solution..
create a web service,build and run it.
Then create another webapplication under the same solution file.
Add reference..
Thats it..


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x