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

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

问题描述

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

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

我的目标是将Web服务发布到远程

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

如何使发布菜单项显示在上下文菜单上?

推荐答案

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

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

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

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

这就是您的IIS启动和管理.NET Core应用程序的原因

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

完成此操作后,您需要发布您的应用程序。因此,在Web应用程序目录中,运行

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

注意:

对于带有F#的旧版本.NET Core(1.x),您需要验证是否已配置IISHandler中间件,您可以执行 app.UseIISIntegration()之类的操作。

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

在某些情况下,它也没有生成 web.config 文件,您需要手动添加它们。以下是 web.config 文件

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=".\logs\stdout" forwardWindowsAuthToken="false"/>
  </system.webServer>
</configuration>

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

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