Skip to content

.NET 6: The "CreateAppHost" task failed unexpectedly. #15225

@JamesNK

Description

@JamesNK

Error when building.

error MSB4018: The "CreateAppHost" task failed unexpectedly.
error MSB4018: System.IO.FileLoadException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)
error MSB4018: File name: 'System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.Security.SecurityException: Strong name validation failed. (Exception from HRESULT: 0x8013141A)
error MSB4018: The Zone of the assembly that failed was:
error MSB4018: MyComputer
error MSB4018:    at Microsoft.NET.HostModel.AppHost.MachOUtils.RemoveSignature(String filePath)
error MSB4018:    at Microsoft.NET.HostModel.AppHost.HostWriter.<>c__DisplayClass2_0.<CreateAppHost>g__RemoveSignatureIfMachO|2()
error MSB4018:    at Microsoft.NET.HostModel.RetryUtil.RetryOnIOError(Action func)
error MSB4018:    at Microsoft.NET.HostModel.AppHost.HostWriter.CreateAppHost(String appHostSourceFilePath, String appHostDestinationFilePath, String appBinaryFilePath, Boolean windowsGraphicalUserInterface, String assemblyToCopyResorcesFrom)
error MSB4018:    at Microsoft.NET.Build.Tasks.CreateAppHost.ExecuteCore()
error MSB4018:    at Microsoft.NET.Build.Tasks.TaskBase.Execute()
error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
error MSB4018: 
error MSB4018:

VS: 2019 16.9 Preview 2
.NET SDK: 6.0.100-alpha.1.21057.4

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions