0

Regardless of the type of project I tried, I got the following error when building:

The "CreateAppHost" task failed unexpectedly.
System.FormatException: Input String was not in a correct format.

This error refers to the file Microsoft.NET.Sdk.targets and the following section:

<CreateAppHost AppHostSourcePath="$(AppHostSourcePath)"
               AppHostDestinationPath="$(AppHostIntermediatePath)"
               AppBinaryName="$(AssemblyName)$(TargetExt)"
               IntermediateAssembly="@(IntermediateAssembly->'%(FullPath)')"
               WindowsGraphicalUserInterface="$(_UseWindowsGraphicalUserInterface)"
               Retries="$(CopyRetryCount)"
               RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
               />

I tried to target .NET 6.0 and .NET 7.0 with the same result.
I updated Visual Studio for Mac to the latest version 17.4.2 with the same result.

I tried to remove all the .NET SDKs/runtimes and reinstall Visual Studio with the same result.

Update 2023-01-25
I launched a project that was not working today and it started. After closing Visual Studio or going to another project, the same project again didn't work and worked again only by restarting the OS...

I added the project that worked then generating the error again on GitHub if it can help resolve the issue :

VS project demo

Any idea why this is happening?
Could it be related to the version of macOS? I have macOS Catalina Version 10.15.7.

krlzlx
  • 5,752
  • 14
  • 47
  • 55

0 Answers0