473,839 Members | 1,454 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exception: Retrieving the COM class factory for component with CLSID {}

Frinavale
9,735 Recognized Expert Moderator Expert
Hi guys,

I've created a VB.Net project and have compiled it, run it, tested it on a machine that has a 32bit processor. I am now trying to move this project onto a 64bit processor server that is running IIS6.

The project works wonderfully until it tries to access a DLL that is essential to the project. At that time I am getting the following error:

Exception: Retrieving the COM class factory for component with CLSID{...}

I have registered the DLL on the server.

After searching the web I've found to possible causes to the error but I don't know how to get around them.

The first possible cause is that the ASPNET user doesn't have the privialges to access this dll. I have no idea how to set the permissions for a registered dll.

The second is that the 64bit environment will not run my 32bit DLL. Is there a way around this problem?

Thanks in advance!
-Frinny
Feb 6 '07 #1
11 5395
Motoma
3,237 Recognized Expert Specialist
Hi guys,

I've created a VB.Net project and have compiled it, run it, tested it on a machine that has a 32bit processor. I am now trying to move this project onto a 64bit processor server that is running IIS6.

The project works wonderfully until it tries to access a DLL that is essential to the project. At that time I am getting the following error:

Exception: Retrieving the COM class factory for component with CLSID{...}

I have registered the DLL on the server.

After searching the web I've found to possible causes to the error but I don't know how to get around them.

The first possible cause is that the ASPNET user doesn't have the privialges to access this dll. I have no idea how to set the permissions for a registered dll.

The second is that the 64bit environment will not run my 32bit DLL. Is there a way around this problem?

Thanks in advance!
-Frinny

I ran into a similar problem once, and the error was solved by simply including the DLL in the references.

In the (very) unlikely case that the 64bit environment cannot load the 32bit DLL, Visual Studio has an option to specify the target architecture. I have never run into a circumstance where this is needed, however.

Is this a COM DLL or a .NET DLL? You may need to open up the Component Services and adjust permissions and execution security there.

Sorry, I'm not connected to our network right now, so I can't give more elaborate instructions, hopefully someone else catches where I am going and can provide the exact names, paths, and tabs you need to click :P
Feb 6 '07 #2
Frinavale
9,735 Recognized Expert Moderator Expert
I ran into a similar problem once, and the error was solved by simply including the DLL in the references.

In the (very) unlikely case that the 64bit environment cannot load the 32bit DLL, Visual Studio has an option to specify the target architecture. I have never run into a circumstance where this is needed, however.

Is this a COM DLL or a .NET DLL? You may need to open up the Component Services and adjust permissions and execution security there.

Sorry, I'm not connected to our network right now, so I can't give more elaborate instructions, hopefully someone else catches where I am going and can provide the exact names, paths, and tabs you need to click :P
By including the DLL in the references, do you mean in the project itself?
The reference has already been included in the project and the project has been compiled on the 32bit machine with this DLL referenced.

It is a COM DLL. I'm not sure what a Component Service. I'll try looking this up.

Thanks for your help!

-Frinny
Feb 7 '07 #3
Frinavale
9,735 Recognized Expert Moderator Expert
By including the DLL in the references, do you mean in the project itself?
The reference has already been included in the project and the project has been compiled on the 32bit machine with this DLL referenced.

It is a COM DLL. I'm not sure what a Component Service. I'll try looking this up.

Thanks for your help!

-Frinny

Ok I'm an idiot sometimes. I don't know why I said I didn't know what a Component Service was...I guess I was just having one of those brain blocks...its that utility in Windows that I've only used a couple of times in my life so far.

I tried to use the Component Service to set the permissions on my DLL yesterday but my DLL isn't listed there. Do you know how to make it show up?

I've looked for it in both the COM+ Applications, and the DCOM Config...could it possibly be somewhere else?

I also tried going directly into the registration and setting the permissions directly on the DLL. This didn't help.

Sorry for the temporary idiocy (at least I hope it was temporary hehe)

-Frinny
Feb 7 '07 #4
Motoma
3,237 Recognized Expert Specialist
Ok I'm an idiot sometimes. I don't know why I said I didn't know what a Component Service was...I guess I was just having one of those brain blocks...its that utility in Windows that I've only used a couple of times in my life so far.

I tried to use the Component Service to set the permissions on my DLL yesterday but my DLL isn't listed there. Do you know how to make it show up?

I've looked for it in both the COM+ Applications, and the DCOM Config...could it possibly be somewhere else?

I also tried going directly into the registration and setting the permissions directly on the DLL. This didn't help.

Sorry for the temporary idiocy (at least I hope it was temporary hehe)

-Frinny
The way I usually do it, is open Component Servies > My Computer > COM+ Applications, then right click on COM+ Applications and go New > Applicaiton.
Do an Empty application, type a name, set the options, and hit finish.
Select the application under the COM+ Applications from the left pane, and then select Components. Then drag and drop the DLL there. Now you will be able to fool with the properties of your DLL.
I'm sure there are other (better) ways of doing it, but I don't know of those ways.
Feb 7 '07 #5
Frinavale
9,735 Recognized Expert Moderator Expert
Hi there!

I still haven't solved this problem yet but at least now I have a good idea of what is wrong.

I guess I should have mentioned in my first post that the project is a .NET web application that uses a COM DLL as a reference to do some important processing.

Anyways, using Depends.exe (that comes with Visual Studio) I was able to determine that the DLL has some components missing but also (more importantly) that it has been compiled for a 32bit OS.

Since the OS I'm moving the application to is 64bit there are conflicts. I think that if I am able to compile the web-application targeting a 64bit platform I'll be able to solve my problem (hopefully!).

All of my attempts at registering the DLL in the SysWOW64 were in vein because when I deploy the web application from my 32bit machine it moves the whole assembly over and uses its own personal DLLs located in its "bin" folder. It never even looks to see what is installed on the server.

My question now is, how do I compile the web-application targeting the 64bit platform?

I've been trying to find the answer online but every time I think I've found help they step me through menus that don't exist.

Does anyone know how to do this?

Thanks a lot for your help

-Frinny
Feb 9 '07 #6
Motoma
3,237 Recognized Expert Specialist
Hi there!

I still haven't solved this problem yet but at least now I have a good idea of what is wrong.

I guess I should have mentioned in my first post that the project is a .NET web application that uses a COM DLL as a reference to do some important processing.

Anyways, using Depends.exe (that comes with Visual Studio) I was able to determine that the DLL has some components missing but also (more importantly) that it has been compiled for a 32bit OS.

Since the OS I'm moving the application to is 64bit there are conflicts. I think that if I am able to compile the web-application targeting a 64bit platform I'll be able to solve my problem (hopefully!).

All of my attempts at registering the DLL in the SysWOW64 were in vein because when I deploy the web application from my 32bit machine it moves the whole assembly over and uses its own personal DLLs located in its "bin" folder. It never even looks to see what is installed on the server.

My question now is, how do I compile the web-application targeting the 64bit platform?

I've been trying to find the answer online but every time I think I've found help they step me through menus that don't exist.

Does anyone know how to do this?

Thanks a lot for your help

-Frinny
Doing this in VB.NET, there are no "target architectures;" everything is build for the .NET framework. If you are certain that the issue is being unable to load the 32 bit DLL, then you will need to recompile the DLL.
What 64 bit architecture is the machines you are having problems with? I know that the x64 supports the x86 instruction set, and have never had an issue with this on my machine. Windows x64 systems are usually able to run all 32 bit applications using the WOW64 subsystem.
I have no idea what support IA64 has for 32 bit systems, but I would assume there is a similar way of handling things there.
Feb 9 '07 #7
Frinavale
9,735 Recognized Expert Moderator Expert
Doing this in VB.NET, there are no "target architectures;" everything is build for the .NET framework. If you are certain that the issue is being unable to load the 32 bit DLL, then you will need to recompile the DLL.
What 64 bit architecture is the machines you are having problems with? I know that the x64 supports the x86 instruction set, and have never had an issue with this on my machine. Windows x64 systems are usually able to run all 32 bit applications using the WOW64 subsystem.
I have no idea what support IA64 has for 32 bit systems, but I would assume there is a similar way of handling things there.
The server is running Windows Server 2003 Standard x64 Edition with IIS6.
Do I have to put my project into a special folder for it to run using the WOW64 subsystem? I can't really move it off of the IIS....

When I registered the DLL I had to place it into the SysWOW64 in order to do so, but l application is ignoring the registered DLL.

When I load the DLL the web-application is using in the Depends.exe I get the following errors:
" Error: Modules with different CPU types were found.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has unresolved import due to a missing export function in a delay-load dependent module."

The missing DLL is: DWMAPI.DLL

The COM object that's causing all the problems has been developed using VB6 and I'm not sure that it will be able to be recompiled targeting a 64bit platform.

Thanks so much for your help.
-Frinny
Feb 9 '07 #8
Motoma
3,237 Recognized Expert Specialist
The server is running Windows Server 2003 Standard x64 Edition with IIS6.
Do I have to put my project into a special folder for it to run using the WOW64 subsystem? I can't really move it off of the IIS....

When I registered the DLL I had to place it into the SysWOW64 in order to do so, but l application is ignoring the registered DLL.

When I load the DLL the web-application is using in the Depends.exe I get the following errors:
" Error: Modules with different CPU types were found.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has unresolved import due to a missing export function in a delay-load dependent module."

The missing DLL is: DWMAPI.DLL

The COM object that's causing all the problems has been developed using VB6 and I'm not sure that it will be able to be recompiled targeting a 64bit platform.

Thanks so much for your help.
-Frinny
I had not used Depends.exe until just now, however, when I launched it with three DLLs located in it's own directory, I recieved the same messages on two of them:
DWMAPI.DLL: Error Opening File. The system cannot find the file specified (2).
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has unresolved import due to a missing export function in a delay-load dependent module."
This leads me to believe that this is not the source of your problem.

What you could do is create a small test program to load up your DLL and call one of it's functions. In C# you would do this like so:

Expand|Select|Wrap|Line Numbers
  1. Using System.Runtime.InteropServices;
  2.  
  3.  
  4. public class myclass
  5. {
  6.     [DllImport("crapapp.dll")] 
  7.     public static extern int intReturningFunctionFromDLL(int arg1, string arg2);
  8.  
  9.     static void main()
  10.     {
  11.         if(intReturningFunctionFromDLL(5, "toasty")) Console.WriteLine("Success");
  12.         else Console.WriteLine("Success as well!");
  13.     }
  14. }
  15.  
  16.  
P.S. My code is guarenteed not to work, it is just meant to be an example/a guide/some crap pseudo code.
Feb 9 '07 #9
Frinavale
9,735 Recognized Expert Moderator Expert
I had not used Depends.exe until just now, however, when I launched it with three DLLs located in it's own directory, I recieved the same messages on two of them:

This leads me to believe that this is not the source of your problem.

What you could do is create a small test program to load up your DLL and call one of it's functions. In C# you would do this like so:
...

P.S. My code is guarenteed not to work, it is just meant to be an example/a guide/some crap pseudo code.
I created a test windows application which uses the DLL that has been registered on the computer (in the SysWOW64 folder).

It runs fine.

The web-application still does not work despite the fact that I have changed IIS to run 32-bit applications on the 64-bit server.

I found out how to do this at this site. This site mentions that if the 32-bit problems still persist to check to see if the application needs to reference the %windir%\syswow 64\inetsrv to resolve the problem.

I'm sure that I need to do this step because the DLL is working fine in the test windows application.... and the web-application's version is not working.

Does anyone know how to change the application so that it references this directory?

Thanks a lot

-Frinny
Feb 9 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

0
3684
by: mihironline | last post by:
We have a scheduled job, which runs at every 5 min. As first step of this job, we are executing a stored proc. Inside stored proc, we have following line of code insert #exeResult EXEC master..xp_cmdshell @cmd -- where @cmd is an exe
3
16268
by: Harish | last post by:
I am buiding an application in ASP.Net 2.0 with C#. After installing corel wordperfect i am adding the reference into the application. Afetr adding reference interop.wordperfect.dll is added to the Bin folder. After creating the object of Wordperfect.Perfectscript i am opening the wordperfect file and then run the wordperfect macro. In development version the application is running without any error. If i publish the website on local...
0
1967
by: orieni | last post by:
Hi, I have writen a code to take snapshot of Internet Explorer. The code works fine when run in the debug mode. But once I publish the site I get the following error for: Retrieving the COM class factory for component with CLSID {9BA05972-F6A8-11CF-A442-00A0C90A8F39} failed due to the following error:
0
2657
by: Olman Quesada | last post by:
Hi everybody, I'm trying to access a TLB in a VB.Net 2005 project. The TLB file is located under c:\windows\system32 directory. However, when a try to instanciate a variable whose type is declared in such TLB I got the following exception:
1
7907
Frinavale
by: Frinavale | last post by:
Hi there :) I've finally moved my Online Registration project on to the box where it will be hosted. This new server is running IIS6. After moving the project to the new server and running through it to make sure every thing's working I ran into the following error: Exception: Retrieving the COM class factory for component with CLSID {63EA957E-1FFE-41D5-940E-AF431279FB19} failed due to the following error: 80040154.
3
14512
by: =?Utf-8?B?Tmljaw==?= | last post by:
Hi all, i have a web application and one of the function is to generate a word document by button click. it works fine in debug mode when i run this web application. But after i deploy to my local IIS server, it always show this error when i click the button which trying to generate a word document. Error msg:
9
46787
by: =?Utf-8?B?QmFkaXM=?= | last post by:
Hi, I'm using automation and it's working fine when I run it from my local machine. but if I try to access it from another machine it's giving me this Error: Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005.
4
5475
by: =?Utf-8?B?QmFkaXM=?= | last post by:
Hi, I'm using automation and it's working fine when I run it from my local machine. but if I try to access it from another machine it's giving me this Error: Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005.
0
2974
by: Shailesh Patel | last post by:
Hi, I get the following error. Retrieving the COM class factory for component with CLSID {F84433FF-2369-4427-B6FB-3CBA67EDA7EB} failed due to the following error: 80040154 ASP.NET(VB.NET) website was working fine with COM components. But when I updated COM and referanced it again, I got error on website.
0
9855
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10586
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10293
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9426
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7828
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5866
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4484
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4064
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3134
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.