Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: ASP.NET Classlibrary not instantiating properly in legacy ASP pages

Reply
Thread Tools

Re: ASP.NET Classlibrary not instantiating properly in legacy ASP pages

 
 
Patrick Steele [MVP]
Guest
Posts: n/a
 
      07-14-2003
In article <yKqdnZPHvccTZY-iU->,
says...
> Ok, I've been hung up on this issue for quite some time now and I would
> like some help in getting it to work. I think this may be a setup issue
> but I'd like to ask your eminences first.
>
> Here's some backstory: I need to create a VB.NET classlibrary (or another
> structure) to use objects for our business logic. However, as our upgrade
> is an ongoing process, I must enable this structure to be run in both ASPX
> and ASP pages.
>
> Here's what goes wrong: I create a new solution. Create two projects, one
> a ASP.NET web app, the other a classLibrary. I put a basic hello world
> object into the classlibrary then get a return string from it in both an
> ASP and ASPX page. Yes, the classlibrary has the build option checked to
> "register for COM interop."
>
> Now, the ASPX page runs fine - but the ASP page gives me the following
> cryptic error:
>
> Error Type:
> (0x80070002)
> /webApplication1/test1.asp, line 3
>
> Line 3 is the Server.CreateObject command for the object in question.
>
> No error string. The error code, when googled, reveals that it's "file not
> found." That's about as useful as a kick in the ass. What am I doing
> wrong? Why can't my ASP page use this object? If I can only get this
> functional then I will have no further issues - we can start moving our
> business logic and data logic from the legacy ASP pages to an object-based
> back end. Please help!!


I would strong-name the assembly and place it in the Global Assembly
Cache (GAC). Since your library is a .NET library, the same rules for
locating the assembly apply even when running in COM-interop: first the
GAC is checked, then the current directory (based on the EXE running).

Since your assembly isn't in the GAC, the only place to look would be
the "current directory" of whatever process is running the ASP page (I'm
not sure exactly which process that is). Placing it in the GAC will
alleviate this problem.

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
 
Reply With Quote
 
 
 
 
John Timney \(Microsoft MVP\)
Guest
Posts: n/a
 
      07-14-2003
To add to Patricks suggestion, if you are putting it in the GAC to be used
by ASP via Interop, or ASP.NET, then make sure you set your assembly culture
information to be neutral, or your assembly probably wont load.

--
Regards

John Timney (Microsoft ASP.NET MVP)
----------------------------------------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
----------------------------------------------

"Patrick Steele [MVP]" <> wrote in message
news: m...
> In article <yKqdnZPHvccTZY-iU->,
> says...
> > Ok, I've been hung up on this issue for quite some time now and I would
> > like some help in getting it to work. I think this may be a setup issue
> > but I'd like to ask your eminences first.
> >
> > Here's some backstory: I need to create a VB.NET classlibrary (or

another
> > structure) to use objects for our business logic. However, as our

upgrade
> > is an ongoing process, I must enable this structure to be run in both

ASPX
> > and ASP pages.
> >
> > Here's what goes wrong: I create a new solution. Create two projects,

one
> > a ASP.NET web app, the other a classLibrary. I put a basic hello world
> > object into the classlibrary then get a return string from it in both an
> > ASP and ASPX page. Yes, the classlibrary has the build option checked

to
> > "register for COM interop."
> >
> > Now, the ASPX page runs fine - but the ASP page gives me the following
> > cryptic error:
> >
> > Error Type:
> > (0x80070002)
> > /webApplication1/test1.asp, line 3
> >
> > Line 3 is the Server.CreateObject command for the object in question.
> >
> > No error string. The error code, when googled, reveals that it's "file

not
> > found." That's about as useful as a kick in the ass. What am I doing
> > wrong? Why can't my ASP page use this object? If I can only get this
> > functional then I will have no further issues - we can start moving our
> > business logic and data logic from the legacy ASP pages to an

object-based
> > back end. Please help!!

>
> I would strong-name the assembly and place it in the Global Assembly
> Cache (GAC). Since your library is a .NET library, the same rules for
> locating the assembly apply even when running in COM-interop: first the
> GAC is checked, then the current directory (based on the EXE running).
>
> Since your assembly isn't in the GAC, the only place to look would be
> the "current directory" of whatever process is running the ASP page (I'm
> not sure exactly which process that is). Placing it in the GAC will
> alleviate this problem.
>
> --
> Patrick Steele
> Microsoft .NET MVP
> http://weblogs.asp.net/psteele



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
web.config parameters inside compiled ClassLibrary Lupus ASP .Net 1 05-18-2007 02:16 PM
Accessing HttpContext in ClassLibrary? Sami Rehman ASP .Net 4 02-26-2007 02:13 PM
Authentication of legacy .asp pages via ASP.NET Forms Sergey V ASP .Net Security 0 08-10-2006 01:00 PM
Authentication of legacy .asp pages via ASP.NET Forms Sergey V ASP .Net 0 08-10-2006 01:00 PM
WebControlLibrary vs ClassLibrary Poobalam ASP .Net 2 01-12-2006 09:41 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57