Invalid file name for monitoring

G

Guest

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(String 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.GetCacheDependencies(Hashtable cachedeps, DateTime utcStart) +151
System.Web.Configuration.HttpConfigurationSystem.ComposeConfig(String
reqPath, IHttpMapPath configmap) +697
System.Web.HttpContext.GetCompleteConfigRecord(String 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(Exception e, Boolean canThrow)
+39
System.Web.HttpRuntime.FinishRequest(HttpWorkerRequest wr, HttpContext
context, Exception e) +486
 
G

Guest

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

(e-mail address removed)
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(String 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.GetCacheDependencies(Hashtable cachedeps, DateTime utcStart) +151
System.Web.Configuration.HttpConfigurationSystem.ComposeConfig(String
reqPath, IHttpMapPath configmap) +697
System.Web.HttpContext.GetCompleteConfigRecord(String 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(Exception e, Boolean canThrow)
+39
System.Web.HttpRuntime.FinishRequest(HttpWorkerRequest wr, HttpContext
context, Exception e) +486

User submitted from AEWNET (http://www.aewnet.com/)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top