Microsoft posted a great article that included this (starting on pg.
40), entitled "Team Development with Visual Studio.NET and Visual
SourceSafe". You'll find a downloadable (Word) document at:

http://microsoft.com/downloads/release.asp?ReleaseID=35981

It's also available in MSDN; I'll leave the search up to you... :)

In particular, if these interop dlls are to be shared across projects,
you are strongly advised to either obtain a primary interop assembly, or
build a single (optionally, strongly named) interop assemblies, and
*not* rebuild the rcw each time.

John

-----Original Message-----
From: Moderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED]] On Behalf Of Philip Nelson
Sent: Tuesday, May 14, 2002 4:17 PM
To: [EMAIL PROTECTED]
Subject: [ADVANCED-DOTNET] Suggestions for VB COM object /.net interop
issues


At first I had the feeling the Microsoft had done a great job with COM
interop.  Run tlbimp and viola, slow but usable reuse of our "legacy"
code.  That was until the next time we recompiled the vb code, probably
the next day.

For the next month or so I just attributed the problems to lack of
understanding but now I am looking for help in understanding the issues.
What seems to happen is that either we get errors when running tlbimp
saying that various methods can't be found or after building, we will
get query interface errors when using the interop dlls.  In the first
case, it is almost always problems where VB has automatically registered
a typlib when it compiles.  If the project is running in project
compatibility, this situation is worse.  The second situation comes up
eveb when we compile in binary compatibility.  In that case, even when
VB sucessfully compiles without breaking compatibility, tlbimp is
successful, but some methods when executed through the interop dll get
query interface errors.  Our best theory is that the interop dlls have
disp ids in the metadata and that vb will reassign these at will, but
sometimes even changes within a method seem to have this problem.

I guess what I am hoping to find is a some best practices to follow when
compiling VB com objects and then building the interop dlls including
when to register and unregister dlls, compile, tips for tlbimp etc. that
result in a reliable build process.  We have an automated build process
for everything but the vb build so once we figure it out, we can
reproduce it easily.

Thanks in advance.

__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

You can read messages from the Advanced DOTNET archive, unsubscribe from
Advanced DOTNET, or subscribe to other DevelopMentor lists at
http://discuss.develop.com.

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to