Repository navigation
Open
Description
With latest SDK Microsoft has introduced an new SDK for MSTest so there's no explicit package references in in csproj
dotnet-outdated correctly identifies packages that needs to be updated
» testmstest
[net9.0]
Microsoft.NET.Test.Sdk 17.10.0 -> 17.11.1
Microsoft.Testing.Extensions.CodeCoverage 17.11.3 -> 17.12.4
Microsoft.Testing.Extensions.TrxReport 1.3.2 -> 1.4.0
MSTest.Analyzers 3.5.1 -> 3.6.0
MSTest.TestAdapter 3.5.1 -> 3.6.0
MSTest.TestFramework 3.5.1 -> 3.6.0But when executing dotnet outdated -u all updates fails
Upgrading package Microsoft.NET.Test.Sdk...
An error occurred while upgrading testmstest
Upgrading package Microsoft.Testing.Extensions.CodeCoverage...
An error occurred while upgrading testmstest
Upgrading package Microsoft.Testing.Extensions.TrxReport...
An error occurred while upgrading testmstest
Upgrading package MSTest.Analyzers...
An error occurred while upgrading testmstest
Upgrading package MSTest.TestAdapter...
An error occurred while upgrading testmstest
Upgrading package MSTest.TestFramework...
An error occurred while upgrading testmstestThe csproj now looks like this:
<Project Sdk="MSTest.Sdk/3.5.1">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<!--
Displays error on console in addition to the log file. Note that this feature comes with a performance impact.
For more information, visit https://learn.microsoft.com/dotnet/core/testing/unit-testing-platform-integration-dotnet-test#show-failure-per-test
-->
<TestingPlatformShowTestsFailure>true</TestingPlatformShowTestsFailure>
</PropertyGroup>
</Project>Updating SDK manually resolved most problems
- <Project Sdk="MSTest.Sdk/3.5.1">
+ <Project Sdk="MSTest.Sdk/3.6.0">Results in one package still out of date
» testmstest
[net9.0]
Microsoft.NET.Test.Sdk 17.11.0 -> 17.11.1update still fails
Upgrading package Microsoft.NET.Test.Sdk...
An error occurred while upgrading testmstest
Executing .NET Add manually results in this error which might be a lead.
dotnet add package Microsoft.NET.Test.Sdk --version 17.11.1
Build succeeded in 0,6s
info : X.509 certificate chain validation will use the default trust store selected by .NET for code signing.
info : X.509 certificate chain validation will use the default trust store selected by .NET for timestamping.
info : Adding PackageReference for package 'Microsoft.NET.Test.Sdk' into project 'C:\temp\testmstest\testmstest.csproj'.
info : Restoring packages for C:\temp\testmstest\testmstest.csproj...
info : CACHE https://api.nuget.org/v3/vulnerabilities/index.json
info : CACHE https://api.nuget.org/v3-vulnerabilities/2024.09.24.23.37.09/vulnerability.base.json
info : CACHE https://api.nuget.org/v3-vulnerabilities/2024.09.24.23.37.09/2024.09.25.17.37.11/vulnerability.update.json
info : Package 'Microsoft.NET.Test.Sdk' is compatible with all the specified frameworks in project 'C:\temp\testmstest\testmstest.csproj'.
error: Value cannot be null. (Parameter 'version')Switching to Central Package Management (CPM) makes the update silently fail regardless if the package version exists or not in Directory.Packages.props
dotnet outdated
» testmstest
[net9.0]
Microsoft.NET.Test.Sdk 17.11.0 -> 17.11.1
Version color legend:
<red> : Major version update or pre-release version. Possible breaking changes.
<yellow>: Minor version update. Backwards-compatible features added.
<green> : Patch version update. Backwards-compatible bug fixes.
You can upgrade packages to the latest version by passing the -u or -u:prompt option.
Elapsed: 00:00:02.3225000Reacted by Frulfump
Metadata
Metadata
Assignees
Labels
No labels
Activity
devlead commentedon Sep 26, 2024
Interestingly I noticed when CPM enabled it adds an empty ItemGroup to the csproj
<ItemGroup />If I do an
dotnet outdated -u -tIt'll add the transitive dependencies to csproj
and versions to
Directory.Packages.propsnot just not the version
Microsoft.NET.Test.Sdkit'll remain and still be detected and silently faildevlead commentedon Sep 26, 2024
Hmm it's
dotnet add package Microsoft.NET.Test.Sdk --version 17.11.1will silently fail too if CPM is enabled, I've raised issue NuGet/Home#13809 about that.MSTest .NET SDK change workaround
Treat package references injected by custom SDKs as auto-referenced
Treat package references injected by custom SDKs as auto-referenced (#…