.NET 6: The "CreateAppHost" task failed unexpectedly.
See original GitHub issueError 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
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:24 (15 by maintainers)
Top 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 >MSB4018: The task failed unexpectedly - Microsoft Q&A
Hello I have a problem in VS 2022 .net 6. The problem is: MSB4018: The task failed unexpectedly in Microsoft.Net.Sdk.targets line 554
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 >Project cant be builded
Hello, i cant build my c# winforms project. it shows this error: Error MSB4018 the "CreateAppHost" task failed unexpectedly. Microsoft.NET.
Read more >MSBuild forum - RSSing.com
Error MSB4018 The "CreateAppHost" task failed unexpectedly. Microsoft.NET.HostModel.HResultException: 80070013 at Microsoft.NET.HostModel.AppHost.
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
@rseanhall I unlocked it. Looks like that happened because the bot locked it when it was closed but didn’t unlock when it was reopened. I’ll follow up with the bot owner on that behavior.
@ericstj I found what I think is the latest build from this page: https://github.com/dotnet/installer#installers-and-binaries dotnet-sdk-6.0.100-preview.3.21123.4-win-x64 Getting different errors now at least which is unrelated to this issue.