Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error '80131509' in ASP Page

We have created one .Net Assembly and made it accessible as COM object.When we are trying to expose any method of this object in ASP page we get an error "80131509". We are not getting any error when we are instantiating the Object. i.e. Server.CreateObject is passing through.

This is working fine in our development environment but we are getting this error in UAT environment. Development and UAT are almost same except UAT is more secure. I have tried all possible ways but no luck. I am working on this issue for past 4 days and any help will be appreciated.

I am suspecting there may be some permission issue with IIS 7 on exposing that dll. But not sure what it can be? We have given full rights to IUSR too.

Code :

set obj = Server.CreateObject("DataAccess")
dim rs
set rs=obj.GetLocations("All") <--- **Here i am getting an error.**
like image 275
Bugreport Avatar asked May 29 '12 18:05

Bugreport


1 Answers

We have a few com dll's at my work and we often run into problems where we register the dll with regasm and the dll does not work. It works in other live environments but for some reason it just will not work in this one instance. Com dlls are fickle. Sometimes we will register it, unregister it, re-register it, and reboot. Sometimes they mysteriously start working other times not.

There are a couple more things that can go wrong.

Make sure that the correct permissions are set on the folders the dll lives in and on the dll itself. Also make sure that any dependent dlls are present and also have the correct permission. Ensure that everything the dll needs access to also has the correct permissions.

If that fails open regedit. Search for the guid associated with the com object. Sometimes you will discover that the paths the registry have are all mixed up. Clean out any references to the com object, reboot, and re-register it.

I have also seen an exception being thrown in the constructor causing issues. When the com object starts up it blows up. In one of our objects added a method to send an email when an exception occurs.

In one case we had an old com object that was no longer compatible with the version of windows we were running. If you have upgraded the server it is on that could be the problem. In our case we wrote our own component to replace the broken old one.

Also make sure that if the com object is strongly typed that you use the "regasm /tlb /codebase fickle_com_object.dll"

In short there are several things that cause com object to not work:

  1. Multiple paths in the registry
  2. Wrong security permissions on folders
  3. Crashing when being created

Perhaps one of these things will solve your issue. I know how difficult it can be sometimes. Good luck!

like image 169
Fickle Panther Avatar answered Oct 06 '22 10:10

Fickle Panther