5
votes

I created the ASP.NET dll with one function that i need to use in Classic ASP page.

I used the below code for creating object in classic asp page

set PeopleSoft = server.createobject("OPS.PSL")

I am getting the below error while executing

Server object error 'ASP 0177 : 80070002' 

Server.CreateObject Failed 

I searched in stackoverflow i saw some solution. By enabling the "Make assembly COM-visible" and "Register for COM interop".

Please Help me to come out from this issue

8

8 Answers

3
votes

You have to register your DLL first, and if the problem persists, do this:

  • Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\ FeatureControl\FEATURE_IGNORE_ZONES_INITIALIZATION_FAILURE_KB945701
  • Note If the FEATURE_IGNORE_ZONES_INITIALIZATION_FAILURE_KB945701 subkey does not exist, you must manually create it. If you're using a 64 bit OS, you may need to use HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\ FeatureControl\FEATURE_IGNORE_ZONES_INITIALIZATION_FAILURE_KB945701 instead
  • Right-click FEATURE_IGNORE_ZONES_INITIALIZATION_FAILURE_KB945701, point to New, and then click DWORD Value
  • Type w3wp.exe to name the new registry entry, and then press ENTER.
  • Right-click w3wp.exe, and then click Modify.
  • In the Value data box, type 1, and then click OK.

After setting this registry key, a simple app pool restart will apply the change. No longer will your .NET COM components randomly stop working with no real solution except shuffling application pools!

1
votes
1
votes

I had this problem. When you register .NET COM modules you must use regasm and if you want to call them from applications like IIS you must use /codebase with this command:

regasm yourfilename.dll /codebase
1
votes

I just had this error appear on a site that had been running perfectly for years. It seems a DLL had somehow become unregistered. It was an unmanaged DLL so I was able to re-register it using regsvr32:

%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\regsvr32 "C:\path\to\myAssembly.dll"

(Also see the difference between regasm and regsvr32)

0
votes

On this website :

http://connect.microsoft.com/VisualStudio/feedback/details/294241/kb937143-breaks-asp-to-net-com-interop

They fix the problem with giving read access to IUSR on HKEY_USERS\S-1-5-20\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones.

0
votes

Run this from the command prompt (replace myassembly.dll with your assembly path):

%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\regasm.exe myassembly.dll /codebase
0
votes

I faced a similar issue and after much research i found the solution ,check if its working for you. Remote scripting causes tons of errors with different IE versions. If your are passing control from one page to another and creating a new object from there you will get this kind of unable to create object error.

Example:

page x.asp--

function1call() 
function2call() 

further in page x.asp--

function1call(){
   var rs_obj = RSGetASPObject("some-object");
   ----some other things---
   frmPost.action = "someplace.asp"; 
   frmPost.submit();
}  

function2call(){
   var rs_obj = RSGetASPObject("some-object1"); //you wont be able to create 
                                                //this object
   ----some other things---
}

It seems like the remoteScripting object is not getting initiated . As function1call() calls frmPost.submit().

If you combine these 2 functions it will start to work. I.E

page x.asp--

    function1call(){
       var rs_obj = RSGetASPObject("some-object");
       var rs_obj = RSGetASPObject("some-object1"); 
       ----some other things---
       frmPost.action = "someplace.asp"; 
       frmPost.submit();

    }
0
votes

There is another reason you might get the error "Server.CreateObject Failed". A COM Visible DLL does not behave the same as a regular .NET DLL when it is being loaded by COM. You can't expect it to load other DLLs that are sitting in the same directory as your DLL, or downloaded through the Nuget package manager. If you want to load other DLLs you have to register them in the global assembly cache (GAC).

see: https://stackoverflow.com/a/23902131/2616170

If the assembly doesn't have a strong name then you won't be able to register it in the GAC.