【问题标题】:Azure DevOps - Enable .pdb file generation via VSBuild@1Azure DevOps - 通过 VSBuild@1 启用 .pdb 文件生成
【发布时间】:2020-09-16 05:48:34
【问题描述】:

我有一个在VSBuild@1 任务中使用的 pubxml,并且构建工作正常,除了我没有得到我的 .pdb 文件。如何确保 .pdb 文件也包含在我的版本中?

项目发布配置

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Staging2|AnyCPU'">
    <DebugSymbols>true</DebugSymbols>
    <OutputPath>bin\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <DebugType>full</DebugType>
    <PlatformTarget>AnyCPU</PlatformTarget>
    <LangVersion>default</LangVersion>
    <ErrorReport>prompt</ErrorReport>
    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
  </PropertyGroup>

Pubxml 文件

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>FileSystem</WebPublishMethod>
    <PublishProvider>FileSystem</PublishProvider>
    <LastUsedBuildConfiguration>Staging2</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish />
    <LaunchSiteAfterPublish>False</LaunchSiteAfterPublish>
    <ExcludeApp_Data>False</ExcludeApp_Data>
    <publishUrl>Publish</publishUrl>
    <DeleteExistingFiles>True</DeleteExistingFiles>
    <TargetFramework>net472</TargetFramework>
    <DebugSymbols>True</DebugSymbols>
    <DebugType>Full</DebugType>
  </PropertyGroup>
</Project>

YAML 构建任务

task: VSBuild@1
  inputs:
    solution: '**\MyApps\Main.csproj'
    msbuildArgs: '/t:build /p:DeployOnBuild=true /p:PublishProfile=publish.pubxml /p:OutputPath=$(build.artifactStagingDirectory)\MainPublish\'
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)' 

根据我查到的内容,如果您可以设置/Build=full 属性就可以了。那么我的问题是,如果是这样的话,我在哪里添加它?

【问题讨论】:

  • 您是否尝试将以下内容添加到msbuildArgs/p:DebugType=full
  • @YanSklyarenko 我在上面... :)
  • @YanSklyarenko 成功了 ;) 您能否将其作为答案发布,以便我接受它,您将获得声誉提升:D

标签: build azure-devops azure-pipelines pdb-files buildconfiguration


【解决方案1】:

与项目文件的 &lt;DebugType&gt;Full&lt;/DebugType&gt; 部分等效的 MSBuild 参数是:/p:DebugType=full

因此,如果您通过添加 /p:DebugType=full 来更改 VSBuild 任务的 msbuildArgs 部分,这应该可以解决问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-09
    • 1970-01-01
    • 1970-01-01
    • 2022-12-10
    • 1970-01-01
    相关资源
    最近更新 更多