Help with creating .NET COM objects
Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: General Discussion
Forum Description: General discussion and chat on any topic.
URL: https://forums.webwiz.net/forum_posts.asp?TID=21131
Printed Date: 30 March 2026 at 1:18am Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com
Topic: Help with creating .NET COM objects
Posted By: Necronom
Subject: Help with creating .NET COM objects
Date Posted: 24 August 2006 at 7:38pm
Hello!
I am currently learning VB.NET and writing my own DLL's to use with my website. The problem is that I'm having a heck of a time getting them registered on my web server and then calling them from my ASP code.
So far, here's where I have gotten:
I've made a test DLL and put it on the web server. I then used RegASM.exe to registed the dll to the server (Found out that i can't use regsrv32.exe for .net dll's) When I searched the registry after i had it registered, I found it as TestCOM.Operations (which is what I called it, so that's good).
Now, when I write up the ASP code, I did this:
<%
Dim myCom
Set myCom = Server.CreateObject("TestCOM.Operations")
%>
When I run the page, I'm getting this error:
"Server.CreateObject Failed"
So, if anyone has any advice, i could really use the help.
Overall, I'm trying to write a Visual Basic .NET dll that I can register with my web server and then utilize it in an ASP environment.
Thank you!
. necronom .
------------- http://www.BodyMod.org - Body Modification Organization
|
Replies:
Posted By: Mart
Date Posted: 24 August 2006 at 8:26pm
A .net DLL isn't like a regular COM dll, so you can't access it like that without a bit of tinkering first. If you really want to do that then you need to sign the assembly first (search google) and then allow it to be registered for COM interop (again, search google) and then register and call it in the regular way. But I really would advise against using .net to wrote components for ASP, it just adds an extra layer on top of COM, and you don't gain anything over writing it in regular VB or C++. If you have your mind set on VB.NET then just write the whole web application in VB.NET/ASP.NET
|
Posted By: Necronom
Date Posted: 24 August 2006 at 8:35pm
The thing is that i've been learing VB.NET. I figured that I'd be going backwards trying to make a VB6 dll. How would I call the .NET DLL in ASP.NET? Do i have to do anything funky to the dll or on the web server, or do i just put it in c:\windows\system32 and then call it?
Thanks for your help! I'm researching what you said right now =)
. necronom .
------------- http://www.BodyMod.org - Body Modification Organization
|
Posted By: Mart
Date Posted: 24 August 2006 at 10:59pm
To call a .net assembly in asp.net all you need to do is place the DLL in the same directory as the webpage, you don't need to register it or do anything special because they aren't COM dll's. It's not really worth it IMHO to use .net assembleys in classic ASP, because you're just adding extra layers to your application and interop is sloooow, i would either go the whole way and use ASP.NET exclusively or just use pure ASP 3.0/ASP3.0 and COM components
|
|