DLL Question.

J

Joe

Alright after much researching, I've come to the conclusion that I
need to post this here hoping to get a solid answer. I'm looking to
create a DLL that is capable of being used on all platforms that I
mentioned in my subject (1.1 framework, 2.0 framework, old ASP) I'm
hoping to be able to create this DLL via a 2.0 .net class library.
Once its created I want the ability to reference this DLL along with
all its methods and properties in both 1.1 .NET projects and an old
ASP project. I know in regular ASP you can create.objects() and in
1.1 you can just add references but I'm always unclear whether or not
this is possible to do with a 2.0 DLL. I seen to always have problems
adding a reference to a DLL in 1.1 when the DLL was created in 2.0.
Can anyone provide a reasonable answer to this question? The ideal
situation i'm looking for is 2.0 coding and then using that in the
other places. Does anyone have a solid answer out there?
 
M

Mr. Arnold

Does anyone have a solid answer out there?

You need a COM object created with COM solution like VB6 that can be called
from a .NET solution like ASP.NET or other .NET solutions and by ASP 3.0 or
lower that works with COM objects.
 
J

Joe

You need a COM object created with COM solution like VB6 that can be called
from a .NET solution like ASP.NET or other .NET solutions and by ASP 3.0 or
lower that works with COM objects.

Ok so does that mean there is no way to create this in a .NET 2.0
framework project and then be used all over like you say with a COM
solution? Are you saying the only way to do this, would be to use VB6
or just create a COM like the way VB6 does? Thanks for any additional
information
 
P

Phill W.

Joe said:
I'm looking to create a DLL that is capable of being used on all
platforms that I mentioned in my subject (1.1 framework,
2.0 framework, old ASP) I'm hoping to be able to create this DLL
via a 2.0 .net class library.

Then you're out of luck.

A COM application (ASP) can load Fx2.0 assemblies.
So can an Fx2.0 application.
But an Fx1.1 application /will not/ load an Fx2.0 assembly.
Once its created I want the ability to reference this DLL along with
all its methods and properties in both 1.1 .NET projects and an old
ASP project.

Then you're going to /have/ to build it in Fx1.1.
Both FX1.1 and Fx2.0 applications will be able to load it.
Getting it to work from ASP may be more of an issue, because
Inter-Op'ing from COM to .Net gets "tricky" when you have multiple
Frameworks installed on the host. COM will always try to load the
/latest/ one (Fx2.0) even though you /may/ not want it to.
I seen to always have problems adding a reference to a DLL in 1.1
when the DLL was created in 2.0.

That's an understatement - it is simply not possible (AFAIK).

HTH,
Phill W.
 
B

bruce barker

your have 4 options:

1) a com object built with an unmanaged language
2) a com object built with .net 1.1
3) a com object built with .net 2.0 but hosted by com+ (dcom)
4) a .net 2.0 webservice


-- bruce (sqlwork.com)
 
J

joe

Then you're out of luck.

A COM application (ASP) can load Fx2.0 assemblies.
So can an Fx2.0 application.
But an Fx1.1 application /will not/ load an Fx2.0 assembly.


Then you're going to /have/ to build it in Fx1.1.
Both FX1.1 and Fx2.0 applications will be able to load it.
Getting it to work from ASP may be more of an issue, because
Inter-Op'ing from COM to .Net gets "tricky" when you have multiple
Frameworks installed on the host. COM will always try to load the
/latest/ one (Fx2.0) even though you /may/ not want it to.

Phill,
So are you saying that I can use VB6, and inside VB6 load up a 2.0fx
DLL and have access to all its methods and properties? Then from there
once I create the COM object via VB6 (with my 2.0 DLL being used) I would
be able to load that COM DLL into 1.1 and use accordingly? For a little
clarification, I have a DLL written in 2.0 that I need to be able to use in
1.1 and in ASP3.0. Would the above allow me to do this? Just looking for
a little clarification :)

Thanks
 
G

George Ter-Saakov

My guess the best solution here is to create COM object in regular VB or C++
and then create 2 wrappers, one for .NET 1.1 and another for .NET 2.0

George.
 
J

joe

3) a com object built with .net 2.0 but hosted by com+ (dcom)


Would this option allow me to use the 2.0 COM hosted by com+ DLL in 1.1 /
ASP / 2.0 by doing what you explain here?
 
M

Mr. Arnold

Joe said:
Ok so does that mean there is no way to create this in a .NET 2.0
framework project and then be used all over like you say with a COM
solution? Are you saying the only way to do this, would be to use VB6
or just create a COM like the way VB6 does? Thanks for any additional
information

The replacement for COM commincations in .NET is .NET Remoting. You cannot
make a COM object in .NET. However, .NET can interface with a COM object.

http://msdn.microsoft.com/msdnmag/issues/01/08/interop/
http://j-integra.intrinsyc.com/support/net/doc/remoting_primer.html

ASP 3.0 and lower are not .Net solutions. You want to make a COM object,
then you need to be using a COM solution to develop it. VB 6 is where you
can code and make a COM object or DLL
 
B

Bob Altman

The short answer is Yes, you can create the DLL in VS 2005 (2.0 framework)
and call into it from all of the platforms you mention.

You can't reference a 2.0 assembly directly from VS 2003 or ASP, but you can
get to it through COM interop. If you're programming in VB, just navigate
to My Project in Solution Explorer, select the Application tab, click on
Assembly Information, and check "Make assembly COM-visible". I've never
needed to do this, so I've never played with it myself. I think that's all
there is to it, but I'm sure someone else can correct me if I've missed
something...

- Bob
 
M

Michel Posseth [MCP]

I thought once the same as you but in practice

As soon as you try to reference the the 2.0 ( COM ) object in VS.Net <
2005 ( 2002 , 2003 ) you wil receive an error as the assembly type is
unknown
so the short answer is No :-(

However the other way around is no problem 2002 , 2003 in 2005 ,also in VB6
and classic Asp it wil work however ofcourse the framework should be
installed and the assembly must be com registred with Regasm


as small copy paste example i once showed in this newsgroup

http://groups.google.com/group/micr...l+posseth+COM+VB.Net&rnum=28#ca996d74d250974e


this was actually a snip from a project i had these days and it run in very
COM capable language ( tested in Delphi , VB6 , C++ and yes even in Clipper
:)

regards

Michel
 
P

Phill W.

So are you saying that I can use VB6, and inside VB6 load up a 2.0fx
DLL and have access to all its methods and properties?

Assuming the Fx2.0 Dll is exposed to COM, yes.
Then from there once I create the COM object via VB6 (with my 2.0 DLL
being used) I would be able to load that COM DLL into 1.1 and use
accordingly?

Maybe. Maybe not.

Your 1.1 process would load the 1.1 runtime, then go out into COM world
to load your VB6 Dll, and from there [try to] load the 2.0 Dll.
I /think/ that's where it would fall down, because you'd be loading a
second version of the runtime into the same process and I don't /think/
that will work.
For a little clarification, I have a DLL written in 2.0 that I need to be
able to use in 1.1 and in ASP3.0.
Would the above allow me to do this?
Just looking for a little clarification :)

Try it! And let us know how you get on ...

Regards,
Phill W.
 

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,969
Messages
2,570,161
Members
46,709
Latest member
AustinMudi

Latest Threads

Top