【发布时间】:2021-05-07 16:11:28
【问题描述】:
我有一个带有 swaggerUI 的 .NET 3.1 Web api 项目。在发布此项目期间,我已设置它必须生成 XML 文档,以便 Swagger 可以显示我为每个端点插入的 cmets、返回的对象等...
然后我在 Azure DevOps 中创建了一个管道,以在主分支上触发更改时自动运行构建,但我收到以下错误:
Determining projects to restore...
Restored D:\a\1\s\XXX-DataBridges-API\XXX-DataBridges-API.csproj (in 48.44 sec).
C:\Program Files\dotnet\sdk\5.0.102\Microsoft.Common.CurrentVersion.targets(1129,5): warning MSB3191: Unable to create directory "E:\Progetti\XXX\Xyz-MyProjectName-PublicAPI\XXX-DataBridges-API\". Could not find a part of the path 'E:\Progetti\XXX\Xyz-MyProjectName-PublicAPI\XXX-DataBridges-API\'. [D:\a\1\s\XXX-DataBridges-API\XXX-DataBridges-API.csproj]
C:\Program Files\dotnet\sdk\5.0.102\Microsoft.Common.CurrentVersion.targets(1129,5): warning MSB4181: The "MakeDir" task returned false but did not log an error. [D:\a\1\s\XXX-DataBridges-API\XXX-DataBridges-API.csproj]
D:\a\1\s\XXX-DataBridges-API\Models\Context\ReportingContext.cs(58,10): warning CS1030: #warning: 'To protect potentially sensitive information in your connection string, you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings.' [D:\a\1\s\XXX-DataBridges-API\XXX-DataBridges-API.csproj]
CSC : error CS0016: Could not write to output file 'E:\Progetti\XXX\Xyz-MyProjectName-PublicAPI\XXX-DataBridges-API\XXX-DataBridges-API.xml' -- 'Could not find a part of the path 'E:\Progetti\XXX\Xyz-MyProjectName-PublicAPI\XXX-DataBridges-API\XXX-DataBridges-API.xml'.' [D:\a\1\s\XXX-DataBridges-API\XXX-DataBridges-API.csproj]
Build FAILED.
C:\Program Files\dotnet\sdk\5.0.102\Microsoft.Common.CurrentVersion.targets(1129,5): warning MSB3191: Unable to create directory "E:\Progetti\XXX\Xyz-MyProjectName-PublicAPI\XXX-DataBridges-API\". Could not find a part of the path 'E:\Progetti\XXX\Xyz-MyProjectName-PublicAPI\XXX-DataBridges-API\'. [D:\a\1\s\XXX-DataBridges-API\XXX-DataBridges-API.csproj]
C:\Program Files\dotnet\sdk\5.0.102\Microsoft.Common.CurrentVersion.targets(1129,5): warning MSB4181: The "MakeDir" task returned false but did not log an error. [D:\a\1\s\XXX-DataBridges-API\XXX-DataBridges-API.csproj]
D:\a\1\s\XXX-DataBridges-API\Models\Context\ReportingContext.cs(58,10): warning CS1030: #warning: 'To protect potentially sensitive information in your connection string, you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings.' [D:\a\1\s\XXX-DataBridges-API\XXX-DataBridges-API.csproj]
CSC : error CS0016: Could not write to output file 'E:\Progetti\XXX\Xyz-MyProjectName-PublicAPI\XXX-DataBridges-API\XXX-DataBridges-API.xml' -- 'Could not find a part of the path 'E:\Progetti\XXX\Xyz-MyProjectName-PublicAPI\XXX-DataBridges-API\XXX-DataBridges-API.xml'.' [D:\a\1\s\XXX-DataBridges-API\XXX-DataBridges-API.csproj]
3 Warning(s)
1 Error(s)
我还在错误消息中看到它谈论 .Net 5,"C:\Program Files\dotnet\sdk\5.0.102..." 但我已经指定了网络核心 3.1。 这是 YAML:
trigger:
- master
pool:
vmImage: 'windows-2019'
variables:
buildConfiguration: 'Release'
steps:
- script: dotnet build --configuration $(buildConfiguration)
displayName: 'dotnet build'
- task: DotNetCoreCLI@2
inputs:
command: 'publish'
publishWebProjects: true
zipAfterPublish: true
arguments: '--output $(build.artifactstagingdirectory)'
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)
artifactName: MyProject_Build
【问题讨论】:
标签: c# .net-core azure-devops yaml