I have a C# desktop application that references the COM object Microsoft OLE DB Service Component 1.0 Type Library
. This is the dialog that allows the user to build and test a connection string. The code has worked as expected for several years.
I find that when a "Rebuild" is performed that there are 18 unenumerated warnings that appear. I believe this means the warnings are created when the Type Library is imported.
They are all forms of:
Processing COM reference "MSDASC" from path "C:\Program Files (x86)\Common Files\System\Ole DB\oledb32.dll". The type library importer could not convert the signature for the member 'tagDBPROPIDSET.rgPropertyIDs'.
Processing COM reference "MSDASC" from path "C:\Program Files (x86)\Common Files\System\Ole DB\oledb32.dll". At least one of the arguments for 'DataLinks.RemoteCreateDBInstanceEx' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Striping this down, I find that just adding the reference to an empty WinForms project will generate the warnings. No code accessing the MSDASC library is required.
As a workaround, I copied the Interop.MSDASC.dll
from the OBJ tree that was generated during the rebuild, and copied it to the project folder. I removed the reference to MSDASC
and added one to the Interop.MSDASC.dll
in my project.
Now when I rebuild I do not see the warnings. I deleted the Interop.MSDASC.dll
from the OBJ tree and it does get recreated.
Did this just mask my problem? Is there a better way to use the dialog and suppress or answer the warnings?
Update: This happens in VS 2017 & 2019, but I believe it happened in previous versions as well.
Added image of Error List window: