dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.59k stars 1.03k forks source link

Support Nano Server and non-Windows OSes for apphost customization #9963

Open peterhuene opened 5 years ago

peterhuene commented 5 years ago

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
peterhuene commented 5 years ago

See also dotnet/sdk#2700 which worked around the lack of the API for Nano Server.

Cc @dsplaisted @nguerrera @jkotas @sbomer for awareness regarding this tracking issue.

peterhuene commented 5 years ago

@jkotas is doing a cross-platform resource updater for the apphost customization still on the radar for 3.0?

jkotas commented 5 years ago

I do not know. Is it acceptable to ship without it? @jeffschwMSFT @vitek-karas

jeffschwMSFT commented 5 years ago

Currently this request is below our feature line for .NET Core 3.0. We were aware of this request when we started this work, but decided to hold for strong customer need before investing.

nguerrera commented 5 years ago

Looks like the path forward here is: https://github.com/dotnet/core-setup/pull/6831#issuecomment-502876821

cc @jkoritzinsky @swaroop-sridhar @davidwrighton

dgadelha commented 4 years ago

6831 was merged. Is there any chance we can get this in the first .NET 5 stable release? Thanks!

MaverickMartyn commented 2 years ago

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.