【问题标题】:Adding a web reference in visual studio for mac在 Visual Studio for Mac 中添加 Web 引用
【发布时间】:2019-03-24 08:41:26
【问题描述】:

我想在 Visual Studio for Mac 'Community' Edition (7.8.3) Build 2 的 ASP.NET Core 2.2 项目中添加 Web 服务引用。从我读到的答案Add Service Reference in .NET Core in Visual Studio for Mac,右键单击我的项目显示一个添加命令,但是我看不到任何地方可以在其下添加 Web 引用。我所看到的只是添加 Nuget 包、文件、文件夹和 docker 支持。

请问我缺少的是没有使“添加 Web 引用”命令出现在我的 Web 项目的“添加”上下文菜单下。

我尝试下载 Visual Studio for Mac“专业”版,但点击网站上的下载链接,仍会下载“社区”版。

My context menu screenshot

【问题讨论】:

  • 这是您的项目上下文菜单的外观:csharpcorner-mindcrackerinc.netdna-ssl.com/article/… - 请张贴您的屏幕截图以进行比较。
  • @Dai,我添加了上下文菜单的屏幕截图。我可以在你的中看到 Add Web 引用,但在我的中看不到它。

标签: c# visual-studio-mac asp.net-core-mvc-2.0


【解决方案1】:

Visual Studio for Mac 目前不支持此功能。

添加 Web 引用时生成的代码正在使用 System.Web.Services,它无法使用 .NET Core 或 .NET Standard 项目进行编译,因此为这些类型删除了添加 Web 引用的能力项目。

Visual Studio for Mac 目前不支持服务引用。

有一个dotnet svcutil command line tool 可以用来生成服务引用。不确定您是否可以使用它,具体取决于您尝试使用的网络服务。

要在 Visual Studio for Mac 中支持服务引用,最好的办法是为其打开一个 feature request

【讨论】:

  • 感谢您的澄清,现在我明白了。
猜你喜欢
  • 2018-05-07
  • 2012-03-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-01-12
  • 2018-01-13
相关资源
最近更新 更多