Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with: System.Runtime.InteropServices.COMException

Status
Not open for further replies.

aalmeida

MIS
Aug 31, 2000
468
US
System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {58968145-CF05-4341-995F-2EE093F6ABA3} failed due to the following error: 80040154.
I made a program with Visual C# 2008. There are 2 forms in the program. The program works well in my laptop. However, when I install the program in another computer which does not have Visual C# 2008, the error message was shown.
I encountered this error message when I try to open another form(form2) from my main form(form1).
This is the code give me the error.

Code:
private void adicionar_Click(object sender, EventArgs e)
        {
            frm2 = new Acquire(this.Name);
            frm2.Show();
            this.Hide();
        }
I’m not sure what could be missing here.


AL Almeida
CIO
May all those that come behind us, find us faithful.
 
Jason,

the post you sent seem to indicate that one DLL has not been registered correctly, I had an imported DLL (DSOFile.dll) so I went ahead and manually registered it, it was located in the folder created by the installation process, and the error went away. Thanks for the tips.
Now how can I make it so that my deployment project registers the imported DLL during the installation process?

AL Almeida
CIO
May all those that come behind us, find us faithful.
 
what do you mean by register?
I use xcopy deployments for simplicity. that is copy and paste. Any 3rd party assemblies my system requires which are not part of the .net framework are copied to the local directory of the application. it's automatically detected by the framework when loading dependencies.

I prefer the local dependency over the GAC dependency because multiple project may depend on varying versions of a given 3rd party assembly. I find the GAC is also cumbersome to manage.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
 
Jason!

To manually register the 3rd party Dll I had to do this:
Go to the Run item on the Start menu, and type:
regsvr32 <path & filename of dll or ocx>

I'm using a VS2008 C# Deployment project which detected the 3rd party dll and copied it to the folder, but after the installation completed on the clients machine the 3rd party DLL was not registered, hence my question: How can I assure that it will register when the client performs the installation themselves from a CD?

AL Almeida
CIO
May all those that come behind us, find us faithful.
 
regsvr relates to the GAC. I haven't used deployment projects. I prefer xcopy as it's very simple. no registry or installation just copy and paste. you could do this on the cd as well with an auto execute script. There are also 3rd party tools to create installation packages. I don't have any experience with them. This may be a better route than trying to build the deployment package from scratch.

if you stick with rolling your own install package. you could use the pre or post install events to run the regsvr for you. I'm sure there is a successful installation hook. This is where I would put the register assembly script.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
 
DSO is a COM in-proc component. I thought this DLL comes pre-installed on windows. Anyway, try reading some info about its dependencies.

You can include it in your MSI project, assuming you already have all its dependent components. There you should find a property that allows you to properly register a file as COM component (forgot the property name).

Note that you will need the DSOfile.dll (activex) and any dependent components if any, and the .net interop assembly (e.g. dsofile.interop.dll) included in your deployment project.

hth
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top