dotnet publish profile ignores pubxml file

I have the following pubxml file which I created via Visual Studio 2019:

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/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>     <TargetFramework>netcoreapp3.1</TargetFramework>     <RuntimeIdentifier>win-x64</RuntimeIdentifier>     <ProjectGuid>143a6329-27d9-474e-9521-835be634c293</ProjectGuid>     <SelfContained>true</SelfContained>     <publishUrl>bin\Release\netcoreapp3.1\publish\</publishUrl>     <DeleteExistingFiles>True</DeleteExistingFiles>   </PropertyGroup> </Project> 

When I run dotnet.exe publish src\MyProject.Web.sln -p:PublishProfile=Properties\PublishProfiles\ProductionPublish.pubxml Release does not contain anything and publish happens on Debug folder (debug build). Whys does this happens and pubxml is ignored?

Update #1

Structure src\MyProject\MyProject.csproj src\MyProject.Utils\ect.Utils.csproj src\MyProject.Web\MyProject.Web.csproj src\MyProject.Web.sln 

and the path of the pubxml

src\MyProject.Web\Properties\PublishProfiles\ProductionPublish.pubxml 
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.