T
Thomas
Hi,
I have written a simple web application in asp.net 1.1.4322. following
is the code written in Page_Load
private void Page_Load(object sender, System.EventArgs e)
{
string str = System.Windows.Forms.Application.ExecutablePath
Response.Write(str);
}
string str = System.Windows.Forms.Application.ExecutablePath statement
throws following exception
-- System.ArgumentException: Illegal characters in path
What could be the reason behind this? This method is used in our web
application to get the calling applications name (aspnet_wp or
w3wp.exe).
Please help as this need to be resolved as soon as possible.
Stack trace Detail
[ArgumentException: Illegal characters in path.]
System.Security.Permissions.FileIOPermission.HasIllegalCharacters(String[]
str) +276
System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess
access, String[] pathListOrig, Boolean checkForDuplicates, Boolean
needFullPath, Boolean copyPathList) +88
System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess
access, String[] pathList, Boolean checkForDuplicates, Boolean
needFullPath) +43
System.IO.Path.GetFullPath(String path) +82
System.Windows.Forms.IntSecurity.UnsafeGetFullPath(String fileName)
+83
System.Windows.Forms.Application.get_ExecutablePath() +148
Path.WebForm1.Page_Load(Object sender, EventArgs e) in
f:\temp\path\webform1.aspx.cs:23
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
I have written a simple web application in asp.net 1.1.4322. following
is the code written in Page_Load
private void Page_Load(object sender, System.EventArgs e)
{
string str = System.Windows.Forms.Application.ExecutablePath
Response.Write(str);
}
string str = System.Windows.Forms.Application.ExecutablePath statement
throws following exception
-- System.ArgumentException: Illegal characters in path
What could be the reason behind this? This method is used in our web
application to get the calling applications name (aspnet_wp or
w3wp.exe).
Please help as this need to be resolved as soon as possible.
Stack trace Detail
[ArgumentException: Illegal characters in path.]
System.Security.Permissions.FileIOPermission.HasIllegalCharacters(String[]
str) +276
System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess
access, String[] pathListOrig, Boolean checkForDuplicates, Boolean
needFullPath, Boolean copyPathList) +88
System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess
access, String[] pathList, Boolean checkForDuplicates, Boolean
needFullPath) +43
System.IO.Path.GetFullPath(String path) +82
System.Windows.Forms.IntSecurity.UnsafeGetFullPath(String fileName)
+83
System.Windows.Forms.Application.get_ExecutablePath() +148
Path.WebForm1.Page_Load(Object sender, EventArgs e) in
f:\temp\path\webform1.aspx.cs:23
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750