Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Global.asax visibility
Message
De
05/05/2008 11:36:55
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01314860
Message ID:
01315137
Vues:
20
Hi Paul,
>>
>>And in the Application_Start Event handler
>>App = New MyApplication.Web.Main.WebApp()
>>
>>When I try to access this member with the full path as suggested I get
>>"Access of a shared member,... through an instance; expression will not be evaluated."
>>
>>Therefore is it because the Application_Start event handler which initialized the member may not be available yet since it is part of the instance of Global.asax?
>>
>
>Application_Start happens pretty early in the init cycle, so it should be set by the time you'd normally access it (depending on where you're trying this, of course. From a normal ASPX page it should have already fired).
>
>Is WebApp or the method you're accessing already static/shared? That would give you an error like this (and really, if it's already flagged that way there isn't any reason to hold an instance of the class in Global.asax, which is the point of the error).

WebApp is not static, but many of the methods are shared. I need the class to be instanced because there is some things that happen essentially when the Global_asax.Application_Start occurs. Ahh, so this is the problem in that I am accessing via a reference to the instance as a shared property in Global_asax and it holds a reference to the instance and the property I am accessing in WebApp is shared and does not belong to that instance. I will need to access the actual class. Man, I should have seen that one.
Thanks a bunch Paul.
Tim
Timothy Bryan
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform