简体   繁体   中英

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 :)

  1. Create Empty ASP.NET Project 在此输入图像描述
  2. Add Web Service(asmx) to your project
    在此输入图像描述

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 ?)

在网站框中,您选择了.NETFramework 4.5并且它没有显示,所以点击那里并选择3.5 ...我希望它有所帮助。

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM