[在运行wpf UI tests
时,以下任务'NuGet还原前一个解决方案以获取wix'在Azure Devops中由于以下错误而失败。有人可以建议如何解决错误吗?
Installed:
1 package(s) to packages.config projects
##[error]The nuget command failed with exit code(1) and error(Errors in c:\agent\_work\9\s\tests\MediaApp.Wpf.UiTests\MediaApp.Wpf.UiTests.csproj
Package Appium.WebDriver 3.0.0.2 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package Appium.WebDriver 3.0.0.2 supports: net45 (.NETFramework,Version=v4.5)
Package Selenium.WebDriver 3.0.1 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package Selenium.WebDriver 3.0.1 supports:
- net35 (.NETFramework,Version=v3.5)
- net40 (.NETFramework,Version=v4.0)
Package Selenium.Support 3.0.1 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package Selenium.Support 3.0.1 supports:
- net35 (.NETFramework,Version=v3.5)
- net40 (.NETFramework,Version=v4.0)
Package Castle.Core 3.3.3 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package Castle.Core 3.3.3 supports:
- net35 (.NETFramework,Version=v3.5)
- net40-client (.NETFramework,Version=v4.0,Profile=Client)
- net45 (.NETFramework,Version=v4.5)
- sl4 (Silverlight,Version=v4.0)
- sl5 (Silverlight,Version=v5.0)
Package Microsoft.Extensions.FileSystemGlobbing 3.0.0 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package Microsoft.Extensions.FileSystemGlobbing 3.0.0 supports: netstandard2.0 (.NETStandard,Version=v2.0)
Package Microsoft.Win32.SystemEvents 4.6.0-preview8.19405.3 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package Microsoft.Win32.SystemEvents 4.6.0-preview8.19405.3 supports:
- net461 (.NETFramework,Version=v4.6.1)
- net472 (.NETFramework,Version=v4.7.2)
- netstandard2.0 (.NETStandard,Version=v2.0)
One or more packages are incompatible with .NETCoreApp,Version=v3.0.
Errors in c:\agent\_work\9\s\src\MediaApp.Wpf\MediaApp.Wpf.csproj
Package AutoMapper 8.1.0 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package AutoMapper 8.1.0 supports:
- net461 (.NETFramework,Version=v4.6.1)
- netstandard2.0 (.NETStandard,Version=v2.0)
Package Serilog.Settings.Configuration 3.0.1 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package Serilog.Settings.Configuration 3.0.1 supports:
- net451 (.NETFramework,Version=v4.5.1)
- net461 (.NETFramework,Version=v4.6.1)
- netstandard2.0 (.NETStandard,Version=v2.0)
Package System.Windows.Interactivity.WPF 2.0.20525 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package System.Windows.Interactivity.WPF 2.0.20525 supports: net40 (.NETFramework,Version=v4.0)
Package Microsoft.Extensions.Configuration 2.2.0 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package Microsoft.Extensions.Configuration 2.2.0 supports: netstandard2.0 (.NETStandard,Version=v2.0)
Package Microsoft.Extensions.Configuration.Json 2.2.0 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package Microsoft.Extensions.Configuration.Json 2.2.0 supports: netstandard2.0 (.NETStandard,Version=v2.0)
Package System.Diagnostics.PerformanceCounter 4.5.0 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package System.Diagnostics.PerformanceCounter 4.5.0 supports:
- monoandroid10 (MonoAndroid,Version=v1.0)
- monotouch10 (MonoTouch,Version=v1.0)
- net461 (.NETFramework,Version=v4.6.1)
- netstandard2.0 (.NETStandard,Version=v2.0)
- xamarinios10 (Xamarin.iOS,Version=v1.0)
- xamarinmac20 (Xamarin.Mac,Version=v2.0)
- xamarintvos10 (Xamarin.TVOS,Version=v1.0)
- xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0)
Package System.Drawing.Common 4.5.1 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package System.Drawing.Common 4.5.1 supports:
- monoandroid10 (MonoAndroid,Version=v1.0)
- monotouch10 (MonoTouch,Version=v1.0)
- net461 (.NETFramework,Version=v4.6.1)
- netstandard2.0 (.NETStandard,Version=v2.0)
- xamarinios10 (Xamarin.iOS,Version=v1.0)
- xamarinmac20 (Xamarin.Mac,Version=v2.0)
- xamarintvos10 (Xamarin.TVOS,Version=v1.0)
- xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0)
Package System.Management 4.5.0 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package System.Management 4.5.0 supports:
- net45 (.NETFramework,Version=v4.5)
- netstandard2.0 (.NETStandard,Version=v2.0)
Package System.Configuration.ConfigurationManager 4.5.0 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package System.Configuration.ConfigurationManager 4.5.0 supports:
- net461 (.NETFramework,Version=v4.6.1)
- netstandard2.0 (.NETStandard,Version=v2.0)
Package Microsoft.Win32.SystemEvents 4.5.0 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package Microsoft.Win32.SystemEvents 4.5.0 supports:
- net461 (.NETFramework,Version=v4.6.1)
- netstandard2.0 (.NETStandard,Version=v2.0)
Package System.CodeDom 4.5.0 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package System.CodeDom 4.5.0 supports:
- net461 (.NETFramework,Version=v4.6.1)
- netstandard2.0 (.NETStandard,Version=v2.0)
One or more packages are incompatible with .NETCoreApp,Version=v3.0.
Errors in c:\agent\_work\9\s\tests\MediaApp.Wpf.Tests\MediaApp.Wpf.Tests.csproj
Package AutoMapper 8.1.0 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package AutoMapper 8.1.0 supports:
- net461 (.NETFramework,Version=v4.6.1)
- netstandard2.0 (.NETStandard,Version=v2.0)
Package xxx与netcoreapp3.0不兼容
如果解决方案中的所有项目都以.net core
为目标,请像这样使用Use .net core task+dotnet restore
:
如果您的解决方案包含针对.net core+.net framework
的项目,那么您可以像这样使用Use nuget+nuget restore
:
您应指定要使用的nuget.exe版本。 Nuget 5.3.1是在我的管道中运行良好的版本。另外,您可以选择启用Always download the latest matching version
框。参见类似的问题here。
当前的.NET SDK不支持定位.NET Core 3.0。目标.NET Core 2.1或更低版本,或使用.NET SDK的版本支持.NET Core 3.0。
这表明您应将代理与VS2019+corresponding .net core sdk
一起使用以运行还原。如果您使用的是Microsoft托管的代理,则在对构建管道进行排队时应使用window 2019
代理。如果您使用VS2017-Window2016
代理,将会遇到此问题。