0
votes

Going mad here.

I'm new to windows dev and I have registered my dll in the GAC.

I get a message saying "Assembly successfully added to the cache" and I can do a Gacutil /l "its name" and see it there

But when I try to instatiate it in Classic asp like so: Set TemperatureComponent = Server.CreateObject("comInteropTutorial")

I keep getting the error: "Server object: 006~ASP 0177~Server.CreateObject Failed~800401f3"

which I believe means it can't find it?

I have also tried to do the same things for other components that were already in the Global cache like: Set TemperatureComponent = Server.CreateObject("XamlBuildTask")

and the same thing happens.

Before adding the dll to the GAC, I did the following: I compiled the dll in Visual studio 2010 and did the following: Click on project Application - sign the assembly Build - register for Com interop Signing - sign the assembly use a file that you have created using sn command (sn –k )

I'm truely stuck now, can someone recommend anything?

I'm on windows 7 here, dunno if that matters... 64 bit 32 bit etc?

I'd happily step through a process that helps me determine the cause of this problem if anyone can recommend one?

2
Actually just came back to say:Also, not sure if I am supposed to run regsvr32, but when I do I get and error: The module "comInteropTutorial.dll" was loaded but the entry-point DllRegsiterServer was not found. Make sure that "comInteropTurial.dll" is a valid DLL or OCX file and then try again.iKode

2 Answers

0
votes

Looks like it is answered in another post: Accessing a .NET Assembly from classic ASP

...make sure your .Net assembly is set to be COM Visible.

0
votes

In Visual Studio, does the component show up in list of objects under the 'COM' table if you try to add it as a reference? Does the assembly depend on other assemblies or DLL's?

Just a guess here, sounds like either the regasm step is missing which adds the appropriate stuff to the registry, or in my case recently, IIS was running in 64bit, but the assembly was compiled for 32bit.