Robert Jaskowski
Robert Jaskowski

Reputation: 823

Create a asmx web service in C# using visual studio 2013

Hy,

how can I create a asmx web service in Visual Studio 2013?

I have found this short tutorial about that, but when I follow this in Visual Studio 2013 I get an error that says "the type 'Service1' could not be created".

Thanks for help :)

Upvotes: 41

Views: 148200

Answers (4)

user1040975
user1040975

Reputation: 440

Check your namespaces. I had and issue with that. I found that out by adding another web service to the project to dup it like you did yours and noticed the namespace was different. I had renamed it at the beginning of the project and it looks like its persisted.

Upvotes: 0

Kika_Fortez
Kika_Fortez

Reputation: 314

on the web site box, you have selected .NETFramework 4.5 and it doesn show, so click there and choose the 3.5...i hope it helps.

Upvotes: 7

Noctis
Noctis

Reputation: 11763

Short answer: Don't do it.

Longer answer: Use WCF. It's here to replace Asmx.

see this answer for example, or the first comment on this one.

John Saunders: ASMX is a legacy technology, and should not be used for new development. WCF or ASP.NET Web API should be used for all new development of web service clients and servers. One hint: Microsoft has retired the ASMX Forum on MSDN.


As for comment ... well, if you have to, you have to. I'll leave you in the competent hands of the other answers then. (Even though it's funny it has issues, and if it does, why are you doing it in VS2013 to begin with ?)

Upvotes: 24

Damith
Damith

Reputation: 63065

  1. Create Empty ASP.NET Project enter image description here
  2. Add Web Service(asmx) to your project
    enter image description here

Upvotes: 103

Related Questions