# Sunday, November 07, 2004
« Exony Blogging Policy | Main | Halo 2 »

The primary reason for writing this article is I've managed to make exactly the same mistake on two separate occasions. A third time would be careless...

For this particular recipe you need:

  • A .NET application that uses COM interop (any should do but I'm using SQLServer DSO)
  • A Visual Studio installer project

First add the output of your COM interop project to the installer project and, as if my magic, the COM DLL that your interop is using will be added to the installer. Next build your solution and install your new application. Then spend a couple of hours trying to work out why nothing works and you get strange error messages like "Could not find msmdso.rll" whenever the COM object is instantiated. This is especially difficult if your application happens to be running as a service and COM DLL displays the message in a message box (hint: listen for the unmistakable "ding" of the message box sound).

What has happened? Well when the COM DLL was automatically detected and added to the installer project it was flagged as "vsdrfCOMSelfReg" which causes the new copy of the DLL to registered at install time zapping the original COM registration. As for the message box, nothing you can do if it's DSO like mine unless you happen to work for Microsoft.

For some reason setting the flag back to "vsdrfDoNotRegister" still causes issues and the best approach is to set the "Exclude" property to true and completely remove the DLL from the installer.

One last tip. If you manage to do this with DSO then you can avoid reinstalling Analysis Server by executing the following:

cd "C:\Program Files\Common Files\Microsoft Shared\DSO"
for %i in (*.dll) do regsvr32 %i
by This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Sunday, November 07, 2004 7:44:14 PM (GMT Standard Time, UTC+00:00)  #    Comments [2] Trackback
Related posts:
Testing Windows Forms Applications
Messing around with the Insert Code plug-in
Link Dump
Debugging FullTrust VSTO InfoPath Forms
Which version of the .NET Framework does Excel load?
Missing content from XmlSerializer output
Thursday, July 14, 2005 7:36:28 AM (GMT Daylight Time, UTC+01:00)
I've been having this problem with COMStandard.dll. I am creating a program that I want to use a DLL that is already registered by the Palm application. The wierd thing is, I had it working at one time. I'm too tired to type anymore...
J Cisneros
Thursday, July 14, 2005 8:55:53 AM (GMT Daylight Time, UTC+01:00)
When you add the DLL to your installer project, just ensure you set the "Exclude" property to true to ensure you don't try and reinstall the DLL.
Comments are closed.