HighTechTalks DotNet Forums  

80131534 error trying to instantiate interop com from asp

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss 80131534 error trying to instantiate interop com from asp in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Mark
 
Posts: n/a

Default 80131534 error trying to instantiate interop com from asp - 11-08-2007 , 01:47 PM






Hi...

One of my colleagues is have a problem that's driving him crazy.

We have a number of assemblies that expose some C# objects as COM. One
particular one is throwing an 80131534 error on instantiation from an ASP
page. The error message doesn't really say diddly about what it doesn't
like, just that it can't make one of those objects.

We checked the registry, and it looks like it's registered fine. He made a
little vbs script instantiating one of the objects and ran it from cmd, and
that worked fine, so it seems like the plumbing is okay in general.

But we're at a loss why ASP is having trouble instantiating one of these.
Does the old asp engine have a shadow cache somewhere that it could be wedged?

Thanks
Mark


Reply With Quote
  #2  
Old   
Phil Wilson
 
Posts: n/a

Default Re: 80131534 error trying to instantiate interop com from asp - 11-08-2007 , 02:03 PM






I think that's the kind of type initialization error that you get when code
in the constructor fails, so that's where I'd look.
--
Phil Wilson
[MVP Windows Installer]

"Mark" <mmodrall (AT) nospam (DOT) nospam> wrote

Quote:
Hi...

One of my colleagues is have a problem that's driving him crazy.

We have a number of assemblies that expose some C# objects as COM. One
particular one is throwing an 80131534 error on instantiation from an ASP
page. The error message doesn't really say diddly about what it doesn't
like, just that it can't make one of those objects.

We checked the registry, and it looks like it's registered fine. He made
a
little vbs script instantiating one of the objects and ran it from cmd,
and
that worked fine, so it seems like the plumbing is okay in general.

But we're at a loss why ASP is having trouble instantiating one of these.
Does the old asp engine have a shadow cache somewhere that it could be
wedged?

Thanks
Mark




Reply With Quote
  #3  
Old   
Walter Wang [MSFT]
 
Posts: n/a

Default RE: 80131534 error trying to instantiate interop com from asp - 11-08-2007 , 07:55 PM



Hi Mark,

As Phil pointed out, the error is COR_E_TYPEINITIALIZATION, which means a
..NET type failed to initialize.

You can also try to debug the ASP code:

#Mikhail Arkhipov (MSFT)'s WebLog : How to debug classic ASP pages in VS
2005
http://blogs.msdn.com/mikhailarkhipo...24/432308.aspx


Regards,
Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


Reply With Quote
  #4  
Old   
Walter Wang [MSFT]
 
Posts: n/a

Default RE: 80131534 error trying to instantiate interop com from asp - 11-13-2007 , 09:18 PM



Hi Mark,

I'm writing to check the status of this post. Please feel free to let me
know if there's anything else I can help. Thanks.


Regards,
Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


Reply With Quote
  #5  
Old   
Mark
 
Posts: n/a

Default RE: 80131534 error trying to instantiate interop com from asp - 12-05-2007 , 10:13 AM



Hi Walter, Phil...

Sorry I lost track of this thread. My co-worker came by yesterday and said
it is still a problem.

To Phil's point, the argumentless constructor for the object really doesn't
do anything (it sets 3 member variables to null) so it's hard to figure what
would blow up about that.

I googled around a bit this morning and found a few articles suggesting it
might be file system permissions and/or registry key permissions, so I tried
putting IUSR_<host> in the administrator's group temporarily; it didn't help
(do you have to reboot for that to take effect or would iisreset suffice?)

I found another article vaguely related saying that there could be some
interaction with the timezone registry keys and to delete all zones that
didn't have all 7 values. That didn't help.

I'm not sure what more I can find by attaching a debugger to the asp engine;
I know the line of the Server.CreateObject() and it's just blowing up out of
there.

I found another article saying that in some circumstances regasm doesn't set
up all the right registry keys. But I went through all the reg keys and they
all looked okay. The only difference I could see between the article I was
reading and my setup was that they appeard to GAC their component while we
don't; we had the Codebase reg value instead. But that file:/// path was
correct both to the dll and tlb in the registry.

Any other ideas?

Thanks for your help
Mark


""Walter Wang [MSFT]"" wrote:

Quote:
Hi Mark,

As Phil pointed out, the error is COR_E_TYPEINITIALIZATION, which means a
.NET type failed to initialize.

You can also try to debug the ASP code:

#Mikhail Arkhipov (MSFT)'s WebLog : How to debug classic ASP pages in VS
2005
http://blogs.msdn.com/mikhailarkhipo...24/432308.aspx


Regards,
Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.



Reply With Quote
  #6  
Old   
Walter Wang [MSFT]
 
Posts: n/a

Default RE: 80131534 error trying to instantiate interop com from asp - 12-06-2007 , 02:56 AM



Hi Mark,

First, let's confirm some information:

* Does this issue occur everytime you try to instantiate the .NET
component from ASP or does it occur intermittently?
* Which .NET version are you using to compile the .NET component?
* I assume you're using IIS 6.0, do you have other websites configured to
run in the same application pool as this ASP website?

Regards,
Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


Reply With Quote
  #7  
Old   
Mark
 
Posts: n/a

Default RE: 80131534 error trying to instantiate interop com from asp - 12-06-2007 , 08:56 AM



Hi Walter...

This error occurs every time we try to instantiate the object in ASP, but
not in a separate snippet of vb script run at the command line. It's also
occurring with some of our .Net COM objects and not others. As mentioned
before, the object ASP fails to instantiate for me has a constructor that
does no work that could blow up (initializing 3 members to null). The only
other possibility is that maybe there's some base class constructor doing
something to explode.

We're compiling/running with VS 2005/.Net framework 2.0.50727 in dev. The
same code apparently is being set up with .net 1.1 in our production
environment (where there have been no reported problems)

Most of our development machines are XP Pro, so most developers are using
single-site IIS 5. We do have one developer using Vista, so he's got IIS 6
and he's seeing the problem too.

Any ideas would be appreciated.

Thanks
Mark


""Walter Wang [MSFT]"" wrote:

Quote:
Hi Mark,

First, let's confirm some information:

* Does this issue occur everytime you try to instantiate the .NET
component from ASP or does it occur intermittently?
* Which .NET version are you using to compile the .NET component?
* I assume you're using IIS 6.0, do you have other websites configured to
run in the same application pool as this ASP website?

Regards,
Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.



Reply With Quote
  #8  
Old   
Walter Wang [MSFT]
 
Posts: n/a

Default RE: 80131534 error trying to instantiate interop com from asp - 12-10-2007 , 12:50 AM



Hi Mark,

Here's my understanding and summary of the issue so far:

1) You are running ASP.NET 2.0 on Windows XP
2) You registered .NET 2.0 assembly as COM-visible and it's working
correctly if you invoke it using a simple script and execute it using an
interactive user account
3) Your ASP script cannot access the COM server and it returns error
E_COR_TYPEINITIALIZATION.

Please try following tests and let me know the results:

* Try to create a new and simple class library in .NET 2.0 and register as
COM-visible and have a test in the ASP script; if this works, it proves the
issue is related to your specific assemblies
* Try to configure your IIS worker process to run under the user account
that you were using to log in interactively, this might prove if it's
related to the user account or permission.


Regards,
Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


Reply With Quote
  #9  
Old   
Mark
 
Posts: n/a

Default RE: 80131534 error trying to instantiate interop com from asp - 12-10-2007 , 08:25 AM



Hi Walter...

Additional bits of information mentioned earlier:
1) We have other C# objects exposed as COM and those are working in ASP

2) I had tried earlier putting IUSR_<machine> in the admin group but that
didn't change the symptoms.

I tried your suggestions and found no change.

New bit of information:
1) Our production environment is 2003 Server, and all our .net com objects
are working there.

Any new ideas would be helpful

Thanks
Mark

""Walter Wang [MSFT]"" wrote:

Quote:
Hi Mark,

Here's my understanding and summary of the issue so far:

1) You are running ASP.NET 2.0 on Windows XP
2) You registered .NET 2.0 assembly as COM-visible and it's working
correctly if you invoke it using a simple script and execute it using an
interactive user account
3) Your ASP script cannot access the COM server and it returns error
E_COR_TYPEINITIALIZATION.

Please try following tests and let me know the results:

* Try to create a new and simple class library in .NET 2.0 and register as
COM-visible and have a test in the ASP script; if this works, it proves the
issue is related to your specific assemblies
* Try to configure your IIS worker process to run under the user account
that you were using to log in interactively, this might prove if it's
related to the user account or permission.


Regards,
Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.



Reply With Quote
  #10  
Old   
Walter Wang [MSFT]
 
Posts: n/a

Default RE: 80131534 error trying to instantiate interop com from asp - 12-11-2007 , 10:00 PM



Hi Mark,

Thanks for the updated information. Honestly I don't have further ideas on
what might be wrong without getting a reproducible project and debugging it.

If it's ok and the C# project isn't very big or dependent on other
projects, maybe you could send me the project for further investigating.

Otherwise, I'm afraid you will need to contact our Customer Support and
Service which can provide live (remote) debugging or dump analysis.


Regards,
Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.