Skip to content

[Blazor] Creating a .nupkg of a blazorlib with dotnet pack includes the .razor files #9577

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

Closed
stavroskasidis opened this issue Apr 19, 2019 · 5 comments
Assignees
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. Done This issue has been fixed

Comments

@stavroskasidis
Copy link

Describe the bug

Running dotnet pack on a blazorlib project includes the .razor files in the .nupkg, making the package produce duplicates on reference and be unusable.

To Reproduce

Steps to reproduce the behavior:

  1. Using ASP.NET Core 3.0 preview 4
  2. dotnet new blazorlib -o Lib
  3. cd Lib
  4. dotnet pack
  5. Inspect the .nupkg in bin\Debug

Workaround

I added the following in my csproj to prevent the .razor files from being included in the nupkg

<ItemGroup>
    <Content Update="*.razor">
      <Pack>false</Pack>
    </Content>
</ItemGroup>

Screenshots

Contents of .nupkg
image

@Eilon Eilon added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Apr 19, 2019
@danroth27 danroth27 added the area-blazor Includes: Blazor, Razor Components label Apr 19, 2019
@danroth27 danroth27 added this to the 3.0.0-preview6 milestone Apr 22, 2019
@danroth27 danroth27 added the bug This issue describes a behavior which is not expected - a bug. label Apr 22, 2019
@danroth27
Copy link
Member

@javiercn We should make sure this issue is addressed when we do the work for #6349.

@javiercn
Copy link
Member

@danroth27 That's orthogonal to the static context, we should do this on the razor SDK, the same way we mark .cshtml files as pack=false.

@pranavkm thoughts?

@pranavkm
Copy link
Contributor

ghidello added a commit to sotsera/sotsera.blazor.toaster that referenced this issue Apr 25, 2019
@mkArtakMSFT mkArtakMSFT assigned pranavkm and javiercn and unassigned pranavkm May 1, 2019
@mkArtakMSFT mkArtakMSFT removed area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates labels May 9, 2019
@javiercn
Copy link
Member

@mkArtakMSFT mkArtakMSFT added the Done This issue has been fixed label May 22, 2019
@Mercurial
Copy link

Thanks for the work around!

@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. Done This issue has been fixed
Projects
None yet
Development

No branches or pull requests

7 participants