Error compiling a Blazor 'client-side' project on .NET 5 #622

Open
opened 2026-01-29 16:44:18 +00:00 by claunia · 0 comments
Owner

Originally created by @Nodiink on GitHub (Jan 27, 2021).

Originally assigned to: @GregorBiswanger on GitHub.

  • Version: Electron.NET Tools 11.5.1
  • .NET version: 5.0.1
  • Target: Win 10, desktop, x64

The error is:

NETSDK1098: Applications published to a single-file are required to use the application host. 
You must either set PublishSingleFile to false or set UseAppHost to true.

Full console text:

Start Electron Desktop Application...
Microsoft Windows [Version 10.0.19042.746]
(c) 2020 Microsoft Corporation. All rights reserved.
C:\...\tests\BlazorApp9>dotnet publish -r win-x64 -c "Debug" --output "C:\...\tests\BlazorApp9\obj\Host\bin" /p:PublishReadyToRun=true /p:PublishSingleFile=true --no-self-contained
Microsoft (R) Build Engine version 16.8.3+39993bd9d for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
  Determining projects to restore...
  All projects are up-to-date for restore.
C:\Program Files\dotnet\sdk\5.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(145,5): error NETSDK1098: Applications published to a single-file are required to use the application host. You must either set PublishSingleFile to false or set UseAppHost to true. [C:\...\tests\BlazorApp9\BlazorApp9\Client\BlazorApp9.Client.csproj]
  BlazorApp9.Shared -> C:\...\tests\BlazorApp9\BlazorApp9\Shared\bin\Debug\net5.0\win-x64\BlazorApp9.Shared.dll
C:\Program Files\dotnet\sdk\5.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(96,5): error NETSDK1099: Publishing to a single-file is only supported for executable applications. [C:\...\tests\BlazorApp9\BlazorApp9\Shared\BlazorApp9.Shared.csproj]
  BlazorApp9.Shared -> C:\...\tests\BlazorApp9\BlazorApp9\Shared\bin\Debug\net5.0\BlazorApp9.Shared.dll
C:\...\tests\BlazorApp9>
Error occurred during dotnet publish: 1
Originally created by @Nodiink on GitHub (Jan 27, 2021). Originally assigned to: @GregorBiswanger on GitHub. * **Version**: Electron.NET Tools 11.5.1 * **.NET version**: 5.0.1 * **Target**: Win 10, desktop, x64 The error is: ``` NETSDK1098: Applications published to a single-file are required to use the application host. You must either set PublishSingleFile to false or set UseAppHost to true. ``` Full console text: ``` Start Electron Desktop Application... Microsoft Windows [Version 10.0.19042.746] (c) 2020 Microsoft Corporation. All rights reserved. C:\...\tests\BlazorApp9>dotnet publish -r win-x64 -c "Debug" --output "C:\...\tests\BlazorApp9\obj\Host\bin" /p:PublishReadyToRun=true /p:PublishSingleFile=true --no-self-contained Microsoft (R) Build Engine version 16.8.3+39993bd9d for .NET Copyright (C) Microsoft Corporation. All rights reserved. Determining projects to restore... All projects are up-to-date for restore. C:\Program Files\dotnet\sdk\5.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(145,5): error NETSDK1098: Applications published to a single-file are required to use the application host. You must either set PublishSingleFile to false or set UseAppHost to true. [C:\...\tests\BlazorApp9\BlazorApp9\Client\BlazorApp9.Client.csproj] BlazorApp9.Shared -> C:\...\tests\BlazorApp9\BlazorApp9\Shared\bin\Debug\net5.0\win-x64\BlazorApp9.Shared.dll C:\Program Files\dotnet\sdk\5.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(96,5): error NETSDK1099: Publishing to a single-file is only supported for executable applications. [C:\...\tests\BlazorApp9\BlazorApp9\Shared\BlazorApp9.Shared.csproj] BlazorApp9.Shared -> C:\...\tests\BlazorApp9\BlazorApp9\Shared\bin\Debug\net5.0\BlazorApp9.Shared.dll C:\...\tests\BlazorApp9> Error occurred during dotnet publish: 1 ```
claunia added the bug label 2026-01-29 16:44:18 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#622