1

How to reference VB 6.0 component(.dll) with C# in Visual Studio .NET 2005

After I referenced this DLL file, I can see the new icon in the reference folder icon in solution explorer. But this new icon has "!" sybbol. I double clicked this new icon that said "This project cannot be viewed in the object browser because it is unavailable or not yet built. Please ensure that the projects is available and built."

0

3 Answers 3

5

Just add the reference and Visual Studio will create a wrapper (Interop) assembly for you.

If you want more control over the creation of this assembly (like the name, the signing), do this at the command line using tlbimp.exe

example:

tlbimp.exe MyCOMDLL.dll /keyfile:KeyFile.snk /out:MyCOMInterop.dll
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for your help. I try to do this way but can't make transition successfully.
4

Try adding it as a reference to your project. Visual studio will add a wrapper to it and you should be able to use the code?

It depends what the component is though?

Comments

0

After I referenced this DLL file, I can see the new icon in the reference folder icon in solution explorer. But this new icon has "!" sybbol. I double clicked this new icon that said "This project cannot be viewed in the object browser because it is unavailable or not yet built. Please ensure that the projects is available and built."

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.