-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nuget Package Updates Not Working #4188
Comments
@chocvanstraw Thanks for reporting this. Are you using MSTest.Sdk? If you're using MSTest.Sdk, please have a look at the limitations documented in https://github.com/dotnet/docs/blob/087483735e3284d6e4f7d078b7fe66ae57218b8c/docs/core/testing/unit-testing-mstest-sdk.md#known-limitations (the known limitations section will isn't yet published to https://learn.microsoft.com/dotnet/core/testing/unit-testing-mstest-sdk, but hopefully it will be soon). NuGet issue: NuGet/Home#13127 |
Sorry for the delayed response. The Packages I am referencing in the test project are as follows: Microsoft.NET.Test.SDK I also noticed that after updating the nugets to the latest version and building the solution the versions in the IDE solution explorer show the old version (as mentioned in my original post). However, if I look at the csproj file for the test project they show the new versions: I also noticed that when creating a new test project there are several options that now have to be selected, which is a new experience for these types of projects. It isn't really clear what the implication of selecting each option is. Here is an example: Is the Use MSTest.Sdk checkbox causing the problem? |
I created a new project with the following settings (specifically unchecking the Use MSTest.SDK option): This included different nuget packages in the project: These seem to play nicely with the nuget package manager. When I manage nugets, I was able to update the listed packages to the latest version and they didn't change after re-building the solution and the versioning is consistent in solution explorer and the csproj file. It might be worthwhile to have some explanation of what all these various settings accomplish. |
@chocvanstraw Is the line containing |
In the original project I see the following: In the new project, where I unchecked Use MSTest.SDK I see the following: |
@chocvanstraw So, the update functionality works correctly with |
It appears so. So, which is the preferred library? Microsoft.NET.Sdk or MSTest.Sdk? It seems that Microsoft.NET.Sdk is installed regardless. And what is the guidance for new projects when it comes to selecting the Use MSTest.SDK checkbox? |
It depends mainly on your feeling. We tend to recommend MSTest.Sdk as it reduces a lot of boilerplate in project configurations but we are aware that the limited integration for updates can be considered as blocker.
If the
Cf question 1. We do think that provides a better experience but that's up-to-you. In case you have missed them, here is our blog post announcing the SDK feature https://devblogs.microsoft.com/dotnet/introducing-mstest-sdk/ and here is the official doc that explains the custom Sdk and its features https://learn.microsoft.com/dotnet/core/testing/unit-testing-mstest-sdk. |
I just created an MSTest project targeting .net 9. When I go to the Nuget package manager it says I have 4 updates for the following packages:
Microsoft.NET.Test.Sdk 17.11.1 -> 17.12.0
MSTest.Analyzers 3.6.1 -> 3.6.3
MSTest.TestAdapter 3.6.1 -> 3.6.3
MSTest.TestFramework 3.6.1 -> 3.6.3
If I update all of the packages they seem to update fine (the versions change in the project that was updated). However, if I rebuild the solution, the 4 packages listed above all revert back to the previous version. If I go to the nuget package manager, it shows 4 updates again.
Before update:
After update:
After building the solution:
The text was updated successfully, but these errors were encountered: