asp.net-core - Azure Pipeline Build Using Microsoft.AspNetCore.App 2.2
问题描述
We are trying to get our .net core 2.2 app to build in Azure. But it is failing on the NuGet restore saying Version conflict detected on Microsoft.AspNetCore.Authentication,
Reference the package directly from the project to resolve this issue.
We added to the web project and then it listed another and another. We can't keep adding all and looking at the build it is saying:
NU1607: Version conflict detected for Microsoft.AspNetCore.Cryptography.KeyDerivation. Reference the package directly from the project to resolve this issue.
MasterTemplate.Web (>= 1.0.0) -> MasterTemplate.Infrastructure.Identity (>= 1.0.0) -> Microsoft.AspNetCore.Identity.EntityFrameworkCore (>= 2.2.0) -> Microsoft.Extensions.Identity.Stores (>= 2.2.0) -> Microsoft.Extensions.Identity.Core (>= 2.2.0) -> Microsoft.AspNetCore.Cryptography.KeyDerivation (>= 2.2.0) MasterTemplate.Web (>= 1.0.0) -> Microsoft.AspNetCore.App (>= 2.1.0) -> Microsoft.AspNetCore.Cryptography.KeyDerivation (>= 2.1.0).)
I am not sure where Microsoft.AspNetCore.App (>= 2.1.0) is coming from as locally is says Microsoft.AspNetCore.App (2.2.0) in the NuGet list under dependencies. The NuGetCommand output in azure also says:
Restoring packages for .NETCoreApp,Version=v2.2...
Do I have to add something to our YML file to make this build correctly, I have tried adding specific versions like below without any luck.
- task: DotNetCoreInstaller@0 displayName: 'Use .NET Core SDK Tool Installer'
inputs:
version: 2.2.100
- script: dotnet build --configuration $(buildConfiguration)
displayName: 'dotnet build $(buildConfiguration)'
- task: UseDotNet@2 displayName: 'Use .NET Core sdk'
inputs:
packageType: sdk
version: 2.2.105
installationPath: $(Agent.ToolsDirectory)/dotnet
Any help is greatly appreciated. YAML file below:
trigger:
- master
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@0
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
解决方案
推荐阅读
- javascript - JavaScript中的getElementsByTagName方法---不起作用
- machine-learning - Gensim LDA 提供主题 ID 的输出,但概率加起来不等于 1
- react-leaflet - react-leaflet-control - TypeError: (0 , _reactLeaflet.withLeaflet) 不是函数
- reactjs - 获取 URL 缺少 OData 查询
- c# - 找出角度差异
- c++ - arduino 压力传感器跳过旋律 C++ 中的音符
- batch-file - 最后一行加粗 - 使用批处理文件
- javascript - Mongodb聚合查询返回未定义
- python - Python“请求”仅返回“响应 [403]”
- java - 格式错误的电子邮件地址 - InternetAddress