To do not need to test if theses directories have been created every place on the application, I decided to test (and create, if necessary) on Application_Start() of Global.asax.cs. But I dont know how to get the Application root path inside this method, since dont have Request to use on request.ServerVariables["APPL_PHYSICAL_PATH"]; Any suggestions? [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => Leonardo [ip] => gangemi@ig.com. [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 1 [islastshown] => [isfirstshown] => 1 [attachments] => [allattachments] => ) --> > > > > > > To do not need to test if theses directories have been created every place > on the application, I decided to test (and create, if necessary) on > Application_Start() of Global.asax.cs. > But I dont know how to get the Application root path inside this method, > since dont have Request to use on > request.ServerVariables["APPL_PHYSICAL_PATH"]; > > Any suggestions? > > > >[/ref] [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => <#WnTTdqYDHA.1784@TK2MSFTNGP09.phx.gbl> [ref] => [htmlstate] => on_nl2br [postusername] => Kevin [ip] => kevin@takempis. [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 4 [islastshown] => 1 [isfirstshown] => [attachments] => [allattachments] => ) --> Creating diretories on Application_Start - ASP.NET General

Creating diretories on Application_Start - ASP.NET General

I defined some diretories in the Web.config that can be changed without recompiling. This should be directories relative to the application directory. e.g: <!-- for log files --> <add key="RelativeLogDir" value="log\" /> <!--for files generated for other applications --> <add key="RelativeExportDir" value="export\" /> To do not need to test if theses directories have been created every place on the application, I decided to test (and create, if necessary) on Application_Start() of Global.asax.cs. But I dont know how to get the Application root path inside this method, since dont have Request to use on request.ServerVariables["APPL_PHYSICAL_PATH"]; Any suggestions?...

  1. #1

    Default Creating diretories on Application_Start

    I defined some diretories in the Web.config that can be changed without
    recompiling.
    This should be directories relative to the application directory.

    e.g:

    <!-- for log files -->
    <add key="RelativeLogDir" value="log\" />

    <!--for files generated for other applications -->
    <add key="RelativeExportDir" value="export\" />

    To do not need to test if theses directories have been created every place
    on the application, I decided to test (and create, if necessary) on
    Application_Start() of Global.asax.cs.
    But I dont know how to get the Application root path inside this method,
    since dont have Request to use on
    request.ServerVariables["APPL_PHYSICAL_PATH"];

    Any suggestions?




    Leonardo Guest

  2. #2

    Default Re: Creating diretories on Application_Start

    > Any suggestions?

    Yes, I have a few. (1) Contract it out. (2) Hire someone who is smarter than
    you. (3) Get a job bagging groceries at the local supermarket.


    Guenther Guest

  3. #3

    Default Re: Creating diretories on Application_Start

    If you think you´re smarter than me, you could give a solution for the
    problem, instead of saying bull!


    "Guenther Liebowitz" <com> wrote in message
    news:phx.gbl... 
    >
    > Yes, I have a few. (1) Contract it out. (2) Hire someone who is smarter[/ref]
    than 


    Leonardo Guest

  4. #4

    Default Re: Creating diretories on Application_Start

    If I understand you correctly, the value you are looking for is:

    AppDomain.CurrentDomain.BaseDirectory


    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    Neither a follower nor a lender be.


    "Leonardo Gangemi" <com.br> wrote in message
    news:phx.gbl... 


    Kevin Guest

Similar Threads

  1. Web Service throws exception during Application_Start
    By fm@newsgroups.nospam in forum ASP.NET Web Services
    Replies: 7
    Last Post: December 15th, 04:19 PM
  2. application_start in webservices
    By mekim in forum ASP.NET Web Services
    Replies: 1
    Last Post: November 24th, 12:43 AM
  3. Application_Start event
    By Nissim in forum ASP.NET Web Services
    Replies: 5
    Last Post: January 15th, 03:19 AM
  4. Application_Start fails
    By Anne Too in forum ASP.NET General
    Replies: 0
    Last Post: August 10th, 02:23 PM
  5. Application_Start not firing at all
    By Adrian in forum ASP.NET General
    Replies: 0
    Last Post: July 2nd, 03:07 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •