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

Publish failure for a standalone WASM app #52673

Open
1 task done
MarkStega opened this issue Dec 8, 2023 · 8 comments
Open
1 task done

Publish failure for a standalone WASM app #52673

MarkStega opened this issue Dec 8, 2023 · 8 comments
Assignees
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly
Milestone

Comments

@MarkStega
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I have a WASM app that fails to publish after I added TypeScript/Javascript source to one of the razor class libraries that compose the app. To make matters worse the publish step is deleting input files from the RCL source.

Expected Behavior

I'd expect to be able to add content files to the RCL without breaking the WASM publish.

Steps To Reproduce

This is a fully reproducible problem and even though the repository is large, I can walk through the needed steps for reproduction with a minimal understanding of the repository required.

The public, open source repository is https://github.com/Material-Blazor/Material.Blazor.

  1. Clone the repository
  2. Checkout the vNext branch
  3. Publish the Material.Blazor.Website.WebAssembly.MD3 project using the FolderProfile
  4. This succeeds
  5. Edit the Material.Blazor.Website.MD3.csproj
  6. Delete the comment markers on lines 101, 85, 83, and 79. This enable production of two javascript assets
  7. Repeat the publish step 3 above

This has two unfortunate results.

The first is that there are five files not found. They are static assets in the wwwroot folder of the Material.Blazor.Website.MD3 project. The errors are below.

The second is that those static assets are deleted from the source tree.

Connecting to C:\Solutions\OHI\Material.Blazor\.artifacts\publish\Material.Blazor.Website.WebAssembly.MD3\webassembly_net8.0\...
C:\Program Files\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.Publish.targets(150,5): Error MSB3030: Could not copy the file "C:\Solutions\OHI\Material.Blazor\Material.Blazor.Website.MD3\wwwroot\icons\favicon-16x16.png" because it was not found.
C:\Program Files\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.Publish.targets(150,5): Error MSB3030: Could not copy the file "C:\Solutions\OHI\Material.Blazor\Material.Blazor.Website.MD3\wwwroot\icons\favicon-32x32.png" because it was not found.
C:\Program Files\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.Publish.targets(150,5): Error MSB3030: Could not copy the file "C:\Solutions\OHI\Material.Blazor\Material.Blazor.Website.MD3\wwwroot\icons\icon-512.png" because it was not found.
C:\Program Files\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.Publish.targets(150,5): Error MSB3030: Could not copy the file "C:\Solutions\OHI\Material.Blazor\Material.Blazor.Website.MD3\wwwroot\images\book-shelves.jpg" because it was not found.
C:\Program Files\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.Publish.targets(150,5): Error MSB3030: Could not copy the file "C:\Solutions\OHI\Material.Blazor\Material.Blazor.Website.MD3\wwwroot\images\mac.jpg" because it was not found.

Exceptions (if any)

No response

.NET Version

8.0.100

Anything else?

Microsoft Visual Studio Community 2022 (64-bit) - Preview
Version 17.9.0 Preview 1.1

.NET SDK:
 Version:           8.0.100
 Commit:            57efcf1350
 Workload version:  8.0.100-manifests.71b9f198

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19045
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\8.0.100\

.NET workloads installed:
 Workload version: 8.0.100-manifests.71b9f198
 [wasm-tools]
   Installation Source: SDK 8.0.100
   Manifest Version:    8.0.0/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.workload.mono.toolchain.current\8.0.0\WorkloadManifest.json
   Install Type:              Msi


Host:
  Version:      8.0.0
  Architecture: x64
  Commit:       5535e31a71

.NET SDKs installed:
  6.0.417 [C:\Program Files\dotnet\sdk]
  7.0.401 [C:\Program Files\dotnet\sdk]
  8.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

C:\Users\ms>
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label Dec 8, 2023
@javiercn
Copy link
Member

javiercn commented Dec 11, 2023

@MarkStega thanks for contacting us.

Try adding <AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio> to https://github.com/Material-Blazor/Material.Blazor/blob/main/Directory.Build.props to see if that fixes your issue.

Does it work if you do the build/publish step from the command line?

UPDATE

Please set the <AccelerateBuildsInVisualStudio>**false**</AccelerateBuildsInVisualStudio> instead. The above was unintentional / typo.

@javiercn javiercn added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label Dec 11, 2023
@ghost
Copy link

ghost commented Dec 11, 2023

Hi @MarkStega. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@MarkStega
Copy link
Author

@javiercn

On the desktop in Visual Studio, the 'accelerate' addition makes no difference; The source files in the images & icons directory of Material.Blazor.Website.MD3 get deleted and then the publish fails.

The same behavior occurs with a command line 'dotnet publish'.

I originally saw the behavior on the workflow run in the github repository. https://github.com/Material-Blazor/Material.Blazor/actions/runs/7182566364/job/19559534765

What I find odd is that the almost identical projects in the repository build and publish with no issue.

RCL's of Material.Blazor & Material.Blazor.Website comprise the content of Material.Blazor.Website.Webassembly

in the same fashion as

RCL's of Material.Blazor.MD3 & Material.Blazor.Website.MD3 comprise the content of Material.Blazor.Website.Webassembly.MD3

but the build and publish of the 'non MD3' version succeeds.

@ghost ghost added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels Dec 12, 2023
@MarkStega
Copy link
Author

@javiercn

You actually helped me with the csproj for the resource build in 35274

@MarkStega
Copy link
Author

@javiercn

Now that it appears that #38445 is unlikely to be implemented, is there documentation on the 'preferred' way to build 3rd party assets using csproj commands?

@mkArtakMSFT
Copy link
Member

@MarkStega I've updated @javiercn's comment above as he meant to recommend you to try to disable the accelerated build in VS. Can you please try that again and see if that makes a difference: #52673 (comment)

@mkArtakMSFT mkArtakMSFT added Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. and removed Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. labels Feb 1, 2024
@ghost
Copy link

ghost commented Feb 1, 2024

Hi @MarkStega. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@MarkStega
Copy link
Author

MarkStega commented Feb 1, 2024

With AccelerateBuildsInVisualStudio set to true or false the same error occurs.

I don't think we can point to Visual Studio as the problem. The issue was first seen on a github actions CLI build. I was able to reproduce in VS which was more convenient than setting up a CLI build process on my development system.

@ghost ghost added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels Feb 1, 2024
@mkArtakMSFT mkArtakMSFT added this to the .NET 10 Planning milestone Jun 3, 2024
@mkArtakMSFT mkArtakMSFT added feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly and removed Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. labels Jun 3, 2024
@danroth27 danroth27 modified the milestones: .NET 10 Planning, Backlog Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly
Projects
None yet
Development

No branches or pull requests

4 participants