When building a .net core application that attempts to uses dotfuscator we can successful build and obfuscate using msbuild.exe however any build or publish using the .net core cli fails.
These issue exist using a local command line and also in our devops build pipelines.
examples
msbuild.exe "the project file.csproj" <- this works and engages dotfuscator
dotnet build "the project file.csproj" <- this throws the error below.
dotnet publish "the project file.csproj" <- also throws the error below.
D:\Repos\PF\tools\dotfuscator\PreEmptive.Dotfuscator.Common.targets(262,5): error MSB4062: The "FindProjectAssemblies" task could not be loaded from the assembly D:\Repos\PF\tools\dotfuscator\PreEmptive.Dotfuscator.Internal.Tasks.dll. Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [D:\Repos\PF\source\xxxxx.xxxxx.xxxxx.API\xxxxx.xxxxxx.xxxxxx.API.csproj]
Looks very much like this issue. https://github.com/Microsoft/msbuild/issues/2111