When I started my new project (.net 5.0
), I used to script the build using the dotnet CLI: dotnet build
Everything worked well until I recently had to add a COM reference to the project:
(I am not very used to the way this COM stuff works, so forgive me if I misunderstand something and do not hesitate to provide detailed information in your answers)
This addition causes the build with the dotnet CLI to fail:
MSB4803: The task “ResolveComReference” is not supported on the .NET Core version of MSBuild. Please use the .NET Framework version of MSBuild.
I don't really understand this error since I am using .NET 5
(I checked with dotnet --version
) and not .NET Core
but I guess it's just a remainder from the previous versions of ".NET".
Since the build from Visual Studio works fine, and according to the error message, I switched my automated scripts to use MSBuild
and everything works fine again.
But I was wondering if it was still possible to use the dotnet CLI
?
I tried to used the msbuild argument of the dotnet CLI
, but with the same result:
ResolveComReference