473,387 Members | 1,760 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,387 software developers and data experts.

Invalid file name for monitoring

I am writing a simple reverse proxy using .Net.

The basic design is to capture all traffic (from all URL's) in an
HttpHandler and the respond accordingly.

The problem is that I when a URL is received that contains a "`" character I
get the exception listed above; and the call stack listed below.

Questions;
1) Where can I find more documentation on the FileChangesMonitor class?
2) Is there anyway to disable the caching via a configuration?
3) Is there someway to hook the HttpRuntime to override this error and to
continue processing?

[HttpException (0x80070057): Invalid file name for monitoring:
'C:\Inetpub\wwwroot\Proxy\~'. File names for monitoring must have absolute
paths, and no wildcards.]
System.Web.DirectoryMonitor.AddFileMonitor(String file) +429
System.Web.DirectoryMonitor.StartMonitoringFile(St ring file,
FileChangeEventHandler callback, String alias) +76
System.Web.FileChangesMonitor.StartMonitoringPath( String alias,
FileChangeEventHandler callback) +495
System.Web.Caching.CacheDependency.Init(Boolean isPublic, Boolean
isSensitive, String[] filenamesArg, String[] cachekeysArg, CacheDependency
dependency, DateTime utcStart) +1535
System.Web.Caching.CacheDependency..ctor(Boolean isSensitive, String[]
filenames, DateTime utcStart) +50

System.Web.Configuration.HttpConfigurationSystem.G etCacheDependencies(Hashtable cachedeps, DateTime utcStart) +151
System.Web.Configuration.HttpConfigurationSystem.C omposeConfig(String
reqPath, IHttpMapPath configmap) +697
System.Web.HttpContext.GetCompleteConfigRecord(Str ing reqpath,
IHttpMapPath configmap) +434
System.Web.HttpContext.GetCompleteConfig() +49
System.Web.HttpContext.GetConfig(String name) +195
System.Web.CustomErrors.GetSettings(HttpContext context, Boolean
canThrow) +20
System.Web.HttpResponse.ReportRuntimeError(Excepti on e, Boolean canThrow)
+39
System.Web.HttpRuntime.FinishRequest(HttpWorkerReq uest wr, HttpContext
context, Exception e) +486


Nov 18 '05 #1
1 5507

I duid find a way to solve this problem.That is you have to include the follwoing code in
Application_error event
the code to be included is

if (Request.Url.ToString().IndexOf("~") > 0)
{
Context.ClearError();
Context.RewritePath("HttpError404.aspx");
return;
}
HttpError404.aspx is the page u want to redirect.Hope u know that.But this only partially solves the problem.When u give it in the file name u wont get the error.But when it is given in the directory name u cant.If u have any sol. by now lemme know

rs*******@yahoo.com
is my mail id

I am writing a simple reverse proxy using .Net.

The basic design is to capture all traffic (from all URL's) in an
HttpHandler and the respond accordingly.

The problem is that I when a URL is received that contains a "`" character I
get the exception listed above; and the call stack listed below.

Questions;
1) Where can I find more documentation on the FileChangesMonitor class?
2) Is there anyway to disable the caching via a configuration?
3) Is there someway to hook the HttpRuntime to override this error and to
continue processing?

[HttpException (0x80070057): Invalid file name for monitoring:
'C:\Inetpub\wwwroot\Proxy\~'. File names for monitoring must have absolute
paths, and no wildcards.]
System.Web.DirectoryMonitor.AddFileMonitor(String file) +429
System.Web.DirectoryMonitor.StartMonitoringFile(St ring file,
FileChangeEventHandler callback, String alias) +76
System.Web.FileChangesMonitor.StartMonitoringPath( String alias,
FileChangeEventHandler callback) +495
System.Web.Caching.CacheDependency.Init(Boolean isPublic, Boolean
isSensitive, String[] filenamesArg, String[] cachekeysArg, CacheDependency
dependency, DateTime utcStart) +1535
System.Web.Caching.CacheDependency..ctor(Boolean isSensitive, String[]
filenames, DateTime utcStart) +50

System.Web.Configuration.HttpConfigurationSystem.G etCacheDependencies(Hashtable cachedeps, DateTime utcStart) +151
System.Web.Configuration.HttpConfigurationSystem.C omposeConfig(String
reqPath, IHttpMapPath configmap) +697
System.Web.HttpContext.GetCompleteConfigRecord(Str ing reqpath,
IHttpMapPath configmap) +434
System.Web.HttpContext.GetCompleteConfig() +49
System.Web.HttpContext.GetConfig(String name) +195
System.Web.CustomErrors.GetSettings(HttpContext context, Boolean
canThrow) +20
System.Web.HttpResponse.ReportRuntimeError(Excepti on e, Boolean canThrow)
+39
System.Web.HttpRuntime.FinishRequest(HttpWorkerReq uest wr, HttpContext
context, Exception e) +486


User submitted from AEWNET (http://www.aewnet.com/)
Nov 19 '05 #2

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

Similar topics

1
by: Ron | last post by:
I am trying to run asp.net pages. The server is accessed via http://sitename/username I have verified it is using port 80 and aspx extensions are configured. But when I run and asp.net page I...
0
by: simpsoro | last post by:
I am trying to run asp.net pages. The server is accessed by students via http://sitename/username I have verified it is using port 80 and aspx extensions are configured. But when I run and...
1
by: Edward Yang | last post by:
I setup web.config with impersonation="true". On our local server the project works great. I did the same procedures on our staging server, but it failed with an impossible error: Server Error in...
0
by: Ron Simpson | last post by:
I am trying to run asp.net pages. The server is accessed via http://sitename/username I have verified it is using port 80 and aspx extensions are configured. But when I run and asp.net page I...
5
by: Jay Ge | last post by:
I searched this issue in internet, but they still cannot solve my issue, so your help/suggestion will be preciated. this page is placed on serverA, and it will touch files on serverB.(but it...
11
by: Brad Quinn | last post by:
I'm undergoing an audit where my web application is supposed to handle (gracefully) a bunch of garbage being throwns at it. When I use the following url I get an error; ...
5
by: Joe | last post by:
I'm getting the following error when trying to call a page on a secure server. I'm not doing any impersonations or file access of any kind. The page is using PayPal and I'm wondering if PayPal has...
0
by: Brian | last post by:
I've deployed a 'URL rewriter' version of our application almost two months ago and it is working great (.NET 1.1, Win2k, IIS5). Since then, I've gotten just FOUR exceptions that look like this: ...
35
by: keerthyragavendran | last post by:
hi i'm downloading a single file using multiple threads... how can i specify a particular range of bytes alone from a single large file... for example say if i need only bytes ranging from...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.