PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

ASP.Net Apps and shared code

 
 
Web Team @ Borough of Poole
Guest
Posts: n/a
 
      5th Aug 2005
Hi All,

Currently, our site is configured like this:

/netapps <- Configured as an application in IIS
/netapps/bin <- Contains all DLLS for all apps
/netapps/appname1 <- These are not configured as app in IIS
/netapps/appname2
/netapps/appame3 (Etc!)

This works fine, apart from recently when we put a new app live which
will not work, unless...

a) The appfolder (/netapps/gis) is configured as an application
and...
b)in IIS and the DLLS are within /netapps/gis/bin

If I run /netapps/badapp without it being an app, I et the following
error:

-
Object reference not set to an instance of an object.
-


If I run /netapps/badapp as an application without its own bin
directory, I get the following error:

-
Parser Error Message: Could not load type 'gis.Global'.
Source Error:
Line 1: <%@ Application Codebehind="Global.asax.vb"
Inherits="gis.Global" %>
-

I believe this is related to the session.onstart events.

/netapps/badapp/global.asax reads:
<%@ Application Codebehind="Global.asax.vb" Inherits="gis.Global" %>

Problem is, there is also a /netapps/global.asax, which reads:
<%@ Application Codebehind="Global.asax.vb"
inherits="misconepagers.Global" %>
So I can't simply copy /netapps/gis to /netapps/
(misconepagers works AOK)


Any ideas/suggestions will be much appreciated.


Thanks!

Simon.

 
Reply With Quote
 
 
 
 
Lucas Tam
Guest
Posts: n/a
 
      5th Aug 2005
"Web Team @ Borough of Poole" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> Problem is, there is also a /netapps/global.asax, which reads:
> <%@ Application Codebehind="Global.asax.vb"
> inherits="misconepagers.Global" %>
> So I can't simply copy /netapps/gis to /netapps/
> (misconepagers works AOK)
>
>
> Any ideas/suggestions will be much appreciated.


As you've found out... you'll need to create /netapps/gis as an
application. Since the gis application has it's own Global.ASAX, it'll need
it's own application so that global.asax is executed when the application
is started.

If you want to avoid this situation... perhaps you could manually move some
of the global.asax from netapps/gis to /netapps (i.e. copy and paste blocks
of code to the parent application...)

--
Lucas Tam ((E-Mail Removed))
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
 
Reply With Quote
 
Web Team @ Borough of Poole
Guest
Posts: n/a
 
      6th Aug 2005
I see - This makes sense, not sure how I missed that, clue being in the
'application.onstart' :-)

Hi Lucas, thanks for your reply.

I guess this means that my code for /netapps/gis will start when ever
anyone accesses /netapps/anyapp?

Perhaps we've got our site setup wrong? The main reason we did this was
to avoid having multiple copies of commoncode.dll within app folders.

Perhaps I should be setup like this?...

/netapps/app1 <- Setup as an app in IIS
/netapps/app2 (Etc!) <- Setup as an app in IIS

Then put shared code assemblies in the GAC (Global Assembly Cache) - Is
this the right tool for the job?

Thanks!

Simon.

 
Reply With Quote
 
Lucas Tam
Guest
Posts: n/a
 
      6th Aug 2005
"Web Team @ Borough of Poole" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> I guess this means that my code for /netapps/gis will start when ever
> anyone accesses /netapps/anyapp?


Hi,

I believe .NET looks in the root of the application directory for the
web.config and Global.asax. It won't start sub-directory global.asax's.


> Perhaps I should be setup like this?...
>
> /netapps/app1 <- Setup as an app in IIS
> /netapps/app2 (Etc!) <- Setup as an app in IIS


Yes, that is what I typically do : )


> Then put shared code assemblies in the GAC (Global Assembly Cache)


Unfortunately I'm not too familar with the GAC... maybe someone in here
will know if the GAC is the place to store common dlls.

I typically redistribute the commonfiles.dll across all my apps (In my
case, my commonfiles.dll are pretty static and don't change often over
time).

--
Lucas Tam ((E-Mail Removed))
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
 
Reply With Quote
 
Web Team @ Borough of Poole
Guest
Posts: n/a
 
      8th Aug 2005
Thanks Lucas,

I've found some info on using the GAC:

"Each computer where the common language runtime is installed has a
machine-wide code cache called the global assembly cache. The global
assembly cache stores assemblies specifically designated to be shared
by several applications on the computer."
(From:
http://msdn.microsoft.com/library/de...emblycache.asp)

Sounds ideal! I'll try to remember to post back here with how it
goes.

Simon.

 
Reply With Quote
 
Van Lewis
Guest
Posts: n/a
 
      21st Oct 2005
Shane posted this response that worked for me in another news group
after all the other ideas to delete the site, rebuild, etc didn't work.

http://forums.hotscripts.com/showthread.php?p=23590


The error is coming from the global.asax.vb file, not your
RegistrationForm. Open up your global.asax.vb file (the code-behind file
for the global.asax file) and make sure it's class name is Global and
it's in the UserRegistrationApp namespace.

Putting the Global.aspx.vb in the same namespace as the web page fixed
the problem.



*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Can I Share a MDE (which only has VBA Code) with other apps? G Microsoft Access VBA Modules 1 2nd Jun 2010 04:27 AM
Running .NET apps from shared folders Adam Microsoft Dot NET Framework 1 11th Mar 2010 01:53 PM
Deploying apps with the aspx code Tony Moaikel Microsoft ASP .NET 4 10th Nov 2005 03:57 PM
All apps can use shared printer, except AutoCAD Tom Del Rosso Microsoft Windows 2000 Printing 0 10th Aug 2005 05:32 AM
multiboot-w/2XP partitions - shared apps? =?Utf-8?B?am9qbw==?= Windows XP Setup 2 28th Dec 2003 12:46 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:27 AM.