相关疑难解决方法(0)

dotnet 发布配置文件忽略 pubxml 文件

我有以下通过 Visual Studio 2019 创建的 pubxml 文件:

<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>
Run Code Online (Sandbox Code Playgroud)

当我运行dotnet.exe publish src\MyProject.Web.sln -p:PublishProfile=Properties\PublishProfiles\ProductionPublish.pubxmlRelease 不包含任何内容并且发布发生在 Debug 文件夹(调试版本)上。为什么会发生这种情况并且忽略 pubxml?

更新 #1

Structure
src\MyProject\MyProject.csproj
src\MyProject.Utils\ect.Utils.csproj
src\MyProject.Web\MyProject.Web.csproj
src\MyProject.Web.sln
Run Code Online (Sandbox Code Playgroud)

和 pubxml 的路径

src\MyProject.Web\Properties\PublishProfiles\ProductionPublish.pubxml
Run Code Online (Sandbox Code Playgroud)

.net c# asp.net msbuild .net-core

3
推荐指数
2
解决办法
1585
查看次数

标签 统计

.net ×1

.net-core ×1

asp.net ×1

c# ×1

msbuild ×1