Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Help with creating .NET COM objects
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Help with creating .NET COM objects

 Post Reply Post Reply
Author
Necronom View Drop Down
Groupie
Groupie


Joined: 19 October 2001
Location: United States
Status: Offline
Points: 116
Post Options Post Options   Thanks (0) Thanks(0)   Quote Necronom Quote  Post ReplyReply Direct Link To This Post Topic: Help with creating .NET COM objects
    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 .
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Necronom View Drop Down
Groupie
Groupie


Joined: 19 October 2001
Location: United States
Status: Offline
Points: 116
Post Options Post Options   Thanks (0) Thanks(0)   Quote Necronom Quote  Post ReplyReply Direct Link To This Post 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 .
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.