I'm working on a .net core web app (targeting net461). The app needs to reference a COM dll.
I added the COM reference and the app still builds on my dev machine. However, on the build server it fails to build with this error:
C:\Program Files (x86)\dotnet\sdk\2.0.0\Microsoft.Common.CurrentVersion.targets(2604,5): error MSB4062: The "Microsoft.Build.Tasks.ResolveComReference" task could not be loaded from the assembly Microsoft.Build.Tasks.Core
After searching a bit, it seems like it's a pretty uncommon error. Anyone know what the error is and/or how to fix it?
UPDATE: Seems like the dotnet CLI does not support COM references. Visual Studio uses msbuild directly behind the scenes, but on the build server, I was using the dotnet CLI commands.
WORKAROUND:
It should also fail on developer machine if you try to build it using the same command as on build server, e.g.
dotnet.exe build Solution.sln --configuration Release --no-incremental
VS building solution using msbuild, it's a different way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With