Migrating ASP & COM+ to ASP .NET

G

Guest

Hi,

The company I work for has a web site (IIS5) build using ASP and COM+
components which are written in VB6 and provide the business and database
logic for the site.

We would very much like to start using ASP .NET and are looking at how we
can migrate our ASP code and COM+ components. I have read several articles
which provide a fair amount of information about migrating ASP to ASP .NET
but haven't much information about what we do with our COM+ components.

Can we use our COM+ components with ASP .NET and if so are there any
performance issues? If we can't what is the alternative? Would we need to
convert our components to web services or something else ?

Any comments would be very welcome.

Mike Towers
 
J

Juan T. Llibre [MVP]

Hi Mike.

You can import the Type Library in your
COM components, and use them in ASP.NET,
with TLBImp.exe.

Run something like this line at the command line:

TLBImp C:\yourpath\yourCOM.DLL /Out:C:\yourpath\NewName.DLL

That will create a RCW (Runtime Callable Wrapper) NewName.DLL
at C:\yourpath.

Then, add it to the project reference from Menu Project
Add Reference ... > Browse ...

For more information on tlbimp.exe, see

http://msdn.microsoft.com/library/d...ls/html/cpgrftypelibraryimportertlbimpexe.asp

Full instructions are found at :
http://msdn.microsoft.com/library/d...pguide/html/cpconPrimaryInteropAssemblies.asp

and
http://msdn.microsoft.com/library/d...l/cpcongeneratingprimaryinteropassemblies.asp
has specific instructions on how to generate them.

Good luck!


Juan T. Llibre
===========
 
K

Kevin Spencer

Yes you can use your COM+ components with ASP.Net. Yes, there are
performance issues with Interop. I would recommend that you rewrite your COM
components as .Net class libraries, if it is at all feasible.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
 
J

Juan T. Llibre [MVP]

But, as a stopgap measure, until the applications
are fully ported to ASP.NET, InterOP does provide
an easy way to use the existing work, a way which,
except for very traffic-intensive applications, will
serve its purpose.

If you're not marshalling, the performance drag isn't much.

A tool like Compuware DevPartner Studio,
is of help in determing the exact performance drag,
and whether it's time for rewriting, or InterOP will do.

See http://www.vsj.co.uk/dotnet/display.asp?id=174




Juan T. Llibre
===========
 
G

Guest

When you say rewrite them as .Net class libraries I assume that is a bit like
writing an old style C++ class library? and if so how do I go about calling
the code in the class library ? Is it a case of using the IMPORT Namespace
syntax in the ASP page ?

Thanks

Mike
 
K

Kevin Spencer

Hi Mike,

Everything in .Net is a class. Even the Page. So, you just create your
classes and reference them in the classes that need them. The import
directive is a pre-compile directive that allows you to omit the full
namespace of a class when referencing it in your code.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
 
G

Guest

Last question.

Ok, so if I create a new class to replace my component and build it into an
assembly or whatever, how do I go about getting onto the web server.
Obviously I copy the files but do I need to register them or something like
that ?

Thanks

Mike Towers
 
G

Guest

NO REGISTRATION! Thats the kool part. You just have to reference the
assemply in your project. However, you can register it in the Global Assembly
Gache; but you have to give it a digital signature. No more .dll hell.
However, just Copy and Paste will deploy your app; but for a web app you
should but it in a special folder called bin which is located either in the
root directory of your website wwwroot/bin OR the root directory of your
virtual directory.
 
K

Kevin Spencer

Ok, so if I create a new class to replace my component and build it into
an
assembly or whatever, how do I go about getting onto the web server.
Obviously I copy the files but do I need to register them or something like
that ?

Just put them in the /bin folder of your app. That is one of the beauties of
..Net. No registration necessary.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
 
O

Orin Walker

If you do go the COM route, I would highly recommend the book:
..NET and COM: The Complete Interoperability Guide
by Adam Nathan
ISBN: 067232170X

It has been a very valuable reference!

Orin
 
G

Guest

Thanks to everyone for their help I now have a clearer picture of what I need
to do.

Mike Towers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top