Skip to content

Asp.Net Core - Consider Changing Dependency from Microsoft.AspNetCore.Mvc to Microsoft.AspNetCore.Mvc.Core #66

Closed
@AdamDotNet

Description

@AdamDotNet

I was updating my Asp.Net Core app from 1.0.1 to 1.1.0, and while I was at it, I was able to add API versioning. At first I was taking a dependency on the NuGet package Microsoft.AspNetCore.Mvc, but decided to move to Microsoft.AspNetCore.Mvc.Core because I only use the "Web API" part of the Mvc package.

To my dismay, when I published my work, I still found Razor, TagHelpers and more in my publish output. I tracked it down to Microsoft.AspNetCore.Mvc.Versioning taking a dependency on Microsoft.AspNetCore.Mvc (>= 1.0.0). The result is having 1.1.0 files mixed with a bunch of 1.0.0 files (not good)!

Microsoft.AspNetCore.Mvc has a dependency on Microsoft.AspNetCore.Mvc.Core, so I assume it is safe for versioning to also take a dependency on Microsoft.AspNetCore.Mvc.Core and no one will break whether they reference the full meta package for Mvc or just the Core meta package. By depending on the Core meta package, "Web Api only" projects can get versioning and stay lean at publish time. I guess it depends on if your package truly needs bits out of the full Mvc meta package.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions