?
Solved

ASP.NET and Server.CreateObject

Posted on 2003-03-27
10
Medium Priority
?
1,280 Views
Last Modified: 2013-11-25
I understand that Server.CreateObject has been replaced in ASP.NET. My problem is that I run a login/user management system with a third party object called ASPCrypt like this:
Set Cryptor = Server.CreateObject ("AspCrypt.Crypt")

In .NET, I have tried:
<%@ Import Namespace="AspCrypt" %>

but I keep getting errors like:
BC30466: Namespace or type 'AspCrypt' for the Imports 'AspCrypt' cannot be found.

The Server.CreateObject method works perfectly on the same machine using classic ASP. What do I have to do to get the AspCrypt object to work/import with .NET?

-Whatsit2002
0
Comment
Question by:whatsit2002
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
  • 2
10 Comments
 
LVL 23

Accepted Solution

by:
naveenkohli earned 300 total points
ID: 8219993
You will have to use tlbimp on that COM object. And simplest way to do is from IDE, add refrence to that DLL.
0
 
LVL 7

Author Comment

by:whatsit2002
ID: 8220018
I'm not using an IDE... I'm writing asp.net code in Homesite 4.5x

Also, could you give an example of tlbimp?
0
 
LVL 6

Expert Comment

by:thomasdodds
ID: 8226675
"I'm writing asp.net code in Homesite 4.5x" - then you've cut yourself off from the benefits of using the tool created for the feature rich framework you've decided to use for development ...
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
LVL 7

Author Comment

by:whatsit2002
ID: 8226805
Well, if I could afford a multi-hundred dollar development environment, I might think about it, but I have had great success building classic asp with Homesite ($50 US).

Anyway, that's off topic.

I ran tlbimp on my AspCrypt.dll, created my RCW dll file and got the message:
AspCrypt imported

--- but, I still can't access the namespace. I keep getting the same errors. Can anyone help?

-Whatsit2002
0
 
LVL 6

Expert Comment

by:thomasdodds
ID: 8226833
"but I have had great success building classic asp with Homesite ($50 US)." - classic ASP and ASP.NET are so different; don't be fooled by the name ... either get VS.NET (if you have a student ID get the acedemic version) or get the free WebMatrix ... the framework is too rich to not use the proper tool ... if you are going to use Homesite, then write your project in classic ASP and forget .NET for now
0
 
LVL 7

Author Comment

by:whatsit2002
ID: 8226912
Okay, so I didn't know about Web Matrix. I downloaded it, it look pretty usefull.

That's out of the way. Could someone please tell me how I might get my COM object working? (Either with Web Matrix or manually?)

I don't mean to come off as a stuck-up, but my concern is not my development environment. I have ported a lot of my asp to asp.net already. My one problem is this AspCrypt COM object and getting it to work with ASP.Net.

I would use ASP.Net's built-in crypto/MD5 stuff, but it is not compatible with the user info I already have since AspCrypt spits out a string and ASP.Net's md5 namespace spits back a binary chunk of data.

I'll bump the points if someone can give a usefull answer.
-Whatsit2002
0
 
LVL 23

Expert Comment

by:naveenkohli
ID: 8226965
use ILDASM to open the assembly that you crated using tlbimp and check what is the namespace that is created. It may not be AspCrypt
0
 
LVL 7

Author Comment

by:whatsit2002
ID: 8227035
The rcw dll's tree looks like this:

aspcrypt_rcw.dll
|
|-->M A N I F E S T
|
|--^AspCrypt
   |
   |-I Crypt
   |
   |-_ CryptClass
   |
   |-I ICrypt

There are a couple things under each of the items under AspCrypt, but I think you get the idea. I believe this indicates that the namespace is actually AspCrypt which is what I am trying to import, right?
0
 
LVL 7

Author Comment

by:whatsit2002
ID: 8227047
Note: the ^ before the name "AspCrypt" is my poor ascii art representation of a shield icon.
-Whatsit2002
0
 
LVL 7

Author Comment

by:whatsit2002
ID: 8227148
I figured it out! I dumped the AspCrypt_RCW.dll file into the %root%\bin\ of my .NET application and it works spledidly. naveenkohli, you get the points for, at least, pointing me in the right directions.

-Whatsit2002
0

Featured Post

Basic Security of Your VPC

So, you’ve got this shiny new VPC and a fancy new application configured on your EC2 servers ready to go. This application is only accessible from your computer, which is great for security, but you need your users to be able to access it! So, what’s the easiest way to do this?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question