Reputation: 318
We have a project with included win32 dll as content file. This file (native32.dll) is copied to the output directory and imported at runtime. Visual studio compiles project without any problems, however TeamCity takes this .dll file (or any .dll file included in the project structure) and treats it as if it was a reference:
csc.exe <..> /reference:native32.dll <..>
Build fails with error:
CSC error CS0009: Metadata file 'native32.dll' could not be opened -- PE image doesn't contain managed metadata
How can this native32.dll be excluded from being referenced?
Upvotes: 4
Views: 1787
Reputation: 36287
You need to create a Class Library
and include the DLL in that library, together with the wrapper/interop classes. Then just reference the class library from your other project that wouldn't compile before.
Upvotes: 1