dotnet publish not using PublishProfile
See original GitHub issueAccording to the documentation I can run the following command from my project folder using the same publish profile as produced in Visual Studio 2017.
dotnet publish -p:PublishProfile=FolderProfile
This is my FolderProfile.pubxml
for a console application with target framework .NET Core 2.1
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<TargetFramework>netcoreapp2.1</TargetFramework>
<PublishDir>bin\Release\netcoreapp2.1\publish\</PublishDir>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<_IsPortable>false</_IsPortable>
</PropertyGroup>
</Project>
When executing dotnet publish -p:PublishProfile=FolderProfile
the FolderProfile.pubxml is ignored and I see this output
dotnet publish -p:PublishProfile=FolderProfile Microsoft ® Build Engine version 15.9.20+g88f5fadfbe for .NET Core Copyright © Microsoft Corporation. All rights reserved.
Restore completed in 39.74 ms for C:\Users\mheptinstall\source\repos\DataWarehouse\CSDS\CSDS.CreateCsdsXml\CSDS.CreateCsdsXml.csproj. CSDS.CreateCsdsXml -> C:\Users\mheptinstall\source\repos\DataWarehouse\CSDS\CSDS.CreateCsdsXml\bin\Debug\netcoreapp2.1\CreateCsdsXml.dll CSDS.CreateCsdsXml -> C:\Users\mheptinstall\source\repos\DataWarehouse\CSDS\CSDS.CreateCsdsXml\bin\Debug\netcoreapp2.1\publish\
dotnet --info
output:
.NET Core SDK (reflecting any global.json): Version: 2.2.110 Commit: 4797dabd3c
Runtime Environment: OS Name: Windows OS Version: 10.0.18363 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.2.110\
Host (useful for support): Version: 3.1.4 Commit: 0c2e69caa6
.NET Core SDKs installed: 2.1.514 [C:\Program Files\dotnet\sdk] 2.1.516 [C:\Program Files\dotnet\sdk] 2.2.110 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.18 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download
dotnet publish -p:PublishProfile=FolderProfile
output:
msbuild.zip
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
I also just ran into this issue (tested with .NET SDK 5.0.104 and 5.0.201). Neither
PublishProfile
orPublishProfileFullPath
is able to pick up aFolderProfile.pubxml
located inProperties\PublishProfiles
, and generated by VS 2019.@fuglede @mrlife This issue is closed, you should open up a new issue to get the proper eyes on it.