简体   繁体   English

无法在VS2017中观察.Net Core应用程序的“发布”菜单项

[英]Unable to observe “Publish” menu item in VS2017 for .Net Core app

I'm unable to observe the "Publish" feature in VS2017 for my .Net Core web app. 我无法在VS2017中观察我的.Net Core网络应用程序的“发布”功能。

My goal is to publish my web services to a remote host that runs IIS. 我的目标是将我的Web服务发布到运行IIS的远程主机。

How do I get the Publish menu item to show up on the context menu? 如何在上下文菜单中显示“发布”菜单项?

在此输入图像描述

在此输入图像描述

Latest version of Visual Studio 2017 - 15.4.5 only supports publishing F# on Azure . 最新版本的Visual Studio 2017 - 15.4.5仅支持在Azure上发布F# You can try Visual Studio 2017 15.5 Preview 4 that should support what you are asking or wait for full release. 您可以尝试Visual Studio 2017 15.5 Preview 4,它应该支持您要求的内容或等待完整版本。 You can read more about it here 你可以在这里阅读更多相关信息

To deploy ASP.NET Core Applications to an IIS instance, 要将ASP.NET核心应用程序部署到IIS实例,

you first need to download and install ASPNETCoreModule IIS Handler on the Server https://github.com/dotnet/core/blob/master/release-notes/download-archives/2.0.0-download.md#windows-server-hosting 首先需要在服务器上下载并安装ASPNETCoreModule IIS Handler https://github.com/dotnet/core/blob/master/release-notes/download-archives/2.0.0-download.md#windows-server-hosting

This is what allows your IIS launch and manage your .NET Core App 这是允许IIS启动和管理.NET Core App的原因

When that is done, you need to "publish" your application. 完成后,您需要“发布”您的应用程序。 So from the Web Application directory, you run 因此,从Web应用程序目录中运行

dotnet publish -o "C:\\Temp"

you can also enter any other Directory. 您也可以输入任何其他目录。 Just copy the contents to the server and it should work 只需将内容复制到服务器即可

NOTE: 注意:

For older versions of .NET Core (1.x) with F#, you need to verify that you have the IISHandler middleware configured you'd do something like app.UseIISIntegration() 对于带有F#的旧版.NET Core(1.x),您需要验证是否已配置IISHandler中间件,您可以执行类似app.UseIISIntegration()

In some few cases, It also did not generate web.config files in those cases, you need to manually add them. 在少数情况下,在这种情况下它也没有生成web.config文件,您需要手动添加它们。 Below is a sample of the web.config file 下面是web.config文件的示例

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
    </handlers>
    <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
  </system.webServer>
</configuration>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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