无法观察“发布".Net Core 应用程序的 VS2017 中的菜单项 [英] Unable to observe "Publish" menu item in VS2017 for .Net Core app

查看:20
本文介绍了无法观察“发布".Net Core 应用程序的 VS2017 中的菜单项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在 VS2017 中观察到我的 .Net Core Web 应用程序的发布"功能.

我的目标是将我的 Web 服务发布到运行 IIS 的远程主机.

如何让发布"菜单项显示在上下文菜单中?

解决方案

要将 ASP.NET Core 应用程序部署到 IIS 实例,

您首先需要在服务器上下载并安装 ASPNETCoreModule IIS Handlerhttps://github.com/dotnet/core/blob/master/release-notes/download-archives/2.0.0-download.md#windows-server-hosting

这是允许您的 IIS 启动和管理您的 .NET Core 应用程序

完成后,您需要发布"您的应用程序.所以从 Web 应用程序目录,你运行

dotnet publish -o "C:Temp"

您还可以输入任何其他目录.只需将内容复制到服务器,它应该可以工作

注意:

对于带有 F# 的旧版本 .NET Core (1.x),您需要验证是否配置了 IISHandler 中间件,您将执行类似 app.UseIISIntegration()

在某些情况下,它也不会生成web.config 文件,您需要手动添加它们.下面是 web.config 文件

的示例

</处理程序><aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".logsstdout" forwardWindowsAuthToken="false"/></system.webServer></配置>

I'm unable to observe the "Publish" feature in VS2017 for my .Net Core web app.

My goal is to publish my web services to a remote host that runs IIS.

How do I get the Publish menu item to show up on the context menu?

解决方案

To deploy ASP.NET Core Applications to an IIS instance,

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

This is what allows your IIS launch and manage your .NET Core App

When that is done, you need to "publish" your application. So from the Web Application directory, you run

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

In some few cases, It also did not generate web.config files in those cases, you need to manually add them. Below is a sample of the web.config file

<?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=".logsstdout" forwardWindowsAuthToken="false"/>
  </system.webServer>
</configuration>

这篇关于无法观察“发布".Net Core 应用程序的 VS2017 中的菜单项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆