visual-studio Visual Studio 2010 中缺少 Asp.Net Web 服务应用程序

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4345498/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 12:50:56  来源:igfitidea点击:

Asp.Net Web Service Application missing in Visual Studio 2010

visual-studio-2010web-servicesvisual-studio

提问by Fraz Sundal

Possible Duplicate:
VS 2010 Web Service project template missing?

可能重复:
缺少 VS 2010 Web 服务项目模板?

I'm wondering why Asp.Net Web Service Application is missing in Visual Studio 2010. If it's updated to something new in Visual Studio 2010 what is it? If it's drop then how can I accomplish that task?

我想知道为什么 Visual Studio 2010 中缺少 Asp.Net Web 服务应用程序。如果它已更新为 Visual Studio 2010 中的新内容,那是什么?如果它下降,那么我该如何完成该任务?

回答by amit

ASP.NET Web Service Application project template is not available for .Net framework 4.0, however, available for .Net Framework 3.5.

ASP.NET Web 服务应用程序项目模板不适用于 .Net Framework 4.0,但可用于 .Net Framework 3.5。

If you're building your application on .net framework 4.0, You can use WCF Service Application as ASMX in legacy. Please note that you'd need to enable AspNetCompatibilityMode to access HttpContext objects.

如果您在 .net framework 4.0 上构建您的应用程序,您可以使用 WCF 服务应用程序作为旧版中的 ASMX。请注意,您需要启用 AspNetCompatibilityMode 才能访问 HttpContext 对象。

If you still want to use ASMX, choose ASP.NET Empty Web application and then you can add ASMX files to the project.

如果您仍然想使用ASMX,请选择ASP.NET Empty Web application,然后您可以将ASMX 文件添加到项目中。

回答by VinceJS

To create a ASP.NET Web Service Application in Visual Studio 2010 using the .NET Framework 4.0, first create a new project targeting the .NET Framework 3.5 (as the ASP.NET Web Service Application template is available for this version). Then right-click the project and re-target it to use the .NET Framework 4.0. Build, debug, done!

要使用 .NET Framework 4.0 在 Visual Studio 2010 中创建 ASP.NET Web 服务应用程序,首先创建一个面向 .NET Framework 3.5 的新项目(因为 ASP.NET Web 服务应用程序模板可用于此版本)。然后右键单击该项目并将其重新定位为使用 .NET Framework 4.0。构建,调试,完成!

回答by Reka

I too had the same problem when publishing web services from Navision. For that I created the project based on the .Net framework 3.5 (as the ASP.NET Web Service Application template is available for this version) in Visual Studio 2010 and it works fine for me.

从 Navision 发布 Web 服务时,我也遇到了同样的问题。为此,我在 Visual Studio 2010 中创建了基于 .Net 框架 3.5(因为 ASP.NET Web 服务应用程序模板可用于此版本)的项目,它对我来说很好用。

回答by Matthew Cole

I hit the same problem. It looks like .svc files are no longer necessary as of WCF 4.0, as Configuration-Based Activationwill take care of this for you.

我遇到了同样的问题。从 WCF 4.0 开始,似乎不再需要 .svc 文件,因为基于配置的激活将为您处理此问题。