473,320 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Mapping Paths with no context

I have overridden HttpApplication in my class library.

When my application starts, There are configuration files that I need to
load in order for my application to work correctly. This works great,
however, I now have a config file that I need that is located on a
virtual mapped path within iis.

During my HtppApplication load, I have no HttpContext, hence my problem.
How do I map a path when I have no Current Context?
string _VirtualPath = "/settings.config";

System.Web.HttpContext context =
System.Web.HttpContext.Current;
if (File.Exists(System.Web.HttpRuntime.AppDomainAppPa th + _VirtualPath))
{
_PhysicalPath =
System.Web.HttpRuntime.AppDomainAppPath + _VirtualPath;
}
else if (context != null)
{
_PhysicalPath = context.Server.MapPath(_VirtualPath);
}


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #1
0 1183

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Jerry Sievers | last post by:
Fellow Pythonists; I am totally puzzled on the use of slicing on mapping types and especially unsure on use of the Ellipsis... and slicing syntax that has two or more groups seperated by comma....
24
by: Lovely Angel | last post by:
Dear Friends Hope you doing great. I have recently shifted to a webhost which is Using Windows 2003 and IIS 6. Now my application was working fine earlier but now I am facing this problem ...
4
by: Jozef | last post by:
Hello, I was wondering, is it possible to add to a recordset? i.e. I create a DAO recordset with information from one SQL statment, and add records from another SQL statement (which grabs info...
5
by: Kevin C | last post by:
I was curious to know what some developers out in the industry are doing when it comes to exposing Data access logic, specifically persistence. This is assuming that your not using an O/R framework...
2
by: Les Caudle | last post by:
I've gotten url mapping to work perfectly while running in VS 2005 Cassini debug mode. I simply added this to web.config <urlMappings enabled="true"> <add url="~/school"...
6
by: Jon Slaughter | last post by:
do I have to prefix every absolute path with document root to get it to work? For some reason I thought that prefixing a path with '/' or './' with make it absolute w.r.t to document root but I...
0
by: somnathmali | last post by:
Suppose I have site xyz.com. Site has a page called show_user.aspx where I need to access the Session variables. But this show_user.aspx page will not be called directly Instead , when user type...
15
by: Lars Eighner | last post by:
Aside from the deaths of a few extra electrons to spell out the whole root relative path, is there any down side? It seems to me that theoretically it shouldn't make any difference, and it would...
10
by: =?Utf-8?B?Z3JlYXRiYXJyaWVyODY=?= | last post by:
Sorry about that previous one. I pressed enter too early. How does one go about mapping a network drive in C#. i know you use MapNetworkDrive in scripting languages, but i'm not sure how to do it...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.