asp.net - Registering a .NET DLL for COM visibility in ASP Classic -


we're trying write couple of applications. 1 asp.net site uses .net assembly xxx.elements.dll, provides utility functions.

the other, classic asp site, should use same dll in order use same utility functions. (it used encrypting data between 2 sites).

despite many attemps , googling, cannot working.

we have:

applied comvisibility assembly.info , ensured there guid:

[assembly: comvisible(true)] [assembly: guid("ab96fbc3-aa39-4fb6-8628-13778445e503")] 

we made sure our type ticks boxes on type visibility ensuring has default constructor, comvisible , has guid. we've created simplistic method testing:

namespace xxx.elements {     [guidattribute("d3be2c7d-7550-4da1-8f61-6871e193242f")]     [comvisible(true)]     public  class urlutility : iurlutility     {          public urlutility()         {         }          public string test()         {             return "hello";         }      } } 

using interface:

[guidattribute("d3be2c7d-7550-4da1-8f61-6871e193242a")] [comvisible(true)] public interface iurlutility {     string test(); } 

we found useful (though non-resolving) post here this: warning msb3391: not contain types can unregistered com interop.

we have checked regsiter com-interop in project property pages.

this continues output warning:

c:\windows\microsoft.net\framework\v4.0.30319\microsoft.common.targets(3341,9): warning msb3214: "d:\dev\yyy\xxx.elements\bin\release\xxx.elements.dll" not contain types can registered com interop. 

when compiling. if run regasm xxx.elements.dll /tlb directly, get:

microsoft (r) .net framework assembly registration utility 4.0.30319.1 copyright (c) microsoft corporation 1998-2004. rights reserved. types registered assembly exported 'd:\dev\yyy\iww.elements\bin\release\xxx.eleme nts.tlb', , type library registered successfully

so little confused ambiguity.

when in registry, appear register .tlb correctly:

windows registry editor version 5.00  [hkey_classes_root\typelib\{ab96fbc3-aa39-4fb6-8628-13778445e503}]  [hkey_classes_root\typelib\{ab96fbc3-aa39-4fb6-8628-13778445e503}\1.1] @="elementary support library xxx' products"  [hkey_classes_root\typelib\{ab96fbc3-aa39-4fb6-8628-13778445e503}\1.1\0]  [hkey_classes_root\typelib\{ab96fbc3-aa39-4fb6-8628-13778445e503}\1.1\0\win32] @="d:\\dev\\yyy\\xxx.elements\\bin\\release\\xxx.elements.tlb"  [hkey_classes_root\typelib\{ab96fbc3-aa39-4fb6-8628-13778445e503}\1.1\flags] @="0"  [hkey_classes_root\typelib\{ab96fbc3-aa39-4fb6-8628-13778445e503}\1.1\helpdir] @="d:\\dev\\yyy\\xxx.elements\\bin\\release" 

we have registered type in gac:

gacutil /i xxx.elements.dll 

and given strong name using:

sn -k xxx.elements.snk 

and included name in assemblyinfo.cs file:

[assembly: assemblykeyfile(@"d:\dev\yyy\xxx.elements\xxx.elements.key")] 

we have applied iusr user read permission registry keys:

hkey_classes_root\typelib\{ab96fbc3-aa39-4fb6-8628-13778445e503} hkey_users\s-1-5-20\software\microsoft\windows\currentversion\internet settings\zones 

(the last 1 suggested here: cannot instanciate .net com object in classic asp/vbscript page (error asp 0177))

despite this, when activate object in asp page using code:

dim urlutility set urlutility = server.createobject("xxx.elements.urlutility") ' should return "hello" test=urlutility.test() 

the process stops , when debug w3wp process, error:

server object: 006~asp 0177~server.createobject failed~800401f3

we have tried check boxes, must missing something. ideas, please?

i had similar problem time ago. solved hosting .net component in com+ application server. this article suggests , describes same. in addition article maybe necessary configure assembly (it running stand-alone, if suggested). in case need manifest , config file in applications root. @ so answer details.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -