问题
I have created a dll in Visual Studios 2010. I have performed the following steps:
Given build a strong name by associating a key pair (snk file) to it
Given each class an individual ProgID and GUID
As it is a 64 bit DLL I made sure that Used the RegAsm.exe located in the 'FrameWork64/v4xxxx' folder. I used RegAsm.exe /codebase ECE2.dll
I ran 'gacutil -i' on the DLL
All of these steps have been successful. The DLL and the ASP page I am using it on are stored in intetpub/wwwroot.
Now, the DLL works fine on my laptop and home computer (both running Windows 7 Ultimate). I am now trying to get it to work on Windows Server 2008 R2. This is where I'm having the problem.
I complete the same steps as above, all of which are successful. However when I run the ASP page, I'm getting an error message which would suggest it has NOT been registered, even though it has:
Microsoft VBScript runtime error '800a01ad' ActiveX component can't create object: 'ECE2.CSV_DataSet'
I thought it might be a setting in IIS which needs changing. Note that this server is already configured to allow Classic ASP pages, so I know it is not that. Could anyone give me any indication as to whether there is a particular setting I need to change in Server, or whether there are extra security hoops I have to jump through to get it working on Server 2008 which I don't need to do on Windows 7 Ultimate?
回答1:
Check the advanced settings of the application pool that this ASP application runs in. Does it have "Enable 32-Bit Application" set to True. If so then thats your problem you can't instantiate a 64 bit dll under a 32 bit pool.
Is there a reason you consider this to be a "64bit dll" instead of simple "Any CPU"? If not regasm it also for use as a 32 bit dll.
Otherwise you will need to run this ASP application without "Enable 32-Bit application" so that it runs as 64 bit but then there is probably a reason this is set in the first place. So the next step is to create a new application pool that doesn't have this setting and make a portion of your ASP run as a seperate application in this pool.
来源:https://stackoverflow.com/questions/11376604/classic-asp-and-com-dll-does-not-work-in-server-2008-r2-microsoft-vbscript-runt