Visual Studio 2017 ASP.Net发布自包含的点网核心应用程序

编程入门 行业动态 更新时间:2024-10-27 17:11:36
本文介绍了Visual Studio 2017 ASP.Net发布自包含的点网核心应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在Visual Studio 2017中有一个.Net Core ASP.Net应用程序.我正在尝试对该应用程序进行自包含部署.

I have a .Net Core ASP.Net application in Visual Studio 2017. I am trying to do a self contained deployment of the application.

如果我从CLI运行以下命令,它将按照我想要的方式正常工作并生成一个.exe

If I run the following command from the CLI it works exactly how I want and produces a .exe

dotnet publish -c release -r win7-x64

但是,如果我从Visual Studio 2017发布,它不会生成.exe,而是生成.dll.

However if I publish from Visual Studio 2017 it does not produce a .exe and produces a .dll instead.

如何从Visual Studio 2017中复制dotnet publish命令的-r win7-x64?

How can I replicate the -r win7-x64 of the dotnet publish command from within Visual Studio 2017?

这是我的.pubxml的内容

Here is the contents of my .pubxml

<?xml version="1.0" encoding="utf-8"?> <!-- This file is used by the publish/package process of your Web project. You can customize the behavior of this process by editing this MSBuild file. In order to learn more about this please visit go.microsoft/fwlink/?LinkID=208121. --> <Project ToolsVersion="4.0" xmlns="schemas.microsoft/developer/msbuild/2003"> <PropertyGroup> <WebPublishMethod>FileSystem</WebPublishMethod> <PublishProvider>FileSystem</PublishProvider> <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> <LastUsedPlatform>Any CPU</LastUsedPlatform> <SiteUrlToLaunchAfterPublish /> <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish> <ExcludeApp_Data>False</ExcludeApp_Data> <PublishFramework>netcoreapp1.1</PublishFramework> <ProjectGuid>74bc47dd-6787-420d-804f-3f3d689d5ae5</ProjectGuid> <publishUrl>C:\Deploy\JLM.MS.LeadGen.Dealer</publishUrl> <DeleteExistingFiles>True</DeleteExistingFiles> <RuntimeIdentifiers>win7-x64</RuntimeIdentifiers> </PropertyGroup> </Project>

推荐答案

此体验已添加到Visual Studio 2017 15.3版的发布窗口中(可通过此处)

This experience has been added to the publish window for Visual Studio 2017 version 15.3 (which can be downloaded here)

如果右键单击项目->发布->单击摘要"下的设置..."链接->转到发布窗口的设置"选项卡,您应该会在其中看到目标运行时"下拉列表选择您要在其上运行应用程序的平台. 这是我正在谈论的内容的屏幕截图.

If you right click on your project -> Publish -> click the "Settings..." link under "Summary" -> go to the Settings tab of the Publish window, you should see a Target Runtime dropdown where you can choose which platform you want your app to run on. Here's a screenshot of what I'm talking about.

确保在项目文件中包含要在<RuntimeIdentifiers>或<RuntimeIdentifier>中选择的运行时,因为下拉列表会查找这些属性以填充其值.

Make sure in your project file to include the runtime you want to select in <RuntimeIdentifiers> or <RuntimeIdentifier>, as the dropdown looks for these properties in order to populate its values.

更多推荐

Visual Studio 2017 ASP.Net发布自包含的点网核心应用程序

本文发布于:2023-11-14 03:16:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1586064.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   核心   Studio   Visual   Net

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!