Suppress tlbimp warnings in visual studio

In a Visual Studio C # project, you can add links to COM libraries. Visual Studio will then use tlbimp.exe to create an interaction assembly when creating the project. The link looks like this in a .csproj file:

  <ItemGroup>
    <COMReference Include="TDAPIOLELib">
      <Guid>{F645BD06-E1B4-4E6A-82FB-E97D027FD456}</Guid>
      <VersionMajor>1</VersionMajor>
      <VersionMinor>0</VersionMinor>
      <Lcid>0</Lcid>
      <WrapperTool>tlbimp</WrapperTool>
      <Isolated>False</Isolated>
    </COMReference>
  </ItemGroup>

However, a library like 3rdparty, which I import, calls tlbimp to give some warnings. How to suppress these warnings in visual studio? I tried changing the wrapper tool to

  <WrapperTool>tlbimp /silent</WrapperTool>

but it makes the visual studio complain about

An error has been encountered that "TDAPIOLELib" from loading. The tlbimp / silent wrapper tool is not a valid wrapper tool.

+3
2

BeforeBuild tlbimp.exe:

  <Target Name="BeforeBuild">
     <Exec Command="tlbimp /silent ..\3rdparty\comlibrary.dll /out:..\bin\interop.comlibrary.dll" />
  </Target>

interop.comlibrary.dll, .

+2

COM- COM-, typelib , interop . COM-, , , , COM- .

+4

Source: https://habr.com/ru/post/1709200/


All Articles