question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.NET 8: Make `Microsoft.NET.Test.Sdk` an implicit reference

See original GitHub issue

The Microsoft.NET.Test.Sdk PackageReference is a pain w/o obvious value. Presumably, everyone wants to have the matching PackageReference for their .NET SDK and/or VS version. That’s not the default experience due to the PackageReference.

As a symptom of that, this package is one that dependabot has to update most. Example: https://github.com/dotnet/iot/pull/1556.

It would be great if we could (somehow) make packages we update monthly as implicit PackageReferences.

There is no design here (and I haven’t thought about it). This is just a UX pain.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:10
  • Comments:23 (21 by maintainers)

github_iconTop GitHub Comments

6reactions
richlandercommented, Jun 2, 2022

Here’s the relevant part of a test project:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <Nullable>enable</Nullable>

    <IsPackable>false</IsPackable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />

Ideally, we could just switch the first line to do what you said:

<Project Sdk="Microsoft.NET.Test.Sdk">

Right?

3reactions
Nirmal4Gcommented, Oct 4, 2022

Out of all features proposed for .NET 8, this would be the most useful and underrated feature ever. It would merely take an hour or so to move, rework the .NET Test SDK into dotnet/sdk repo. This could’ve been done in .NET 5. I don’t understand why the team didn’t and dragged this on till v8!?

Read more comments on GitHub >

github_iconTop Results From Across the Web

NET project SDK overview
Referencing an SDK in one of these ways greatly simplifies project files for .NET. While evaluating the project, MSBuild adds implicit ...
Read more >
Implicit references fail transitively · Issue #3046 · dotnet/sdk
For 2.2, the ASP.NET Core PackageReference does not flow transitively. However, you should be able to add it to the test project (without...
Read more >
Implicit Using Statements In .NET 6 - NET Core Tutorials
Implicit Using Statements In .NET 6. by Wade. This post is part of a series on .NET 6 and C# 10 features. Use...
Read more >
Warning NETSDK1071 A PackageReference to 'Microsoft. ...
I ran into a similar situation creating a new xUnit Test Project (.NET Core). When I added a reference to an existing ASP.NET...
Read more >
The Problem with C# 10 Implicit Usings
Yesterday I livestreamed myself upgrading a project to .NET 6 and C# 10. Along the way I tried using a new C# 10...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found