Skip to content
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

dotnet pack doesn't work for static files and project reference #14467

Closed
stsrki opened this issue Sep 26, 2019 · 3 comments
Closed

dotnet pack doesn't work for static files and project reference #14467

stsrki opened this issue Sep 26, 2019 · 3 comments
Assignees
Labels
area-blazor Includes: Blazor, Razor Components question
Milestone

Comments

@stsrki
Copy link
Contributor

stsrki commented Sep 26, 2019

Original issue: Megabit/Blazorise#282

I have this project structure

00

I use dotnet pack to create nuget packages

dotnet pack ../Source/Blazorise/Blazorise.csproj --force -o . -c Release
dotnet pack ../Source/Blazorise.Bootstrap/Blazorise.Bootstrap.csproj --force -o . -c Release

For root project Blazorise everything is generated just fine. But for all other projects that have reference to the Blazorise.csproj contentFiles and static files are not working as expected. As you can see in the following image contentFiles is included in the .nuspec.

01

When you navigate to that file you see that it is referencing wwwroot in the root project

02

Also the path goes to my local folder which it should not be there.


As a workaround I have fallback to nuget pack and I manually generate nupkg packages based on dotnet pack. To make it work I have removed content and contentFiles from nupkg.

Full code for a workaround can be found on branch fix-nugets
https://github.com/stsrki/Blazorise/tree/fix-nugets/NuGet

  • dotnet-pack.bat is problematic
  • pack.bat is used as a workaround
@javiercn javiercn added the area-blazor Includes: Blazor, Razor Components label Sep 26, 2019
@mkArtakMSFT mkArtakMSFT added this to the Discussions milestone Sep 26, 2019
@mkArtakMSFT
Copy link
Member

Hi. It looks like this is a question about how to use ASP.NET Core. While we do our best to look through all the issues filed here, to get a faster response we suggest posting your questions to StackOverflow using the asp.net-core-blazor tag.

@stsrki
Copy link
Contributor Author

stsrki commented Sep 26, 2019

Hi @mkArtakMSFT

I would like it to be a question but I think it's a bug in dotnet pack. What I try to accomplish is to pack Razor Static Libraries and create nuget packagea. As you can see in the previous example every project is RCL.

The problem is indicated for every project except for root project named Blazorise. Every project in a solution have a reference to Blazorise.

When I run dotnet pack the content and contentFiles are created in nupkg. Now I don't know if they should or should not be created. What I know and what you can see from example is that ContentRoot is pointing to local directory. And on top of that it's pointing to the root csproj.

If I remove those directories from nupkg it all works. Based on all of that I can assume it's a bug. If something can be done to disable that behavior I could not find it in the documentation. https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-pack

Also, I have provided a link to my repository so that you guys can reproduce the bug and see it for yourself. I can go and create a minimal project(s) if that is prefered.

@ghost
Copy link

ghost commented Dec 6, 2019

Thank you for contacting us. Due to no activity on this issue we're closing it in an effort to keep our backlog clean. If you believe there is a concern related to the ASP.NET Core framework, which hasn't been addressed yet, please file a new issue.

@ghost ghost closed this as completed Dec 6, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Dec 6, 2019
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components question
Projects
None yet
Development

No branches or pull requests

3 participants