-
Notifications
You must be signed in to change notification settings - Fork 31
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
AWS Toolkit for Visual Studio is unable to deploy a Blazor Web App with Interactive Render Mode WebAssembly #414
Comments
Would you be able to provide exact steps that you are taking to get to the issue? Are you trying to deploy the AWS Serverless Application using "Publish to AWS Lambda" or "Publish to AWS"? Also, in the Blazor Web App template, the main project is the server project not the client project. So if you are trying to publish or deploy, you should use the server project as the main one. |
Please note that the Blazor Web App template changed in DotNet 8. It now generates two projects, one for Blazor server-side rendering and one for Blazor Webassembly. Steps to create:
Now we want to do the same thing in AWS lambda.
Now attempt to Publish to AWS Lambda.
This may not be enough to demonstrate the whole issue, but this is my first roadblock to getting the AWS Lambda to publish. How can I see the MSBUILD script being used by AWS Publish to Lambda? |
Project File
This issue dotnet/aspnetcore#46711 might be related although the error message is different. It is possible that removing --self-contained False from the dotnet publish allows this to succeed. |
Tried adding
to the blazor server proj as well but no go. Anyone have some ideas on how to make some progress? For me, this would be a game changer. Being able to use both Blazor server-side and Blazor client-side Webassembly from the same Lambda Application. |
Consistent when using DotNet CLI
Removing --self-contained false from the publish command, however, creates what looks like a valid publish locally.
|
Looks Webassembly packaging issue. |
For the good of the community, here is a CONFIRMED solution to this problem: Key Fact: Steps to solve the issue:
Now, your build with SelfContained=false (which is what AWS toolkit does) should succeed without an error, and your deployment package should be minimal in terms of size by not including the entire .net server-side runtime. The webassembly project will also be built for the browser-wasm runtime not linux-x64. Problem solved. |
This also works for me. In the WASM client project use
Then in the property Group, you can use
|
Thank you for this solution! I had the same problem with the WASM as part of a bigger project not on AWS. |
I am using all dotnet 8.
If you create a Blazor Web App with Interactive Render Mode WebAssembly then the Visual Studio template will create two projects.
The first is a Web app that can run Server Side Rendered Blazor.
The second is a cut down Blazor Webassembly App which will run Client Side rendered Webassembly.
If we create a project for AWS Serverless Application and put a project dependency on the WebAssembly client app. We can no longer Publish to AWS.
However, the MSBuild for the Blazor Web App correctly packages up the publish.
The MSBuild for the AWS app needs to do the same thing so that we can serve up the WebAssembly pieces from the AWS Serverless Application (in the Blazor Web App publish is a directory _framework containing all of the downloadable Webassembly components).
As far as the Webassembly piece is concerned, this is just downloadable content.
Note: I am not using Blazor server anywhere which requires a Websocket to work. This is just static Webassembly content.
The text was updated successfully, but these errors were encountered: