Wednesday, March 28, 2012
System.IO.FileNotFoundException help
me error messages, but this error message does not indicate where it occurs.
There is no page called get_aspx_ver.aspx and I don't know where it's
getting that. Any ideas?
System.IO.FileNotFoundException:
c:\inetpub\wwwroot\framescale\get_aspx_v
er.aspx
at System.Web.UI.TemplateParser.GetParserCacheItem()
at System.Web.UI.TemplateControlParser.CompileAndGetParserCacheItem(String
virtualPath, String inputFile, HttpContext context)
at System.Web.UI.TemplateControlParser.GetCompiledInstance(String
virtualPath, String inputFile, HttpContext context)
at System.Web.UI.PageParser.GetCompiledPageInstanceInternal(String
virtualPath, String inputFile, HttpContext context)
at System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String
requestType, String url, String path)
at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String
requestType, String path, String pathTranslated, Boolean useAppConfig)"When you try to open an ASP.NET Web Application project, the ASP.NET
process accesses a nonexistent file that is named Get_aspx_ver.aspx to
retrieve the ASP.NET version information. If the defaultRedirect attribute
is not set to an HTML file or to an ASP file, the request for the
Get_aspx_ver.aspx file returns the HTTP 404 error and the ASP.NET version
information. If the defaultRedirect attribute is set to an HTML file or to
an ASP file, the request for the Get_aspx_ver.aspx file does not return the
ASP.NET version information. Therefore, you receive the error that is
mentioned in the "Symptoms" section of this article. "
http://support.microsoft.com/defaul...kb;en-us;825792
Also:
http://bluebones.net/news/default.a...ory&story_id=50
"msnews.microsoft.com" <maximus@.portvista.com> wrote in message
news:%23B6kthPSEHA.3944@.TK2MSFTNGP11.phx.gbl...
> Not sure where this error is coming from. I have my asp.net app set to
> me error messages, but this error message does not indicate where it
> occurs.
> There is no page called get_aspx_ver.aspx and I don't know where it's
> getting that. Any ideas?
> System.IO.FileNotFoundException:
> c:\inetpub\wwwroot\framescale\get_aspx_v
er.aspx
> at System.Web.UI.TemplateParser.GetParserCacheItem()
> at System.Web.UI.TemplateControlParser.CompileAndGetParserCacheItem(String
> virtualPath, String inputFile, HttpContext context)
> at System.Web.UI.TemplateControlParser.GetCompiledInstance(String
> virtualPath, String inputFile, HttpContext context)
> at System.Web.UI.PageParser.GetCompiledPageInstanceInternal(String
> virtualPath, String inputFile, HttpContext context)
> at System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String
> requestType, String url, String path)
> at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String
> requestType, String path, String pathTranslated, Boolean useAppConfig)
>
Nice going Microsoft. I'd not being wearing that MVP badge so proudly! lol!
"Ken Cox [Microsoft MVP]" <BANSPAMken_cox@.sympatico.ca> wrote in message
news:e1ie4XQSEHA.568@.TK2MSFTNGP12.phx.gbl...
> "When you try to open an ASP.NET Web Application project, the ASP.NET
> process accesses a nonexistent file that is named Get_aspx_ver.aspx to
> retrieve the ASP.NET version information. If the defaultRedirect attribute
> is not set to an HTML file or to an ASP file, the request for the
> Get_aspx_ver.aspx file returns the HTTP 404 error and the ASP.NET version
> information. If the defaultRedirect attribute is set to an HTML file or to
> an ASP file, the request for the Get_aspx_ver.aspx file does not return
the
> ASP.NET version information. Therefore, you receive the error that is
> mentioned in the "Symptoms" section of this article. "
System.IO.FileNotFoundException help
me error messages, but this error message does not indicate where it occurs.
There is no page called get_aspx_ver.aspx and I don't know where it's
getting that. Any ideas?
System.IO.FileNotFoundException:
c:\inetpub\wwwroot\framescale\get_aspx_ver.aspx
at System.Web.UI.TemplateParser.GetParserCacheItem()
at System.Web.UI.TemplateControlParser.CompileAndGetP arserCacheItem(String
virtualPath, String inputFile, HttpContext context)
at System.Web.UI.TemplateControlParser.GetCompiledIns tance(String
virtualPath, String inputFile, HttpContext context)
at System.Web.UI.PageParser.GetCompiledPageInstanceIn ternal(String
virtualPath, String inputFile, HttpContext context)
at System.Web.UI.PageHandlerFactory.GetHandler(HttpCo ntext context, String
requestType, String url, String path)
at System.Web.HttpApplication.MapHttpHandler(HttpCont ext context, String
requestType, String path, String pathTranslated, Boolean useAppConfig)"When you try to open an ASP.NET Web Application project, the ASP.NET
process accesses a nonexistent file that is named Get_aspx_ver.aspx to
retrieve the ASP.NET version information. If the defaultRedirect attribute
is not set to an HTML file or to an ASP file, the request for the
Get_aspx_ver.aspx file returns the HTTP 404 error and the ASP.NET version
information. If the defaultRedirect attribute is set to an HTML file or to
an ASP file, the request for the Get_aspx_ver.aspx file does not return the
ASP.NET version information. Therefore, you receive the error that is
mentioned in the "Symptoms" section of this article. "
http://support.microsoft.com/defaul...kb;en-us;825792
Also:
http://bluebones.net/news/default.a...ory&story_id=50
"msnews.microsoft.com" <maximus@.portvista.com> wrote in message
news:%23B6kthPSEHA.3944@.TK2MSFTNGP11.phx.gbl...
> Not sure where this error is coming from. I have my asp.net app set to
> email
> me error messages, but this error message does not indicate where it
> occurs.
> There is no page called get_aspx_ver.aspx and I don't know where it's
> getting that. Any ideas?
> System.IO.FileNotFoundException:
> c:\inetpub\wwwroot\framescale\get_aspx_ver.aspx
> at System.Web.UI.TemplateParser.GetParserCacheItem()
> at System.Web.UI.TemplateControlParser.CompileAndGetP arserCacheItem(String
> virtualPath, String inputFile, HttpContext context)
> at System.Web.UI.TemplateControlParser.GetCompiledIns tance(String
> virtualPath, String inputFile, HttpContext context)
> at System.Web.UI.PageParser.GetCompiledPageInstanceIn ternal(String
> virtualPath, String inputFile, HttpContext context)
> at System.Web.UI.PageHandlerFactory.GetHandler(HttpCo ntext context, String
> requestType, String url, String path)
> at System.Web.HttpApplication.MapHttpHandler(HttpCont ext context, String
> requestType, String path, String pathTranslated, Boolean useAppConfig)
Nice going Microsoft. I'd not being wearing that MVP badge so proudly! lol!
"Ken Cox [Microsoft MVP]" <BANSPAMken_cox@.sympatico.ca> wrote in message
news:e1ie4XQSEHA.568@.TK2MSFTNGP12.phx.gbl...
> "When you try to open an ASP.NET Web Application project, the ASP.NET
> process accesses a nonexistent file that is named Get_aspx_ver.aspx to
> retrieve the ASP.NET version information. If the defaultRedirect attribute
> is not set to an HTML file or to an ASP file, the request for the
> Get_aspx_ver.aspx file returns the HTTP 404 error and the ASP.NET version
> information. If the defaultRedirect attribute is set to an HTML file or to
> an ASP file, the request for the Get_aspx_ver.aspx file does not return
the
> ASP.NET version information. Therefore, you receive the error that is
> mentioned in the "Symptoms" section of this article. "
System.IO.FileNotFoundException, When Accessing file in remote ser
it is giving System.IO.FileNotFoundException error. I tried mapping that
server location like "H:\ErrorLogs\error.log" still it gives error. I tried
even giving the server name and directory like
"\\server_name\\Directory\\file.log" still it gives file not found exception.
Does anyone help me fix this.
Thanksuse \\machineIP\sharename\filename
"Raja" <Raja@.discussions.microsoft.com> wrote in message
news:DC182C99-4D78-4A68-BEDC-632DDE49A827@.microsoft.com...
> I am trying to access files in a remote server from my ASP.NET
application,
> it is giving System.IO.FileNotFoundException error. I tried mapping that
> server location like "H:\ErrorLogs\error.log" still it gives error. I
tried
> even giving the server name and directory like
> "\\server_name\\Directory\\file.log" still it gives file not found
exception.
> Does anyone help me fix this.
> Thanks
asp.net normally does not have permission to any network resources. to
access a networked drive, you will have to make the asp_net account a domain
account, or specify the userName and password of a domain account in the web
config <impersonate> tag.
-- bruce (sqlwork.com)
"Raja" <Raja@.discussions.microsoft.com> wrote in message
news:DC182C99-4D78-4A68-BEDC-632DDE49A827@.microsoft.com...
> I am trying to access files in a remote server from my ASP.NET
application,
> it is giving System.IO.FileNotFoundException error. I tried mapping that
> server location like "H:\ErrorLogs\error.log" still it gives error. I
tried
> even giving the server name and directory like
> "\\server_name\\Directory\\file.log" still it gives file not found
exception.
> Does anyone help me fix this.
> Thanks
System.IO.FileNotFoundException using file.copy
was wondering if someone here would be willing to take a stab. I am trying
to copy a file to a network drive. I can do it on the web server but not
from a client. Here is the code:
Dim impersonationContext As
System.Security.Principal.WindowsImpersonationContext
Dim currentWindowsIdentity As System.Security.Principal.WindowsIdentity
currentWindowsIdentity
=CType(User.Identity,System.Security.Principal.WindowsIdentity)
impersonationContext = currentWindowsIdentity.Impersonate()
dim Temp as string="TestFile"
File.Copy("\\MyServer\Template.doc", "\\MyServer\" & Temp &".doc")
impersonationContext.Undo()
I get the error "System.IO.FileNotFoundException: Could not find file
\\Server\File..." when running it from the [authenticated] client browse
r.
I searched everywhere on the web and MSDN on this error but found nothing.
The error it occurs on the file copy statement The file.copy statement is
trying to copy a file on a different server than the web server.
Any help is appreciated.
P.S. The web server is a backup domain w2k controller also, and the asp.net
user had to be changed to IWAM_Machine.to copy to another server you need to impersonate a primary token, not an
impersonation. to quickly test this, on the actual server, run ie and test -
it should work because the principal will be a primary token, if not, turn
off anonymous.
to get around this, your code will need to logon as a domain account with
enough permission to do the copy.
-- bruce (sqlwork.com)
"Stephen Witter" <switter@.enpathmed.com> wrote in message
news:#XzRmfOREHA.2408@.tk2msftngp13.phx.gbl...
> I had previously posted this on the security ng, but haven't had a hit so
I
> was wondering if someone here would be willing to take a stab. I am
trying
> to copy a file to a network drive. I can do it on the web server but not
> from a client. Here is the code:
> Dim impersonationContext As
> System.Security.Principal.WindowsImpersonationContext
> Dim currentWindowsIdentity As
System.Security.Principal.WindowsIdentity
> currentWindowsIdentity
> =CType(User.Identity,System.Security.Principal.WindowsIdentity)
> impersonationContext = currentWindowsIdentity.Impersonate()
> dim Temp as string="TestFile"
> File.Copy("\\MyServer\Template.doc", "\\MyServer\" & Temp &".doc")
> impersonationContext.Undo()
> I get the error "System.IO.FileNotFoundException: Could not find file
> \\Server\File..." when running it from the [authenticated] client brow
ser.
> I searched everywhere on the web and MSDN on this error but found nothing.
> The error it occurs on the file copy statement The file.copy statement is
> trying to copy a file on a different server than the web server.
> Any help is appreciated.
> P.S. The web server is a backup domain w2k controller also, and the
asp.net
> user had to be changed to IWAM_Machine.
>
The funny thing is I have tried to run the process from every server, even
the one where the file resides (and where it is being copied to), and they
all give the same message, that is, that the file does not exist. The only
place it works is on the web server. Anonymous access is turn off on the web
site.
I added the following code to test it:
Dim FilePermission As New FileIOPermission(FileIOPermissionAccess.AllAccess,
" \\MyServer\MyShare\SomeDirectory\Templat
e.doc") FilePermission.Assert()
If System.IO.File.Exists(" \\MyServer\MyShare\SomeDirectory\Templat
e.doc")
then
response.write("OK User: ") response.write(User.Identity.Name)
response.end
Else
Try
FilePermission.Demand()
response.write("Exists But Access Denied , User: ")
response.write(User.Identity.Name)
Catch se As Exception
response.write("Realy doesn't exist")
End Try
End If
It always returns "Exists But Access Denied , User: DOMAIN\User"
Thanks for your reply though. I know these situations can be caused by alot
of different factors.
"bruce barker" <nospam_brubar@.safeco.com> wrote in message
news:u3sAi2OREHA.2716@.tk2msftngp13.phx.gbl...
> to copy to another server you need to impersonate a primary token, not an
> impersonation. to quickly test this, on the actual server, run ie and
test -
> it should work because the principal will be a primary token, if not, turn
> off anonymous.
> to get around this, your code will need to logon as a domain account with
> enough permission to do the copy.
> -- bruce (sqlwork.com)
> "Stephen Witter" <switter@.enpathmed.com> wrote in message
> news:#XzRmfOREHA.2408@.tk2msftngp13.phx.gbl...
so
> I
> trying
not
> System.Security.Principal.WindowsIdentity
browser.
nothing.
is
> asp.net
>
System.IO.FileNotFoundException using file.copy
was wondering if someone here would be willing to take a stab. I am trying
to copy a file to a network drive. I can do it on the web server but not
from a client. Here is the code:
Dim impersonationContext As
System.Security.Principal.WindowsImpersonationCont ext
Dim currentWindowsIdentity As System.Security.Principal.WindowsIdentity
currentWindowsIdentity
=CType(User.Identity,System.Security.Principal.Win dowsIdentity)
impersonationContext = currentWindowsIdentity.Impersonate()
dim Temp as string="TestFile"
File.Copy("\\MyServer\Template.doc", "\\MyServer\" & Temp &".doc")
impersonationContext.Undo()
I get the error "System.IO.FileNotFoundException: Could not find file
\\Server\File..." when running it from the [authenticated] client browser.
I searched everywhere on the web and MSDN on this error but found nothing.
The error it occurs on the file copy statement The file.copy statement is
trying to copy a file on a different server than the web server.
Any help is appreciated.
P.S. The web server is a backup domain w2k controller also, and the asp.net
user had to be changed to IWAM_Machine.to copy to another server you need to impersonate a primary token, not an
impersonation. to quickly test this, on the actual server, run ie and test -
it should work because the principal will be a primary token, if not, turn
off anonymous.
to get around this, your code will need to logon as a domain account with
enough permission to do the copy.
-- bruce (sqlwork.com)
"Stephen Witter" <switter@.enpathmed.com> wrote in message
news:#XzRmfOREHA.2408@.tk2msftngp13.phx.gbl...
> I had previously posted this on the security ng, but haven't had a hit so
I
> was wondering if someone here would be willing to take a stab. I am
trying
> to copy a file to a network drive. I can do it on the web server but not
> from a client. Here is the code:
> Dim impersonationContext As
> System.Security.Principal.WindowsImpersonationCont ext
> Dim currentWindowsIdentity As
System.Security.Principal.WindowsIdentity
> currentWindowsIdentity
> =CType(User.Identity,System.Security.Principal.Win dowsIdentity)
> impersonationContext = currentWindowsIdentity.Impersonate()
> dim Temp as string="TestFile"
> File.Copy("\\MyServer\Template.doc", "\\MyServer\" & Temp &".doc")
> impersonationContext.Undo()
> I get the error "System.IO.FileNotFoundException: Could not find file
> \\Server\File..." when running it from the [authenticated] client browser.
> I searched everywhere on the web and MSDN on this error but found nothing.
> The error it occurs on the file copy statement The file.copy statement is
> trying to copy a file on a different server than the web server.
> Any help is appreciated.
> P.S. The web server is a backup domain w2k controller also, and the
asp.net
> user had to be changed to IWAM_Machine.
The funny thing is I have tried to run the process from every server, even
the one where the file resides (and where it is being copied to), and they
all give the same message, that is, that the file does not exist. The only
place it works is on the web server. Anonymous access is turn off on the web
site.
I added the following code to test it:
Dim FilePermission As New FileIOPermission(FileIOPermissionAccess.AllAccess,
"\\MyServer\MyShare\SomeDirectory\Template.doc") FilePermission.Assert()
If System.IO.File.Exists("\\MyServer\MyShare\SomeDirectory\Template.doc")
then
response.write("OK User: ") response.write(User.Identity.Name)
response.end
Else
Try
FilePermission.Demand()
response.write("Exists But Access Denied , User: ")
response.write(User.Identity.Name)
Catch se As Exception
response.write("Realy doesn't exist")
End Try
End If
It always returns "Exists But Access Denied , User: DOMAIN\User"
Thanks for your reply though. I know these situations can be caused by alot
of different factors.
"bruce barker" <nospam_brubar@.safeco.com> wrote in message
news:u3sAi2OREHA.2716@.tk2msftngp13.phx.gbl...
> to copy to another server you need to impersonate a primary token, not an
> impersonation. to quickly test this, on the actual server, run ie and
test -
> it should work because the principal will be a primary token, if not, turn
> off anonymous.
> to get around this, your code will need to logon as a domain account with
> enough permission to do the copy.
> -- bruce (sqlwork.com)
> "Stephen Witter" <switter@.enpathmed.com> wrote in message
> news:#XzRmfOREHA.2408@.tk2msftngp13.phx.gbl...
> > I had previously posted this on the security ng, but haven't had a hit
so
> I
> > was wondering if someone here would be willing to take a stab. I am
> trying
> > to copy a file to a network drive. I can do it on the web server but
not
> > from a client. Here is the code:
> > Dim impersonationContext As
> > System.Security.Principal.WindowsImpersonationCont ext
> > Dim currentWindowsIdentity As
> System.Security.Principal.WindowsIdentity
> > currentWindowsIdentity
> > =CType(User.Identity,System.Security.Principal.Win dowsIdentity)
> > impersonationContext = currentWindowsIdentity.Impersonate()
> > dim Temp as string="TestFile"
> > File.Copy("\\MyServer\Template.doc", "\\MyServer\" & Temp &".doc")
> > impersonationContext.Undo()
> > I get the error "System.IO.FileNotFoundException: Could not find file
> > \\Server\File..." when running it from the [authenticated] client
browser.
> > I searched everywhere on the web and MSDN on this error but found
nothing.
> > The error it occurs on the file copy statement The file.copy statement
is
> > trying to copy a file on a different server than the web server.
> > Any help is appreciated.
> > P.S. The web server is a backup domain w2k controller also, and the
> asp.net
> > user had to be changed to IWAM_Machine.
System.IO.FileNotFoundException, When Accessing file in remote ser
it is giving System.IO.FileNotFoundException error. I tried mapping that
server location like "H:\ErrorLogs\error.log" still it gives error. I tried
even giving the server name and directory like
"\\server_name\\Directory\\file.log" still it gives file not found exception
.
Does anyone help me fix this.
Thanksuse \\machineIP\sharename\filename
"Raja" <Raja@.discussions.microsoft.com> wrote in message
news:DC182C99-4D78-4A68-BEDC-632DDE49A827@.microsoft.com...
> I am trying to access files in a remote server from my ASP.NET
application,
> it is giving System.IO.FileNotFoundException error. I tried mapping that
> server location like "H:\ErrorLogs\error.log" still it gives error. I
tried
> even giving the server name and directory like
> "\\server_name\\Directory\\file.log" still it gives file not found
exception.
> Does anyone help me fix this.
> Thanks
asp.net normally does not have permission to any network resources. to
access a networked drive, you will have to make the asp_net account a domain
account, or specify the userName and password of a domain account in the web
config <impersonate> tag.
-- bruce (sqlwork.com)
"Raja" <Raja@.discussions.microsoft.com> wrote in message
news:DC182C99-4D78-4A68-BEDC-632DDE49A827@.microsoft.com...
> I am trying to access files in a remote server from my ASP.NET
application,
> it is giving System.IO.FileNotFoundException error. I tried mapping that
> server location like "H:\ErrorLogs\error.log" still it gives error. I
tried
> even giving the server name and directory like
> "\\server_name\\Directory\\file.log" still it gives file not found
exception.
> Does anyone help me fix this.
> Thanks