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.

CreateAppHost task fails within Nano Server containers in 3.0

See original GitHub issue

Using SDK version 3.0.100-preview-009734

  1. Start with a microsoft/nanoserver container with dotnet 3.0 SDK installed (e.g. microsoft/dotnet-nightly:3.0-sdk Dockerfile)
  2. mkdir app
  3. cd app
  4. dotnet new
  5. dotnet build

Results:

C:\Program Files\dotnet\sdk\3.0.100-preview-009734\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(142,5): message NETSDK1057: You are using a preview version of .NET Core. See: https://aka.ms/dotnet-core-preview [C:\app\app.csproj]
C:\Program Files\dotnet\sdk\3.0.100-preview-009734\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(293,5): error MSB4018: The "CreateAppHost" task failed unexpectedly. [C:\app\app.csproj]
C:\Program Files\dotnet\sdk\3.0.100-preview-009734\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(293,5): error MSB4018: System.EntryPointNotFoundException: Unable to find an entry point named 'BeginUpdateResource' in DLL 'Kernel32'. [C:\app\app.csproj]
C:\Program Files\dotnet\sdk\3.0.100-preview-009734\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(293,5): error MSB4018:    at Microsoft.NET.Build.Tasks.ResourceUpdater.Kernel32.BeginUpdateResource(String pFileName, Boolean bDeleteExistingResources) [C:\app\app.csproj]
C:\Program Files\dotnet\sdk\3.0.100-preview-009734\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(293,5): error MSB4018:    at Microsoft.NET.Build.Tasks.AppHost.Create(String appHostSourceFilePath, String appHostDestinationFilePath, String appBinaryFilePath, Boolean windowsGraphicalUserInterface, String intermediateAssembly, Logger log) in /_/src/Tasks/Microsoft.NET.Build.Tasks/AppHost.cs:line 82 [C:\app\app.csproj]
C:\Program Files\dotnet\sdk\3.0.100-preview-009734\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(293,5): error MSB4018:    at Microsoft.NET.Build.Tasks.CreateAppHost.ExecuteCore() in /_/src/Tasks/Microsoft.NET.Build.Tasks/CreateAppHost.cs:line 38 [C:\app\app.csproj]
C:\Program Files\dotnet\sdk\3.0.100-preview-009734\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(293,5): error MSB4018:    at Microsoft.NET.Build.Tasks.TaskBase.Execute() in /_/src/Tasks/Common/TaskBase.cs:line 35 [C:\app\app.csproj]
C:\Program Files\dotnet\sdk\3.0.100-preview-009734\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(293,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C:\app\app.csproj]
C:\Program Files\dotnet\sdk\3.0.100-preview-009734\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(293,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [C:\app\app.csproj]

Build FAILED.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
peterhuenecommented, Nov 27, 2018

I’m hoping to have the fix in this week (ideally tomorrow). This is my priority issue atm.

1reaction
MichaelSimonscommented, Nov 7, 2018

@peterhuene - Is this something you know about?

Read more comments on GitHub >

github_iconTop Results From Across the Web

The CreateAppHost task failed unexpectedly. MSB4018
I was running the code inside shared directory, moving the folder out of shared directory and running the dotnet again solved the error....
Read more >
The CreateAppHostTask failed unexpectedly
For a while now, I have been receiving an error “The “CreateAppHost” task failed unexpectedly. System.IO.IOException: The process cannot ...
Read more >
What OS to target with .NET containers
NET Framework applications you have to target Windows Server Core, compatible with legacy apps and IIS, but it has a larger image. When ......
Read more >
MSB4018: The task failed unexpectedly - Microsoft Q&A
Error MSB4018 The "CreateAppHost" task failed unexpectedly. System.AggregateException: One or more errors occurred. ---> System.
Read more >
1e843f17a1ac273c62c13eb1ce9...
Details: 400 error, use a stronger password. Record your username and password to use to deploy your web apps. Create a resource group....
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