Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / March 2006

Tip: Looking for answers? Try searching our database.

Call .net dll from classic asp

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris - 07 Mar 2006 21:22 GMT
I am having a problem called a .net assembly from an asp page. I go through
the following stages:
I create a module from my vb source
I link a strong name key to it
I compile it to a dll
I export the type library
I use regasm with the type library

When I call it in ASP with following code

set encrypt=Server.CreateObject("encrypt_ns.encrypt_cl")
str = encrypt.RSAEncrypt("privatekey.xml", "test")

I get the following error on the second line

encrypt1 (0x80004003)
Object reference not set to an instance of an object.

Encrypt1 is the name of the dll, encrypt_ns.encrypt_cl of the namespace and
class respectively. I have also included the command line switches below.

C:\Windows\Microsoft.NET\Framework\v1.0.3705\vbc /t:module /out:%outdir%
%indir% /r:%assemblies%
C:\Windows\Microsoft.NET\Framework\v1.0.3705\al C:\encrypt.dll /t:lib
/out:C:\encrypt1.dll /keyfile:C:\key.snk
"C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Bin\tlbexp.exe"
C:\encrypt1.dll
C:\Windows\Microsoft.NET\Framework\v1.0.3705\regasm C:\encrypt1.dll
/tlb:encrypt1.tlb
C:\Windows\Microsoft.NET\Framework\v1.0.3705\gacutil /i C:\encrypt1.dll
Scott M. - 07 Mar 2006 22:34 GMT
Did you register the .NET assembly for COM InterOp before building it?

>I am having a problem called a .net assembly from an asp page. I go through
>the following stages:
[quoted text clipped - 27 lines]
> /tlb:encrypt1.tlb
> C:\Windows\Microsoft.NET\Framework\v1.0.3705\gacutil /i C:\encrypt1.dll
Chris - 07 Mar 2006 22:43 GMT
No how do I do that. I don't have Visual Studio so I have had to piece
together stuff. In my VB class I import System.Runtime.InteropServices and
include the System dll when compiling?

> Did you register the .NET assembly for COM InterOp before building it?
>
[quoted text clipped - 29 lines]
>> /tlb:encrypt1.tlb
>> C:\Windows\Microsoft.NET\Framework\v1.0.3705\gacutil /i C:\encrypt1.dll
Scott M. - 08 Mar 2006 01:25 GMT
This may help:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cp
grfassemblyregistrationtoolregasmexe.asp


> No how do I do that. I don't have Visual Studio so I have had to piece
> together stuff. In my VB class I import System.Runtime.InteropServices and
[quoted text clipped - 33 lines]
>>> /tlb:encrypt1.tlb
>>> C:\Windows\Microsoft.NET\Framework\v1.0.3705\gacutil /i C:\encrypt1.dll
Ramesh - 16 Mar 2006 15:38 GMT
Hi
 I have creates a assembly in C# and registered it by commane : regasm dllname.dll /tlb /codebase
Now I am calling it in ASP. Once the function called successfuly but when i referesh the page then its giving error :Object reference not set to an instence of an object.

After Reset IIS I am able to call dll function again but not more then once. Every time I have to Reset IIS.
chsmith@speakeasy.net - 21 Mar 2006 18:19 GMT
I'm new to .NET/.ASP so I may be over looking something obvious:

My .net .dll returns an object, which may be a problem for .ASP
clients???

I'm gettting error from the .ASP: Error Type:
Server object, ASP 0177 (0x800401F3)
Invalid class string

>From a VB6 client:  Type mismatch: 'CreateObject'
Code:  800A000D

All the examples of .ASP/VB6 calling .NET classes use string returns
from .NET methods.  My .NET class returns a class.  Should I redesign
my .NET class to set the complex return into class instance variables
that are returned via 'getters'?

Thanks, curt

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.