Support Nano Server and non-Windows OSes for apphost customization
See original GitHub issueSteps to reproduce
On Windows with Docker for Windows installed that has been configured to use “Windows Containers”:
docker run -it microsoft/dotnet-nightly:3.0-sdk
mkdir repro && cd repro
dotnet new console
dotnet build
Expected behavior
The project builds without warnings or errors. The resulting apphost is customized.
Actual behavior
A warning is printed that the application host will not be customized because the Docker
C:\Program Files\dotnet\sdk\3.0.100-preview-009784\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(294,5): warning NETSDK1074: The application host executable will not be customized because adding resources requires that the build be performed on Windows (excluding Nano Server).
This is because the resource updating API (starting with BeginUpdateResource
) isn’t available on Nano Server.
Given that CI systems might be using Nano Server to build applications, users will likely want this to work so that their build doesn’t differ from other platforms.
Environment data
C:\>dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.0.100-preview-009784
Commit: d86a1816c4
Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.0.100-preview-009784\
Host (useful for support):
Version: 3.0.0-preview-27122-01
Commit: 00c5c8bc40
.NET Core SDKs installed:
3.0.100-preview-009784 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.0.0-preview-18572-0018 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.0.0-preview-27122-01 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0-alpha-27122-4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:7 (5 by maintainers)
Top Results From Across the Web
What OS to target with .NET containers
When deploying .NET 7 applications, you can target Windows Nano Server, which is cloud optimized, uses Kestrel and is smaller and starts faster....
Read more >Managing Nano server as a Hyper-V host or a VM in VMM
This article describes how to deploy and manage Nano server-based hosts & VMs in VMM.
Read more >Exploring Nano Server for Windows Server 2016
If you haven't yet tried Windows Server 2016, today we hope to give you a few more reasons to try out our latest...
Read more >Deploy existing .NET apps as Windows containers
Modernize existing .NET applications with Azure Cloud and Windows containers | Deploy existing .NET apps as Windows containers.
Read more >Building and Deploying Nano Servers - Simple Talk
The Nano Server Image Builder needs the Windows Server 2016 OS files to build a custom image. You must point to a valid...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Any progress on a solution to this? Or a suitable workaround? I use linux for my build server and would love to be able to build Windows Desktop binaries. Not even Avalonia, Uno Platform or JBildstein/SpiderEye can build windows binaries at this time, forcing me on .net 4.8, unless I want no icon and a console window.
Looks like the path forward here is: https://github.com/dotnet/core-setup/pull/6831#issuecomment-502876821
cc @jkoritzinsky @swaroop-sridhar @davidwrighton