-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Missing Microsoft.AspNetCore.Http.Abstractions NuGet package #6040
Comments
You should be able write a class library without using the .Web SDK. A class library targeting AspNetCore can likely be simplified to a project file that looks like this. <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
</Project>
Yes, these changes are intentional. We're still working on updating documentation on writing class libraries for aspnetcore, and teaching Visual Studio about Why? See these issues for more context on our choices: |
Ahh, I see. I tried to figure that out before creating an issue but I missed those discussions, apparently. Thank you for leading me to the issues discussing the matter. I am not trying to start a new discussion. Just want to give some feedback. I see that using the I am afraid that might not be desired since you may add many more such assemblies into the framework in the future. Is there a way we can reference only a list of given assemblies from the framework and get only those assemblies to be included in the publish output? E.g.: Another issue I can see when I check real quick is VS not being able to understand the inner references of reference projects. I will try to explain what I mean by giving an example. With v2.2: Project A references NuGet package With v3.0: Project A references framework reference I am aware that v3.0 is just preview 1 and you are probably considering its cons and pros. |
We have to make tradeoffs, and in this case, we think a little extra disk space is worth it for the benefits of treating the shared framework as a single, atomic unit. I won't try to convince you that it's less than ideal that you end up with unused stuff in a self-contained app. There have been many discussions about this and experiments like https://github.com/mono/linker and https://github.com/dotnet/corert. But none of those has made it to production yet for .NET Core. So for now, our answer for your concerns about disk space is framework-dependent deployment. You only pay the cost of the shared framework once per machine instead of once per app.
No. The framework is treated as an single unit of references.
The SDK and NuGet teams are working on support for flowing FrameworkReference across ProjectReference. See dotnet/sdk#2729 and dotnet/sdk#2420. |
Thank you for the insights!
That sucks but we will have to live with that apparently. I will go ahead and close this issue since I got all the questions answers. Thank you! |
I realize that the
Microsoft.AspNetCore.Http.Abstractions
package is now a part of theMicrosoft.NET.Sdk.Web
SDK when using v3 preview.I have a class library project which requires only the
Microsoft.AspNetCore.Builder.IApplicationBuilder
interface and is using SDKMicrosoft.NET.Sdk
because it doesn't need any of the other dependencies - there a tens of them.Since I really need the
Microsoft.AspNetCore.Builder.IApplicationBuilder
, do I really have to change the SDK to.Web
and live with the many additional unnecessary dependencies? Was this change intentional and if so, may I ask why?The text was updated successfully, but these errors were encountered: