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.

Support Nano Server and non-Windows OSes for apphost customization

See original GitHub issue

Steps to reproduce

On Windows with Docker for Windows installed that has been configured to use “Windows Containers”:

  1. docker run -it microsoft/dotnet-nightly:3.0-sdk
  2. mkdir repro && cd repro
  3. dotnet new console
  4. 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:open
  • Created 5 years ago
  • Reactions:4
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
MaverickMartyncommented, Feb 20, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

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