The Wayback Machine - https://web.archive.org/web/20220129233639/https://github.com/dotnet/aspnetcore/issues/39869
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 Blazor WASM application to Azure App service fails #39869

Open
sam-wheat opened this issue Jan 29, 2022 · 0 comments
Open

Publish Blazor WASM application to Azure App service fails #39869

sam-wheat opened this issue Jan 29, 2022 · 0 comments

Comments

@sam-wheat
Copy link

@sam-wheat sam-wheat commented Jan 29, 2022

Same issue as here: #36641

error NETSDK1045: The current .NET SDK does not support targeting .NET 6.0. Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 6.0.

https://docs.microsoft.com/en-us/azure/static-web-apps/deploy-blazor

https://blazorhelpwebsite.com/ViewBlogPost/10

https://docs.microsoft.com/en-us/dotnet/core/tools/sdk-errors/netsdk1045

https://docs.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/webassembly?view=aspnetcore-6.0

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

With regard to the last link above, how is it possible to install the URL Rewrite module to Azure?

Is there a link to a document that provides an example .csproj and yml pipleline for deploying a Blazor app to an Azure web service? Please provide the url as I am unable to find any such documentation. Note I am deploying to a Virtual Application of an Azure App Service.

Pipeline:

# ASP.NET Core (.NET Framework)
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core


trigger:
- release/*

pool:
  vmImage: 'windows-latest'

variables:
  solution: '**/*.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'

steps:

- task: UseDotNet@2				// I have tried removing this											
  displayName: 'Use dotnet 6'
  inputs:
	packageType: 'sdk'
	version: '6.x'

- task: DotNetCoreCLI@2
  displayName: 'DotNet Restore NuGet packages'
  inputs:
	command: 'restore'
	feedsToUse: 'select'
	vstsFeed: 'MyFeed'
	includeNuGetOrg: true

- script: dotnet build --configuration $(buildConfiguration)
  displayName: 'dotnet build $(buildConfiguration)'

- task: DotNetCoreCLI@2
  displayName: 'Dotnet publish'
  inputs:
	command: publish
	publishWebProjects: True
	arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory) --self-contained'
	zipAfterPublish: True

- task: AzureRmWebAppDeployment@4
  displayName: 'AzureRmWebAppDeployment@4'
  inputs:
	ConnectionType: 'AzureRM'
	azureSubscription: 'My'
	appType: webApp
	WebAppName: 'MyWeb'
	VirtualApplication: '/blazor'
	packageforLinux: '$(Build.ArtifactStagingDirectory)/*.zip'

.csproj

<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

  <PropertyGroup>
	<TargetFramework>net6.0</TargetFramework>
	  <ImplicitUsings>enable</ImplicitUsings>
	  <AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
	  <GenerateAppxPackageOnBuild>enable</GenerateAppxPackageOnBuild>
	  <RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
	  <RunAOTCompilation>true</RunAOTCompilation>
  </PropertyGroup>

  <ItemGroup>
	//...
  </ItemGroup>

</Project>

dotnet:

dotnet --info
.NET SDK (reflecting any global.json):
 Version:   6.0.101
 Commit:    ef49f6213a

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19044
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\6.0.101\

Host (useful for support):
  Version: 6.0.1
  Commit:  3a25a7f1cc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant