2

プロジェクトを zip にビルドして、ドロップ フォルダーに移動しようとしています。パイプラインが「アーティファクトの公開」ステップに到達するまで、ビルドは成功し、すべてのステップは問題ありません。ここに画像の説明を入力

私の .yml ファイルは次のとおりです。

 vmImage: 'windows-latest'

variables: 
 loggingsolution: 'LoggingService.sln'

steps:
- task: NuGetToolInstaller@1
 displayName: 'Install Newer Version on NuGet'
 inputs:
   checkLatest: true

- task: NuGetCommand@2
 displayName: 'Restore NuGet Packages for Solution'
 inputs:
   command: 'restore'
   restoreSolution: '$(loggingsolution)'
   feedsToUse: config
   nugetConfigPath: ./Nuget.config
   
- task: VSBuild@1
 displayName: 'Create Artifact For Solution'
 inputs:
   command: 'publish'    
   solution: '$(loggingsolution)'
   msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(Build.ArtifactStagingDirectory)" /p:TransformWebConfigEnabled=false /p:AutoParameterizationWebConfigConnectionStrings=false /p:MarkWebConfigAssistFilesAsExclude=false /p:ProfileTransformWebConfigEnabled=false /p:IsTransformWebConfigDisabled=true'    
   zipAfterPublish: true

- task: PublishBuildArtifacts@1
 displayName: 'Publish Artifacts'
 inputs:
   PathtoPublish: '$(Build.ArtifactStagingDirectory)'
   ArtifactName: 'drop'
   publishLocation: 'Container'

これを修正するためにいくつかのことを試みましたが、何もうまくいきませんでした。/p:PackageDirectory を /p: OutDir に変更すると、ドロップ フォルダーにファイルが表示されましたが、パッケージ化されず、/p:PackageAsSingleFile が無視されたように見えました。また、VSBuild タスクで zipAfterPublish フラグを true に追加しようとしましたが、何もしませんでした。ビルドタスクまたはこの問題を引き起こしている可能性のある他の領域で試すことができるビルド引数について、誰か提案がありますか? 私の組織では、ほぼ同一の .yml ファイルを使用して完全に正常に動作する既存の類似パイプラインがいくつかあるため、.sln 構成または何かが原因であると考えられます。

sln ファイル:


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2047
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Logging", "Logging\Logging.csproj", "{D22352E8-7383-4C1F-927D-392192189B6E}"
EndProject
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "WcfService", "WcfService\", "{E0388E1A-6936-4372-BFAE-E83352E1E1B6}"
    ProjectSection(WebsiteProperties) = preProject
        SccProjectName = "SAK"
        SccAuxPath = "SAK"
        SccLocalPath = "SAK"
        SccProvider = "SAK"
        TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.7.2"
        ProjectReferences = "{D22352E8-7383-4C1F-927D-392192189B6E}|Logging.dll;"
        Debug.AspNetCompiler.VirtualPath = "/WCFService"
        Debug.AspNetCompiler.PhysicalPath = "WcfService\"
        Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\WCFService\"
        Debug.AspNetCompiler.Updateable = "true"
        Debug.AspNetCompiler.ForceOverwrite = "true"
        Debug.AspNetCompiler.FixedNames = "false"
        Debug.AspNetCompiler.Debug = "True"
        Release.AspNetCompiler.VirtualPath = "/WCFService"
        Release.AspNetCompiler.PhysicalPath = "WcfService\"
        Release.AspNetCompiler.TargetPath = "PrecompiledWeb\WCFService\"
        Release.AspNetCompiler.Updateable = "true"
        Release.AspNetCompiler.ForceOverwrite = "true"
        Release.AspNetCompiler.FixedNames = "false"
        Release.AspNetCompiler.Debug = "False"
        VWDPort = "1810"
        SlnRelativePath = "WcfService\"
        DefaultWebSiteLanguage = "Visual C#"
    EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LoggingWindowsService.Data", "LoggingWindowsService.Data\LoggingWindowsService.Data.csproj", "{DACAB369-3A0B-4682-A7B1-C85E5378ACAC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FrameworkLoggingService", "FrameworkLoggingService\FrameworkLoggingService.csproj", "{D5EA8A2C-837E-4E1F-9921-781A77EFE191}"
EndProject
Global
    GlobalSection(SolutionConfigurationPlatforms) = preSolution
        Debug|.NET = Debug|.NET
        Debug|Any CPU = Debug|Any CPU
        Debug|Mixed Platforms = Debug|Mixed Platforms
        Release|.NET = Release|.NET
        Release|Any CPU = Release|Any CPU
        Release|Mixed Platforms = Release|Mixed Platforms
    EndGlobalSection
    GlobalSection(ProjectConfigurationPlatforms) = postSolution
        {D22352E8-7383-4C1F-927D-392192189B6E}.Debug|.NET.ActiveCfg = Debug|Any CPU
        {D22352E8-7383-4C1F-927D-392192189B6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {D22352E8-7383-4C1F-927D-392192189B6E}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {D22352E8-7383-4C1F-927D-392192189B6E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
        {D22352E8-7383-4C1F-927D-392192189B6E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
        {D22352E8-7383-4C1F-927D-392192189B6E}.Release|.NET.ActiveCfg = Release|Any CPU
        {D22352E8-7383-4C1F-927D-392192189B6E}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {D22352E8-7383-4C1F-927D-392192189B6E}.Release|Any CPU.Build.0 = Release|Any CPU
        {D22352E8-7383-4C1F-927D-392192189B6E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
        {D22352E8-7383-4C1F-927D-392192189B6E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
        {E0388E1A-6936-4372-BFAE-E83352E1E1B6}.Debug|.NET.ActiveCfg = Debug|Any CPU
        {E0388E1A-6936-4372-BFAE-E83352E1E1B6}.Debug|.NET.Build.0 = Debug|Any CPU
        {E0388E1A-6936-4372-BFAE-E83352E1E1B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {E0388E1A-6936-4372-BFAE-E83352E1E1B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {E0388E1A-6936-4372-BFAE-E83352E1E1B6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
        {E0388E1A-6936-4372-BFAE-E83352E1E1B6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
        {E0388E1A-6936-4372-BFAE-E83352E1E1B6}.Release|.NET.ActiveCfg = Debug|Any CPU
        {E0388E1A-6936-4372-BFAE-E83352E1E1B6}.Release|.NET.Build.0 = Debug|Any CPU
        {E0388E1A-6936-4372-BFAE-E83352E1E1B6}.Release|Any CPU.ActiveCfg = Debug|Any CPU
        {E0388E1A-6936-4372-BFAE-E83352E1E1B6}.Release|Any CPU.Build.0 = Debug|Any CPU
        {E0388E1A-6936-4372-BFAE-E83352E1E1B6}.Release|Mixed Platforms.ActiveCfg = Debug|Any CPU
        {E0388E1A-6936-4372-BFAE-E83352E1E1B6}.Release|Mixed Platforms.Build.0 = Debug|Any CPU
        {DACAB369-3A0B-4682-A7B1-C85E5378ACAC}.Debug|.NET.ActiveCfg = Debug|Any CPU
        {DACAB369-3A0B-4682-A7B1-C85E5378ACAC}.Debug|.NET.Build.0 = Debug|Any CPU
        {DACAB369-3A0B-4682-A7B1-C85E5378ACAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {DACAB369-3A0B-4682-A7B1-C85E5378ACAC}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {DACAB369-3A0B-4682-A7B1-C85E5378ACAC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
        {DACAB369-3A0B-4682-A7B1-C85E5378ACAC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
        {DACAB369-3A0B-4682-A7B1-C85E5378ACAC}.Release|.NET.ActiveCfg = Release|Any CPU
        {DACAB369-3A0B-4682-A7B1-C85E5378ACAC}.Release|.NET.Build.0 = Release|Any CPU
        {DACAB369-3A0B-4682-A7B1-C85E5378ACAC}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {DACAB369-3A0B-4682-A7B1-C85E5378ACAC}.Release|Any CPU.Build.0 = Release|Any CPU
        {DACAB369-3A0B-4682-A7B1-C85E5378ACAC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
        {DACAB369-3A0B-4682-A7B1-C85E5378ACAC}.Release|Mixed Platforms.Build.0 = Release|Any CPU
        {D5EA8A2C-837E-4E1F-9921-781A77EFE191}.Debug|.NET.ActiveCfg = Debug|Any CPU
        {D5EA8A2C-837E-4E1F-9921-781A77EFE191}.Debug|.NET.Build.0 = Debug|Any CPU
        {D5EA8A2C-837E-4E1F-9921-781A77EFE191}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {D5EA8A2C-837E-4E1F-9921-781A77EFE191}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {D5EA8A2C-837E-4E1F-9921-781A77EFE191}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
        {D5EA8A2C-837E-4E1F-9921-781A77EFE191}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
        {D5EA8A2C-837E-4E1F-9921-781A77EFE191}.Release|.NET.ActiveCfg = Release|Any CPU
        {D5EA8A2C-837E-4E1F-9921-781A77EFE191}.Release|.NET.Build.0 = Release|Any CPU
        {D5EA8A2C-837E-4E1F-9921-781A77EFE191}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {D5EA8A2C-837E-4E1F-9921-781A77EFE191}.Release|Any CPU.Build.0 = Release|Any CPU
        {D5EA8A2C-837E-4E1F-9921-781A77EFE191}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
        {D5EA8A2C-837E-4E1F-9921-781A77EFE191}.Release|Mixed Platforms.Build.0 = Release|Any CPU
    EndGlobalSection
    GlobalSection(SolutionProperties) = preSolution
        HideSolutionNode = FALSE
    EndGlobalSection
    GlobalSection(ExtensibilityGlobals) = postSolution
        SolutionGuid = {53B5C897-49F6-401C-B6EC-B0DE0307B494}
    EndGlobalSection
EndGlobal

CopyFiles タスクについては認識していますが、使用しないように求められています。

アーティファクト作成ログの一部 (長すぎて完全にコピーできません):


Project "D:\a\1\s\LoggingService.sln" (1) is building "D:\a\1\s\WcfService.metaproj" (5) on node 1 (default targets).
Build:
  Creating directory "WcfService\Bin".
  Creating directory "WcfService\Bin".
  Creating directory "WcfService\Bin".
  Copying files from "D:\a\1\s\Logging\bin\" to "D:\a\1\s\WcfService\Bin\Logging.dll".
  C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v /WCFService -p WcfService\ -u -f -d PrecompiledWeb\WCFService\ 
Done Building Project "D:\a\1\s\WcfService.metaproj" (default targets).
Done Building Project "D:\a\1\s\LoggingService.sln" (default targets).

Build succeeded.

"D:\a\1\s\LoggingService.sln" (default target) (1) ->
"D:\a\1\s\Logging\Logging.csproj" (default target) (2) ->
(CoreCompile target) -> 
  D:\a\1\s\Logging\Log.cs(38,26): warning CS0618: 'ConfigurationSettings.AppSettings' is obsolete: 'This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings' [D:\a\1\s\Logging\Logging.csproj]
  D:\a\1\s\Logging\Log.cs(39,83): warning CS0618: 'ConfigurationSettings.AppSettings' is obsolete: 'This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings' [D:\a\1\s\Logging\Logging.csproj]
  D:\a\1\s\Logging\EnterpriseWebServiceAppender.cs(22,24): warning CS0169: The field 'EnterpriseWebServiceAppender._ServiceUrl' is never used [D:\a\1\s\Logging\Logging.csproj]
  D:\a\1\s\Logging\Log.cs(27,31): warning CS0169: The field 'Log._currentAppender' is never used [D:\a\1\s\Logging\Logging.csproj]

4

1 に答える 1

0

yaml の VSBuild タスク定義に問題があります。VS ビルド タスクにはcommand:'publish'やなどの引数はありません。zipAfterPublish: true

- task: VSBuild@1
 displayName: 'Create Artifact For Solution'
 inputs:    
   solution: '$(loggingsolution)'
   msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(Build.ArtifactStagingDirectory)" /p:TransformWebConfigEnabled=false /p:AutoParameterizationWebConfigConnectionStrings=false /p:MarkWebConfigAssistFilesAsExclude=false /p:ProfileTransformWebConfigEnabled=false /p:IsTransformWebConfigDisabled=true'    
  

詳細については、タスク ドキュメントを参照してください。

ここに画像の説明を入力

于 2020-12-18T09:37:57.767 に答える