Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

DLL Question.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joe - 19 Jul 2007 21:42 GMT
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?
Mr. Arnold - 19 Jul 2007 21:54 GMT
> 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.
Joe - 20 Jul 2007 15:10 GMT
> > 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.

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
Mr. Arnold - 20 Jul 2007 16:38 GMT
>> > Does anyone have a solid answer out there?
>>
[quoted text clipped - 9 lines]
> 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
Phill W. - 20 Jul 2007 16:11 GMT
> 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.
joe - 20 Jul 2007 16:22 GMT
> Then you're out of luck.
>
[quoted text clipped - 8 lines]
> 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
Phill W. - 24 Jul 2007 12:55 GMT
>> Then you're out of luck.
>>
[quoted text clipped - 8 lines]
>> Frameworks installed on the host.  COM will always try to load the
>> /latest/ one (Fx2.0) even though you /may/ not want it to.

> 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.
George Ter-Saakov - 20 Jul 2007 16:22 GMT
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.

>> 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,
[quoted text clipped - 25 lines]
> HTH,
>    Phill  W.
bruce barker - 20 Jul 2007 16:15 GMT
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)

> 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
[quoted text clipped - 10 lines]
> 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?
joe - 20 Jul 2007 16:31 GMT
bruce barker <nospam@nospam.com> wrote in news:#c4gtFuyHHA.1212
@TK2MSFTNGP05.phx.gbl:

> 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?
Bob Altman - 20 Jul 2007 20:56 GMT
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

> 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
[quoted text clipped - 10 lines]
> 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?
Michel Posseth  [MCP] - 22 Jul 2007 21:14 GMT
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/microsoft.public.dotnet.languages.vb/browse_threa
d/thread/b9974554b8d68a52/ca996d74d250974e?lnk=st&q=michel+posseth+COM+VB.Net&rn
um=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

> 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.
[quoted text clipped - 23 lines]
>> 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?

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.