Closed 0xced closed 2 years ago
So, the TaskRunner is a .NET Framework 4.7.2 exe with Prefer32Bit=true and it tries to load C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\tools\net6.0\Microsoft.NET.Build.Tasks.dll
with Assembly.LoadFrom(assemblyFilePath)
and this is where the System.BadImageFormatException
occurs.
Next step is trying to multi-target the TaskRunner as net472
+ net6.0
and see what happens.
That's it, the .NET 6 TaskRunner executable works fine when loading C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\tools\net6.0\Microsoft.NET.Build.Tasks.dll
. 😃
Now I guess the challenge of multi-targeting the TaskRunner is how to determine which version should be launched to debug an MSBuild task!
Yup, see related #403
Thanks for investigating this!
Here's the error I'm getting when I try to debug a task:
This error happens with both the latest version (2.1.561) and a freshly compiled version from the main branch (commit ddea3ae1d287ad199cc08b2d7465ba12af57ebfd).
The project that I'm trying to debug is built for .NET 6.
I'm currently trying to figure out why this is happening…