-
I just created a new SDK test project using Visual Studio 2022 v17.12.1 and the new .NET 9 SDK for testing my WPF library. It seems that I'm not able to select
Manually changing the target framework to
FWIW: This is my test project file: <Project Sdk="MSTest.Sdk/3.6.1">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>latest</LangVersion>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<IsPublishable>False</IsPublishable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugType>none</DebugType>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\Converter.Html\Converter.Html\Converter.Html.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.12.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Microsoft.Testing.Extensions.CodeCoverage" Version="17.12.6" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Microsoft.Testing.Extensions.TrxReport" Version="1.4.3" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="MSTest.Analyzers" Version="3.6.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<PackageReference Update="MSTest.TestAdapter" Version="3.6.3" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="MSTest.TestFramework" Version="3.6.3" />
</ItemGroup>
</Project> |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hmm … I manually changed the target framework of my unit test project to An no matter how often I update the test NuGet packages now … As soon as I reload the project, I'm getting displayed the same vulnerability report again, and none of the NuGet packages seem to have been updated. Apparently the NuGet packages don't seem to get updated: Moreover, |
Beta Was this translation helpful? Give feedback.
Yes this is a problem with the SDK style project, you cannot update via the nuget manager. On the top of your project it says:
Change the version there to 3.6.3. And also delete the explicit references to packages.
Or if you don't wish to use the MSTest SDK style project, revert the top line to say
and add this to the property group:
This should allow you to keep your project as is, it looks like it already has all the other needed props and items.