dotnet / Scaffolding

Code generators to speed up development.
MIT License
632 stars 226 forks source link

Microsoft.VisualStudio.Web.CodeGeneration.Design package should not be deployed #2504

Open doggy8088 opened 1 year ago

doggy8088 commented 1 year ago

When I scaffold an API Controller with actions, using Entity Framework:

image

I will get two packages installed which is equivalent with the following commands:

dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design
dotnet add package Microsoft.EntityFrameworkCore.Tools

In the csproj file, you will see this:

<ItemGroup>
  <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.10">
    <PrivateAssets>all</PrivateAssets>
    <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
  </PackageReference>
  <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.9" />
</ItemGroup>

I think Microsoft.VisualStudio.Web.CodeGeneration.Design package should only be used by design-time and shouldn't be published with the app. Is it possible install Microsoft.VisualStudio.Web.CodeGeneration.Design NuGet package with a <PrivateAssets>all</PrivateAssets> definition by default?

deepchoudhery commented 1 year ago

Hey, We are working on a version that will not be deployed, a preview version will be ready in the 8.0 timeframe.

Will update you as soon as I have something official.