Having issues since recently upgrading to the latest SDK and runtime. When building a simple console app in Visual Studio (Version 16.7.0 Preview 2.0) I get an exception.
However using the basic "dotnet" command line works for building\running. Also, compiling runtime repo source code projects within Visual Studio works fine.
I found that uninstalling the latest SDK ( 5.0.100-preview.7.20318.2) and installing an older version (5.0.100-preview.6.20314.3) works for me.
Severity Code Description Project File Line Suppression State
Error MSB4018 The "CreateAppHost" task failed unexpectedly.
System.IO.FileLoadException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)
File name: 'System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.Security.SecurityException: Strong name validation failed. (Exception from HRESULT: 0x8013141A)
The Zone of the assembly that failed was:
MyComputer
at Microsoft.NET.HostModel.AppHost.MachOUtils.RemoveSignature(String filePath)
at Microsoft.NET.HostModel.AppHost.HostWriter.<>c__DisplayClass2_0.<CreateAppHost>g__RemoveSignatureIfMachO|2()
at Microsoft.NET.HostModel.RetryUtil.RetryOnIOError(Action func)
at Microsoft.NET.HostModel.AppHost.HostWriter.CreateAppHost(String appHostSourceFilePath, String appHostDestinationFilePath, String appBinaryFilePath, Boolean windowsGraphicalUserInterface, String assemblyToCopyResorcesFrom)
at Microsoft.NET.Build.Tasks.CreateAppHost.ExecuteCore()
at Microsoft.NET.Build.Tasks.TaskBase.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
-->
Configuration
.NET SDK (reflecting any global.json):
Version: 5.0.100-preview.7.20318.2
Commit: 00203a3818
Runtime Environment:
OS Name: Windows
OS Version: 10.0.18363
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.100-preview.7.20318.2\
Host (useful for support):
Version: 5.0.0-preview.7.20317.2
Commit: fa7c99d6b2
.NET SDKs installed:
5.0.100-preview.7.20318.2 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.0-preview.7.20311.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.0-preview.7.20317.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 5.0.0-preview.7.20311.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Having issues since recently upgrading to the latest SDK and runtime. When building a simple console app in Visual Studio (Version 16.7.0 Preview 2.0) I get an exception.
However using the basic "dotnet" command line works for building\running. Also, compiling runtime repo source code projects within Visual Studio works fine.
I found that uninstalling the latest SDK (
5.0.100-preview.7.20318.2) and installing an older version (5.0.100-preview.6.20314.3) works for me.Configuration