0

I've seen and attempted to follow several examples of how to do this, but they all seem to be for the version of web assembly projects that target .Net 2.1 Standard.

The project I am attempting to deploy with a github action is targeting .Net 5.0

According to the documentation from MS, "Standalone deployment assets are published into the /bin/Release/{TARGET FRAMEWORK}/publish/wwwroot folder."

https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/webassembly?view=aspnetcore-5.0#standalone-deployment

I'd thought of just giving up on a CI/CD for this and just deploying it manually. However, when I examine this folder, there is no 'publish' folder inside the {TARGET FRAMEWORK} folder. And inside wwwroot, there is nothing resembling what I'd think of as a web site.

So... can anybody give direction on how to achieve this?

1
  • See github.com/theHexagoner/TFT_HexGrid for my project. You can dig through the commits to see the various permutation of things I tried changing in the yml files. Commented Feb 26, 2021 at 21:30

1 Answer 1

0

I think you should run the dotnet publish command to create the standalone deployment assets. You can run the publish command from visual studio by right clicking on the project --> Publish --> and creating a folder publish profile. By default the artifacts are placed at /bin/Release/net5.0/browser-wasm/publish/wwwroot if you aare using .NET 5.0

Sign up to request clarification or add additional context in comments.

5 Comments

Thanks I will give this a try and report back.
I've got it built and put the output into a branch called gh_pages, which github seems to have spun up as the project's website. But it's just sitting on the Loading... text.
The site is blowing up due to "Failed to find a valid digest in the 'integrity' attribute for resource" for a JS file. I think this could be due to git helpfully changing some line endings (I vaguely recall it mentioning that at one point).
I added an entry to treat .js files as binary to the gitattributes file for that branch. Then I deleted the problem file and copied it into the repo again from where I published it. After synching up with the remote the site seems to be working.
I'd mark this as the answer, but I'm kind of waiting to see if anybody will chime in about creating a Github action that works for .Net 5.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.