Server.CreateObject call from IIS fails against interop c# object

S

Steve H

I have created an object in c# that produces script for a legacy ASP page.
Next, I created a setup project and installed it on the server. When I run
a page that accesses it from the server, I get the following error:

Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
/.... myPage.asp line 275
800401f3

I am able to create a desktop VB6 client and instantiate the object
interactively by using CreateObject( Progid ). But it's under IIS that it
consistently fails. I set the directory settings of the DLL to full rights
for everyone at the OS level thinking it might be security related.

Any ideas?
Thanks,
-Steve
 
N

Nicholas Paldino [.NET/C# MVP]

Steve,

In order to do this, you have to set the ASPCompat flag at the top of
your page to true. This sets the apartment model of the thread that your
page is processed on so that it can run COM objects. Doing this in an
ASP.NET environment incurs a performance penalty though, and should be
avoided.

Hope this helps.
 
S

Steve H

Hi Nicholas,

Thanks for the prompt reply.

The ASPCompat option is only available on ASP.NET pages, and I am calling
the C#/ComInterop component from an ASP page. Sorry I wasn't more clear on
this. Could it be related to the COM threading model declared by the
C#/ComInterop component (ThreadingModel = Both under the InProcServer32
entry in the registry)? I thought the Com Runtime would resolve this by
itself.

Thanks again,
-Steve

Nicholas Paldino said:
Steve,

In order to do this, you have to set the ASPCompat flag at the top of
your page to true. This sets the apartment model of the thread that your
page is processed on so that it can run COM objects. Doing this in an
ASP.NET environment incurs a performance penalty though, and should be
avoided.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Steve H said:
I have created an object in c# that produces script for a legacy ASP page.
Next, I created a setup project and installed it on the server. When I run
a page that accesses it from the server, I get the following error:

Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
/.... myPage.asp line 275
800401f3

I am able to create a desktop VB6 client and instantiate the object
interactively by using CreateObject( Progid ). But it's under IIS that it
consistently fails. I set the directory settings of the DLL to full rights
for everyone at the OS level thinking it might be security related.

Any ideas?
Thanks,
-Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top