Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / April 2006

Tip: Looking for answers? Try searching our database.

Interop stops working with new version of COM library

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jon - 21 Apr 2006 20:48 GMT
We have customers developing custom applications with a .NET API we have
provided.  Internally, the API uses COM interop to talk to a legacy COM
interface.  The problem is that now we want to upgrade the COM library to the
latest version.  Ideally, we would like to do this without requiring the
customers to make changes to their existing applications.  I think this is
complicated by the fact that they redistribute the interop DLLs in each of
their applications, but there is a single instance of the COM interface,
registered globally on a given machine.

Our COM interface maintains a fixed set of dispatch IDs that do not change.  
Also, we only added methods and/or objects.  We did not remove objects or
methods, or change the signatures of the existing methods.

So why do the client apps stop working when we upgrade the COM library?  We
don't even get a versioning error.  The interop calls just don't do anything.
We are very puzzled.

There are several workarounds that I know of, but none of them are ideal...

1.  Make a new interop DLL and recompile the client applications.
2.  Add binding redirect info to the client config files to redirect calls
to a new interop DLL
3.  Provide a publisher policy file to do the redirect on a system-wide
basis.  The problem here is that the client applications redistribute the old
interop DLLs.  This complicates things because we have to make sure the
client applications can find the new interop DLL.

We must be missing something.  Does anyone have any ideas as to how we can
resolve this, and also how we can avoid these problems in the future?

Thanks so much.
catharticmomentusenet@yahoo.co.uk - 24 Apr 2006 10:18 GMT
This may be related to a problem I am currently investigating. In VS
.NET 2003, after a COM dll is updated, visual studio will automatically
create an updated interop dll next time a build is performed.

However visual studio does not increment the version number of the
interop dll. This means when windows installer looks at upgrading the
interop dll, it sees the version number has not changed, and does
nothing. The user is left with the old interop dll, and their
application crashes.

Chris
catharticmomentusenet@yahoo.co.uk - 24 Apr 2006 10:39 GMT
Ok - I've found the solution to our issue. When the COM component is
changed, you must not only increment the version number in the dll's
resources, but also the type library version number. After that, the
COM component must be re-imported into your .NET project.

Hope this helps.

Chris

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.