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

PublishSingleFile results in 404 errors for Nuget components #17079

Closed
Webreaper opened this issue Nov 14, 2019 · 6 comments
Closed

PublishSingleFile results in 404 errors for Nuget components #17079

Webreaper opened this issue Nov 14, 2019 · 6 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 feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly
Projects

Comments

@Webreaper
Copy link

Developing a Blazor app in VS for Mac 8.4 Preview (8.4 build 2414) and publishing a single-file executable for Linux, the JS and CSS components for NuGet packages result in a 404 when executing the app. This worked fine when I did it about 2 weeks ago, so looks to be a regression in the latest preview version of 16.4 which installed within the last week.

To reproduce:

  1. Write a blazor app referencing a component such as Blazored.TypeAhead or Blazored.Modal
  2. Publish the app as a single-file EXE targetting ubuntu (I haven't tried other targets):
    dotnet publish Damselfly.Web -r ubuntu.18.04-x64 -c Release /p:PublishSingleFile=true
  3. Copy the single-file EXE onto a linux server, and execute.
  4. The app fails to render properly, and opening the console in Chrome gives, for example:
GET http://server:6363/_content/Blazored.Typeahead/blazored-typeahead.css net::ERR_ABORTED 404 (Not Found)
search:12 GET http://server:6363/_content/Blazor.ContextMenu/blazorContextMenu.min.css net::ERR_ABORTED 404 (Not Found)
search:11 GET http://server:6363/_content/Blazored.Modal/blazored-modal.css net::ERR_ABORTED 404 (Not Found)
search:356 GET http://server:6363/_content/Blazor.ContextMenu/blazorContextMenu.min.js net::ERR_ABORTED 404 (Not Found)
search:357 GET http://server:6363/_content/Blazored.Typeahead/blazored-typeahead.js net::ERR_ABORTED 404 (Not Found)
  1. Re-publish the app without PublishSingleFile=true, and then copy across to the server, app runs fine.

ASP.Net Core version: I tried this with DotNet Core 3.1 preview, and just in case it was a regression with that version I also tried with DotNet Core 3.0. Same problem with both. So it looks like it's a regression with the single-file packaging for Blazor apps not including the _content folder properly.

Output of dotnet --info:

.NET Core SDK (reflecting any global.json):
 Version:   3.1.100-preview2-014569
 Commit:    4bd5d24d87

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.14
 OS Platform: Darwin
 RID:         osx.10.14-x64
 Base Path:   /usr/local/share/dotnet/sdk/3.1.100-preview2-014569/

Host (useful for support):
  Version: 3.1.0-preview2.19525.6
  Commit:  5672978d91

.NET Core SDKs installed:
  2.0.0 [/usr/local/share/dotnet/sdk]
  2.1.4 [/usr/local/share/dotnet/sdk]
  2.1.301 [/usr/local/share/dotnet/sdk]
  2.1.302 [/usr/local/share/dotnet/sdk]
  2.1.500 [/usr/local/share/dotnet/sdk]
  2.1.505 [/usr/local/share/dotnet/sdk]
  2.1.701 [/usr/local/share/dotnet/sdk]
  3.0.100-preview7-012821 [/usr/local/share/dotnet/sdk]
  3.0.100-preview9-014004 [/usr/local/share/dotnet/sdk]
  3.0.100 [/usr/local/share/dotnet/sdk]
  3.1.100-preview2-014569 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.12 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.12 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0-preview7.19365.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0-preview9.19424.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.0-preview2.19528.8 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.9 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.12 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.13 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0-preview7-27912-14 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0-preview9-19423-09 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.0-preview2.19525.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

@javiercn javiercn added the area-blazor Includes: Blazor, Razor Components label Nov 14, 2019
@javiercn
Copy link
Member

@Webreaper thanks for contacting us.

This can be a bug, we might not be adding ExcludeFromSingleFile to the static web assets.

@mkArtakMSFT mkArtakMSFT added this to the 5.0.0-preview1 milestone Nov 14, 2019
@mkArtakMSFT mkArtakMSFT added bug This issue describes a behavior which is not expected - a bug. and removed investigate labels Nov 14, 2019
@Webreaper
Copy link
Author

Updated to 8.4 build 2535 last night, and the problem is still present (I know you're still probably investigating so wasn't expecting it to be fixed :))

@Webreaper
Copy link
Author

Any update on this? I've just updated to DotNetCore SDK v3.1.0 and the problem still happens.

@javiercn
Copy link
Member

javiercn commented Dec 4, 2019

@Webreaper this is scheduled for preview5, so I wouldn't expect any action on this until the end of the year.

You can probably workaround this through MSBuild extensibility by setting the ExcludeFromSingleFile property on the ResolvedFileToPublish items for the static web assets.

@Webreaper
Copy link
Author

Thanks for the update. I'm using normal publishing for now, but thanks for the tip!

@javiercn javiercn added the Servicing-consider Shiproom approval is required for the issue label Dec 5, 2019
@mkArtakMSFT mkArtakMSFT removed the Servicing-consider Shiproom approval is required for the issue label Dec 5, 2019
@mkArtakMSFT
Copy link
Member

Removed the servicing-consider label from the issue, as we track it on the PRs.

@mkArtakMSFT mkArtakMSFT moved this from 3.1 - Preview 5 to In Progress (CC: 27th Nov) in Blazor WASM: MOVED TO https://github.com/dotnet/aspnetcore/projects/9 Dec 6, 2019
@mkArtakMSFT mkArtakMSFT added the feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly label Jan 10, 2020
@mkArtakMSFT mkArtakMSFT added this to In Progress (CC: 21st Jan) in Blazor WASM Jan 10, 2020
@javiercn javiercn added Done This issue has been fixed and removed Working labels Jan 15, 2020
Blazor WASM automation moved this from In Progress (CC: 21st Jan) to Done Jan 15, 2020
@dotnet dotnet locked as resolved and limited conversation to collaborators Feb 14, 2020
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 feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly
Projects
No open projects
Blazor WASM
  
Done
Development

No branches or pull requests

3 participants