Search code examples
c#cakebuild

How to use COM Interop references in Cake?


We have a some project with the COM Interop references (is static linked to the project). I created the cake-build script with the reference to this DLL. On the processing:

Task("Build").Does(()=>
{
    NuGetRestore(solutionFile);
    MSBuild(solutionFile);
});

build script has error that my DLL library has a wrong format. Does cake support the COM references? Maybe I need to do something?

Upd. When I build script without references to COM dll, the compiler throws error CS0246 that classes from this DLL doesn't found and that I missing the reference to it.


Solution

  • Problem was when we do a build as 'Any CPU'. Changed to 'x86' and dependencies been resolved (Microsoft.VisualBasic.Compatibility.VB6)