-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Does not cover Microsoft.AspNet.Core.All #8691
Does not cover Microsoft.AspNet.Core.All #8691
Comments
I'm getting the same for |
@Rick-Anderson Is this something you know about? |
Use the versionless
This document doesn't mention
Correct, you should be using
|
@Rick-Anderson Is there a way to not specify a version when using nuget? Nuget forces a version, right? I just upgraded to 2.2 and replaced
|
It wasn't immediately obvious to me what needed to happen after reading that article, so for the next person coming here with this warning... what I did was:
Then the warning went away. Not sure if there's an easier way. |
@Rick-Anderson should I just update the link target then? I have permissions to do that. |
@mairaw yes @aeslinger0 |
Not sure what you need, the doc is very clear RecommendationsSince
Maybe change that to:
|
I just had a quick call with @Rick-Anderson to discuss this. I think there are two issues here:
As a stop gap, we can add some notes about the two packages in that section. And then link to a better place in the ASP.NET docs when that's available. Thoughts? |
@livarcocc any suggestions on where this message is coming from so I can request the error message to be changed in this ASP.NET scenario? |
@dsplaisted This comes from the sdk itself. |
Specifically, the error message is defined here: https://github.com/dotnet/sdk/blob/master/src/Tasks/Common/Resources/Strings.resx |
Opened a new SDK issue then: dotnet/sdk#2879 Moving the stop-gap solution for the current sprint. |
@Bartolomeus-649 Did you confirm that your VS has the ASP.NET and web development workload installed. To confirm, run the VS installer, select Modify, and check the workloads that are checked off. If you have that, could you put up a repro project on GH that I can pull down here and take a look at? ... something that you're getting errors with. I'll take a look and let you know if it repros here. |
Just create a new .NET Core Console project in Visual Studio by using the built-in/included template for -NET Core Console Applications, and then add the NuGet package |
... ok ... I'll give that a shot. I assume it breaks, too, if you don't supply the version ... <PackageReference Include="Microsoft.AspNetCore.App" /> Need a few minutes ... I have a PR about to go out. I'll get back to u shortly. |
@Bartolomeus-649 Seems ok here ... <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
</Project>
|
Mine look like this:
and ther build output:
|
What's the problem again? ... not sure what you're asking. In the discussion at dotnet/AspNetCore.Docs#6430, they say that the implicit versioning only works with the |
I get the warning in Visual Studio with the current release of VS and .NET Core. My question is very simple: I just want to know "the recommended way" of doing this so everything work as it should. |
@Bartolomeus-649 The recommended way is to edit the .csproj file, and remove the Version attribute from the PackageReference: <PackageReference Include="Microsoft.AspNetCore.App" /> |
@dsplaisted What about the current guidance to use the @Bartolomeus-649 You might like this one ... I just added it to my reading list. https://natemcmaster.com/blog/2018/08/29/netcore-primitives-2/ |
@guardrex In the 2.2 SDKs the implicit versioning for the ASP.NET packages was moved down into the vanilla In 3.0 it all changes again, instead of a <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
</Project> |
Is it a supported action to manually modify the config made by Visual Studio, it won't be overwritten or make the NuGet tool act up now or in the future? In "Additions to the csproj format for .NET Core" it say that version is required, how does that relate to this?
What about interference and working together with other NuGet packages that might be referring to a specific version? Wise from 20+ years of experience, It feels a bit risky changing the project file by hand, and especially removing a property that is there for every package referenced >99.9% of the time....very likely someone somewhere assumes the version to be there and stuff breaks down and you end up spending days trying to figure out why stuff all of a sudden stop working... |
@dsplaisted Why not just include and reference "everything", and the just remove what's not used when building. |
The length of the discussion in this thread and the extent of the confusion makes it pretty clear that the documentation needs to be updated to cover this scenario. Not everyone is going to be updating to VS2019 or .NET Core 3, and those that are need guidance on what to do. The original issue was that the documentation does not cover the specific metapackage in question, leaving users in a lurch as to how to resolve the issue. To me, the solution is simple: Either update the tooling in VS2017 / .NET Core 2.X to ignore the version information in the metapackage and just do the right thing internally (seems like a no-brainer, honestly) or update the docs so that, when the user hits Ctrl+F to look for "Microsoft.AspNetCore.App" they get an actual result with clear instructions. |
@natemcmaster created a PR to add that info to our docs: #11736 With that, I'm considering this docs issue resolved. Once we get the experience and behavior fixed in the product, we can then make additional changes. /cc @KathleenDollard |
@Bartolomeus-649 I ran into a similar situation creating a new xUnit Test Project (.NET Core). When I added a reference to an existing ASP.NET Core Web App project, I got:
I eliminated these version conflicts by adding the At this point, I started getting the explicit version reference warning (NETSDK1071). @perezdev NuGet Package Manager and Package Manager Console within Visual Studio will both add the version attribute to Microsoft.AspNetCore.App when installing the package. You may remove the version attribute by editing your .csproj file. This should eliminate the NETSDK1071 warning.
At this point, am not getting any warnings. @mairaw There is a lot of chatter and some tldr; documentation related to this issue. FWIW, here are a couple of succinct resources that I think warrant highlighting: Microsoft.AspNetCore.App metapackage for ASP.NET Core 2.1 or later @nguerrera summarized the the situation very well:
|
I'm getting the following error in my VS2017 projects: NETSDK1071: A PackageReference to 'Microsoft.AspNetCore.All' specified a Version of
2.2.0-preview3-35497
. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs. However, this document does not cover how Microsoft.AspNetCore.All should actually be referenced in this situation.Also, the "Implicit References" section does not contain any code samples.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: