error : MSB4803: The task "ResolveComReference" is not supported on the .NET Core version of MSBuild

Viewed 13973

I have made a project in VS2019. I have the same project in .NET Core and .NET Framework. I use a COM reference in my project. I would like to migrate these projects to Pi4. A simple Hello World project (.NET Core) is running successfully on the Pi4 machine. However, when I try to run my project (.NET core or .NET Framework) it does not run on the Pi4. It says COM is not supported.

I tried to build the project using MSBuild in my Windows environment after looking for solutions in Google. I also see a similar error here. The error is: error : MSB4803: The task "ResolveComReference" is not supported on the .NET Core version of MSBuild. Please use the .NET Framework version of MSBuild.

The .NET Framework project also gives a similar error. error MSB4028: The "ResolveComReference" task's outputs could not be retrieved from the "ResolvedFiles" parameter. Object does not match target type.

Does anyone have similar issues?

2 Answers

Set the Projects to x86 for them to build the Interop, the Interop created still could not be used in x64 runtimes.

Add the COM Reference to the Core project, Build it and you will get an Interop.YourCom in the bin/x86/core/debug folder.

Remove the COM reference, and re-add the Interop, it will be put into the Assemblies Dependencies, and MSBuild will work.

My MSB4803 was from a WIXInstaller project, for ADOX, and Microsoft.Office.Interop.Access.Dao

Related