Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
672 views
in Technique[技术] by (71.8m points)

iis 7 - Classic ASP using COM+ .Net Interop 64 Bit Windows Server 2008 IIS 7 Server.CreateObject Fails

I am having an issue related to executing a .Net dll from a classic asp application on a 64 Bit Windows Server 2008 server running IIS7. The situation is as follows:

I have written a .Net C# assembly to perform some encryption tasks. This assembly has been made available to the classic ASP environment via inheriting from ServicedComponent, ensuring the assemblyinfo file has the ComVisible(true) attribute, and it has been installed using the "regsvcs" command line.

When testing on my own desktop (XP running IIS6) everything worked fine. When moving to IIS 7, Windows Server 2008 I get the infamous "ASP 0177 Server.CreateObject failed".

I have tried the following to no avail:

  1. Ensuring the ASP and Script Extension features were installed on the server, as this is not the default for IIS7. This allowed me to execute simple ASP commands, but not server.createobject for the .net assembly.
  2. Enabled 32 Bit application support for the app pool supporting the classic asp site
  3. Used NetworkService as the identity for the app pool supporting the classic asp site
  4. Tried registering dll using regsvr32, which failed
  5. I am able to create other objects such as "scripting.filesystemobject"
  6. Moving dll's to the wow64 directory and then using regsvcs to register them.
  7. And yes when I have been executing the regsvcs commands they have been from a command line launched with "RunAs" Administrator. The regsvcs commands have registred successfully from both the 64 and 32 bit versions. However, when used from the classic asp application, it fails.

This question is closely related to this one. However, I think this question was more related to using tools on the server as opposed to a programatic problem similiar to mine.

Anyone have any more ideas to try?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

After a lot of help here and some more research, we finally came across the answer. To solve our issue we did the following:

  • No longer inherit from ServiceComponent (This is ok, since we are not actually leveraging any specific COM+ features)
  • Utilized the following commands to install the component, which must be done in order:

    gacutil /i "C:InetpubwwwrootASPTest*name of dll*"

    regasm /tlb "C:InetpubwwwrootASPTest*name of dll*"

This process eliminated the original errors and also had the added benefit of being able to replace the dll while IIS is running.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...