1

I have a VB .NET project with the msbuild task RegisterForComInterop.

This, expectedly, throws the warning

Type library "....tlb" is not registered, cannot unregister.

when building the solution the first time (and when doing a TFS team build).

I'm trying to eliminate warnings (and have a no warning policy) in the solution to improve code quality.

How can I tell msbuild to ignore this warning? It's an msbuild warning, not a compiler warning, so I can't just use the NoWarn tag in the vbproj...

Jeff
  • 35,755
  • 15
  • 108
  • 220
  • 1
    Registering assemblies on a build server isn't exactly good practice. You probably already have a heavily polluted registry, filled with dead TypeLib and CLSID keys. – Hans Passant Sep 02 '12 at 19:55
  • Yes, but the immediate next part of the build process is to build a VB6 project that references that tlb generated by the .NET project. Would you suggest a different approach? – Jeff Sep 02 '12 at 20:05
  • 1
    Run Regasm.exe yourself so you can register and unregister the assembly as needed. – Hans Passant Sep 02 '12 at 20:09
  • Fair enough...but isn't that the exact same thing the task does? http://stackoverflow.com/questions/3534600/what-does-register-for-com-interop-actually-do – Jeff Sep 03 '12 at 05:55
  • 1
    Well, no, the task doesn't unregister assemblies. And complains when it looks like you're doing something wrong. Turns out it was accurate. Your build server is also polluting the registry of all machines on which the code is being tested. I'm guessing you are changing the [AssemblyVersion] on every build. – Hans Passant Sep 03 '12 at 06:11
  • Do you have a suggestion on how to unregister all previous versions of the assembly? – Jeff Sep 03 '12 at 20:09
  • No, that's too late. You don't have the guids anymore. I never recommend registry cleaning tools. – Hans Passant Sep 03 '12 at 20:12

0 Answers0