Skip to content

Published Hosted Blazor WASM does not contain PDB files. #40787

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
1 task done
SwiftMJ opened this issue Mar 19, 2022 · 4 comments
Closed
1 task done

Published Hosted Blazor WASM does not contain PDB files. #40787

SwiftMJ opened this issue Mar 19, 2022 · 4 comments
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. question Status: Resolved

Comments

@SwiftMJ
Copy link

SwiftMJ commented Mar 19, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I am trying to publish a hosted blazor wasm application with PDB files.

I couldn't find any way to this this apart from by using the BlazorEnableDebugging flag. #18859 (comment)

This flag seems to work for blazor wasm applications, but with hosted the pdb files for the client project are still not output to the publish/wwwroot/_framework directory.

Expected Behavior

When running the command:

dotnet publish -c Release -p:BlazorEnableCompression=false -p:PublishTrimmed=false -p:BlazorEnableDebugging=true

on a hosted blazor wasm application the pdb files should be included in the following directory:

< server project >/bin/Release/< target framework >/publish/wwwroot/_framework

and the blazor.boot.json file should contain a list of the pdbs.

Steps To Reproduce

Create a blazor wasm hosted solution.

Run the following command to publish from within the Server folder

dotnet publish -c Release -p:BlazorEnableCompression=false -p:PublishTrimmed=false -p:BlazorEnableDebugging=true

I have created an Example Repo with these steps complete.

As you can see the BlazorApp1.Client.pdb is output in the client bin folder and on line 205 of the blazor.boot.json the pdb's are listed.

But in the server publish folder there is no BlazorApp1.Client.pdb and the pdb section is null in the blazor.boot.json

Exceptions (if any)

No response

.NET Version

6.0.300-preview.22154.4

Anything else?

No response

@mkArtakMSFT mkArtakMSFT added area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly labels Mar 20, 2022
@javiercn
Copy link
Member

@SwiftMJ thanks for contacting us.

Symbols are not copied to the publish folder by default. You might use CopyOutputSymbolsToPublishDirectory in your csproj folder to control this.

@javiercn javiercn added question ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. labels Mar 21, 2022
@ghost ghost added the Status: Resolved label Mar 21, 2022
@SwiftMJ
Copy link
Author

SwiftMJ commented Mar 22, 2022

@javiercn Thanks, I added that to the .csproj file for the Client, Server and Shared projects.

The BlazorApp1.Client.pdb is now included in the publish/wwwroot/_framework although the BlazorApp1.Shared.pdb file is not. Any ideas why this would be?

@javiercn
Copy link
Member

@SwiftMJ I suspect you might need to potentially add that flag to each and every project. We gather the dlls and pdbs from the ResolvedFilesToPublish item group, so if it's not there, we won't detect it and copy it.

@ghost
Copy link

ghost commented Mar 23, 2022

This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes.

See our Issue Management Policies for more information.

@ghost ghost closed this as completed Mar 23, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Apr 22, 2022
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 feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. question Status: Resolved
Projects
None yet
Development

No branches or pull requests

3 participants