blazor-workshop
blazor-workshop copied to clipboard
Deploying to Azure with preview does not work. Should I be using a different version ?
When trying self contained
Severity Code Description Project File Line Suppression State Error Assets file 'C:\Users\punko\Source\Repos\blazor-workshop2\save-points\08-templated-components\BlazingPizza.Client\obj\project.assets.json' doesn't have a target for '.NETStandard,Version=v2.0'. Ensure that restore has run and that you have included 'netstandard2.0' in the TargetFrameworks for your project. BlazingPizza.Server 0
I also have experienced this issue. Basically I have found no way to get this to publish to Azure and work.
- Follow the instructions to the letter in the lab and it will not publish to Azure, but will give you a build error during publish attempt. ERROR: Publish failed blah blah...nothing useful in this dialog as usual from Microsoft. Looking at the output window I see the same errors noted by punkouter2018.
- Based on some google searches I manually modify the .pubxml file and remove the
<targetFramework>netcoreapp3.0</targetFramework>line and saving changes. Publish again and this time it succeeds. YES, maybe we are getting this after all. But alas, the happiness is short lived. You open the site in a browser and get the following.
HTTP Error 500.0 - ANCM In-Process Handler Load FailureCommon causes of this issue: The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found. The in process request handler, Microsoft.AspNetCore.Server.IIS, was not referenced in the application. ANCM could not find dotnet. Troubleshooting steps: Check the system event log for error messages Enable logging the application process' stdout messages Attach a debugger to the application process and inspect For more information visit: https://go.microsoft.com/fwlink/?LinkID=2028526
- Based on more google searches I now tried setting the Deployment Mode to Self-Contiained, oh and Visual Studio will re-add the
<targetFramework>netcoreapp3.0</targetFramework>line so you will have to remove that again before you publish. Now Publish and, not to get too excited again, it does successfully publish your app. You open the app and DAMN, now its a 404.
HTTP 404 error That’s odd... Microsoft Edge can’t find this page
Try this Retype the web address Go back to the last page
I am now brain dead for the day and no longer have any motivation to research this further and leave it to some other capable or lucky soul to stumble upon the fix.
I had 2 successful publishings from the blazor template
-
The client only side you can use a tutorial I found about deploying it to a storage account. That worked.
-
The server side only version I set to self contained and that working..
But the mixes ones … perhaps the ones that use 2.0 standard ? I don't know
server side self contained publishes for you as it did for me, but does the site work?
Yeah last I tried.. I think this was the server sides VS2019 blazor template … I guess that should be my focus for now since that is the official one.
Unable to publish server-hosted Blazor app from Visual Studio Preview https://github.com/aspnet/AspNetCore/issues/11088
[Blazor] Preview 6 blazorhosted project publish is broken https://github.com/aspnet/AspNetCore/issues/11185
I had exactly the same problem, after following the steps in the Microsoft documentation for deploying the preview. I set the profile as SCD, then removed the <targetFramework>netcoreapp3.0</targetFramework> as suggested above and it published fine. However I just got 404 errors... hmmm, anyway figured as the publish profile is set to 'x86' I installed the x86 version of .net core SDK preview (I had 64bit installed). I tried publishing again and its worked, don't know if that's worth a try for you?
Still having the same issue - Azure only supports extensions up to preview5. @danroth27
This is a known issue with Preview 6. There is a blocking issue with using the Azure App Service site extension for Preview 6. Instead you need to deploy your app as a self-contained app.
However, there is a separate issue with deploying ASP.NET Core hosted Blazor apps as self contained apps. To work around this issue you can try removing the TargetFramework from the generated publishing profile (.pubxml).
Most of these issues will get sorted out in Preview 7.
@danroth27 any expected date of preview 7 release?
@iAmBipinPaul We're targeting next week.
I've just tried deploying a preview 7 ASP.NET hosted (as self contained) Blazor app (just the standard app template projects, the client/server/shared, no changes) and it does seem to now work!
You still need to remove the <TargetFramework> tag from the publish profile as mentioned above. Also I had to target x86 instead of x64, but I suspect that's because I'm just using the free tier of Azure to test this... :)
@aventius-software Yeah, this is unfortunately still an issue with .NET Core 3.0 Preview 7 and we don't expect to get it fixed until Preview 9 in early September. I apologize for the inconvenience!
You are correct that by default Azure targets x86. If you want to use x64 instead you need to configure the app service accordingly.
@danroth27
i have tried the following with respect to deployment:
- create azure infrastructure
- Resource group
- App service plan - F1, Windows
- Web app - .NET Core 3.1
- Clone this report and perform the following steps
cd 08-templated-components\BlazingPizza.Server
dotnet clean -c Release
dotnet build -c Release
dotnet publish -c Release --no-build --no-restore
Zipped up the published output, named it BlazingPizza.zip Using Azure CLI deployed the zip file to my app service
az webapp deploy --resource-group <rg name> --name <app name> --src-path <zip path> --type zip --async true
I had to set ASPNETCORE_ENVIRONMENT appsetting key in Web App to Development. This is because, if the env is PROD - IdentityServer looks for a signing key - a certificate. Just to check if deployment is fine - i have set my env to be development. And the deployment works - i am able to browse the site.
Hope this helps.
@punkouter2021 we now have .NET6. If this is no more an issue for you, do consider closing this issue. Thanks.