question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Publishing a server hosted wasm app fails in dotnet 7 rc1

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

If you attempt to publish a server hosted wasm app it fails

Expected Behavior

Expect to be able to publish

Steps To Reproduce

  1. Using .net 7 RC1 and VS 17.4.0 Preview 2.1 with the workload of 'wasm-tools installed create a blazor wasm app that is server hosted.

  2. issue the following command:

C:\Solutions\TemporarySolutions\BlazorApp2>dotnet publish blazorapp2\server\blazorapp2.server.csproj --os linux --arch x64 --configuration Release -p:PublishProfile=DefaultContainer -p:Version=1.0.0 -p:ContainerImageName=blazorServerApp
  1. Observe the following output:
MSBuild version 17.4.0-preview-22428-01+14c24b2d3 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
C:\Program Files\dotnet\sdk\7.0.100-rc.1.22431.12\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(219,5): mes
sage NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\Solutions\TemporarySolutions\BlazorAp
p2\blazorapp2\server\blazorapp2.server.csproj]
C:\Program Files\dotnet\sdk\7.0.100-rc.1.22431.12\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(219,5): mes
sage NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\Solutions\TemporarySolutions\BlazorAp
p2\blazorapp2\Shared\BlazorApp2.Shared.csproj]
  BlazorApp2.Shared -> C:\Solutions\TemporarySolutions\BlazorApp2\blazorapp2\Shared\bin\Release\net7.0\BlazorApp2.Shared.dll
C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\7.0.0-rc.1.22426.10\Sdk\WasmApp.targets(194,5): error : $(MicrosoftNetCor
eAppRuntimePackDir)='', and cannot find %(ResolvedRuntimePack.PackageDirectory)=. One of these need to be set to a valid path [C:\Solutions\T
emporarySolutions\BlazorApp2\blazorapp2\Client\BlazorApp2.Client.csproj]

Exceptions (if any)

None

.NET Version

7.0.100-rc.1.22431.12

Anything else?

C:\Solutions\TemporarySolutions\BlazorApp2>dotnet --info
.NET SDK:
 Version:   7.0.100-rc.1.22431.12
 Commit:    f1cf61e1c0

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

Host:
  Version:      7.0.0-rc.1.22426.10
  Architecture: x64
  Commit:       06aceb7015

.NET SDKs installed:
  3.1.423 [C:\Program Files\dotnet\sdk]
  6.0.400 [C:\Program Files\dotnet\sdk]
  6.0.401 [C:\Program Files\dotnet\sdk]
  7.0.100-rc.1.22431.12 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.29 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.0-rc.1.22427.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.29 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.0-rc.1.22426.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.29 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.0-rc.1.22427.1 [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

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:22 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
MarkStegacommented, Oct 4, 2022

I am trying to build an app from a simple server hosted web assembly (https://github.com/MarkStega/BlazorApp1). I have not yet been able to reproduce the issue. I will keep adding content from the failing project until I can reproduce…

0reactions
bricelamcommented, Jan 10, 2023

@TanayParikh We have a similar report on EF Core (https://github.com/dotnet/efcore/issues/29491) that has regressed our Migration Bundles feature in 7.0. The bundle is a separate project that references the Blazor app. It fails when calling dotnet publish on the bundle project.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Blank Blazor WASM app fails to publish with ...
Try publish the Blazor WASM with publish PublishTrimmed false in Windows, the process will fail with this error (But if I publish using...
Read more >
ASP.NET Core updates in .NET 7 Release Candidate 1
NET 7 Release Candidate 1 (RC1) is now available and includes many great new improvements to ASP.NET Core. Here's a summary of what's...
Read more >
Host and deploy ASP.NET Core Blazor WebAssembly
Learn how to host and deploy Blazor WebAssembly using ASP.NET Core, Content Delivery Networks (CDN), file servers, and GitHub Pages.
Read more >
Use .NET from any JavaScript app in .NET 7
We can use the dotnet-serve tool to host the published app locally. Using the correct MIME type for .wasm allows the browser to...
Read more >
Breaking changes in .NET 7
If you're migrating an app to .NET 7, the breaking changes listed here might affect you. Changes are grouped by technology area, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found