|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
CTL_E_PERMISSIONDENIEDI am getting an exception trying to run a simple aspx page. This is causing the error: objCount = objFSO.CreateTextFile("counter.txt", True). I have gone through my default web page settings and the ntfs setting for counter.txt. Could someone please point me to the correct IIS server configuration settings and ntfs setting so that I can run this page (and many others). Thanks. Server Error in '/' Application. -------------------------------------------------------------------------------- Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: System.Security.SecurityException: Exception from HRESULT: 0x800A0046 (CTL_E_PERMISSIONDENIED) Source File: c:\inetpub\wwwroot\hitit.aspx Line: 27 Source Error: Line 25: visitorcount = visitorcount + 1 Line 26: objCount.close Line 27: objCount = objFSO.CreateTextFile("counter.txt", True) Line 28: objCount.WriteLine(visitorcount) Line 29: end if Hi,
You probably need to change the trust level of your application to "Full" trust, in order to use the FSO to write files. This can be done in web.config. It is not an IIS or NTFS setting, but a .NET Framework setting Cheers Ken Show quoteHide quote "MikeV06" <m*@privacy.net> wrote in message news:pfeyrkpfobov.dlg@mycomputer06.invalid.com... : IIS 6 on Win2003 with Net 2.0 : : I am getting an exception trying to run a simple aspx page. This is causing : the error: objCount = objFSO.CreateTextFile("counter.txt", True). I have : gone through my default web page settings and the ntfs setting for : counter.txt. Could someone please point me to the correct IIS server : configuration settings and ntfs setting so that I can run this page (and : many others). Thanks. : : : Server Error in '/' Application. : -------------------------------------------------------------------------------- : : Security Exception : Description: The application attempted to perform an operation not allowed : by the security policy. To grant this application the required permission : please contact your system administrator or change the application's trust : level in the configuration file. : : Exception Details: System.Security.SecurityException: Exception from : HRESULT: 0x800A0046 (CTL_E_PERMISSIONDENIED) : : : Source File: c:\inetpub\wwwroot\hitit.aspx Line: 27 : : Source Error: : Line 25: visitorcount = visitorcount + 1 : Line 26: objCount.close : Line 27: objCount = objFSO.CreateTextFile("counter.txt", True) : Line 28: objCount.WriteLine(visitorcount) : Line 29: end if : : : On Wed, 5 Apr 2006 16:13:22 +1000, Ken Schaefer wrote:
> Hi, Thanks for the reply. I have a web.config file in the web root directory> > You probably need to change the trust level of your application to "Full" > trust, in order to use the FSO to write files. > > This can be done in web.config. > > It is not an IIS or NTFS setting, but a .NET Framework setting > > Cheers > Ken that says: <?xml version="1.0" encoding="utf-8"?> <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"> <appSettings> <add key="hitit.aspx" value="full" /> </appSettings> </configuration> I have dug through help files until I am about blind. Is this the correct syntax? It does not work with this? Thanks. You need to add a <trust> element, specifying a "full" level. See the
documentation here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrftrustsection.asp If this is a hosted site, your hosting company may have restricted you to a lower trust level, which you can't just override to a higher level inside your website. In that case you'd need to speak to your hosting company. Cheers Ken Show quoteHide quote "MikeV06" <m*@privacy.net> wrote in message xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">news:1cuosohizh4tk$.dlg@mycomputer06.invalid.com... : On Wed, 5 Apr 2006 16:13:22 +1000, Ken Schaefer wrote: : : > Hi, : > : > You probably need to change the trust level of your application to "Full" : > trust, in order to use the FSO to write files. : > : > This can be done in web.config. : > : > It is not an IIS or NTFS setting, but a .NET Framework setting : > : > Cheers : > Ken : : Thanks for the reply. I have a web.config file in the web root directory : that says: : : <?xml version="1.0" encoding="utf-8"?> : <configuration Show quoteHide quote : <appSettings> : <add key="hitit.aspx" value="full" /> : </appSettings> : </configuration> : : I have dug through help files until I am about blind. Is this the correct : syntax? It does not work with this? : : Thanks. On Fri, 7 Apr 2006 10:23:39 +1000, Ken Schaefer wrote:
> You need to add a <trust> element, specifying a "full" level. See the I believe the problem may lie with trying to run asp ver 1x code on an asp> documentation here: > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrftrustsection.asp > > If this is a hosted site, your hosting company may have restricted you to a > lower trust level, which you can't just override to a higher level inside > your website. In that case you'd need to speak to your hosting company. > > Cheers > Ken ver 2.0 system. IIIUC, the code I am trying to execute is client side code which cannot write to a local disk. Hence, the error. I think I need to create a code behind page and let it do the work on the server. At least, that is the direction I am now pursuing. Thank you for your help though. "MikeV06" <m*@privacy.net> wrote in message
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrftrustsection.asp
news:204eakfjb34y.dlg@mycomputer06.invalid.com... : On Fri, 7 Apr 2006 10:23:39 +1000, Ken Schaefer wrote: : : > You need to add a <trust> element, specifying a "full" level. See the : > documentation here: : > Show quote Hide quote : > Hi: > If this is a hosted site, your hosting company may have restricted you to a : > lower trust level, which you can't just override to a higher level inside : > your website. In that case you'd need to speak to your hosting company. : > : > Cheers : > Ken : : I believe the problem may lie with trying to run asp ver 1x code on an asp : ver 2.0 system. IIIUC, the code I am trying to execute is client side code : which cannot write to a local disk. Hence, the error. I think I need to : create a code behind page and let it do the work on the server. At least, : that is the direction I am now pursuing. ASP.NET code runs entirely on the server. All that the client sees is plain HTML, CSS, Javascript etc. Changing the .NET version on the server might only change the actual HTML output to the client, but doesn't change any permissions on the client. You can't do that from the server. Cheers Ken On Mon, 10 Apr 2006 09:42:20 +1000, Ken Schaefer wrote:
> I had to make liberal use of runat="server" as well as create a user> Hi > > ASP.NET code runs entirely on the server. All that the client sees is plain > HTML, CSS, Javascript etc. Changing the .NET version on the server might > only change the actual HTML output to the client, but doesn't change any > permissions on the client. You can't do that from the server. > > Cheers > Ken control (.ascx) page to do the actual computations. Once I did that, things started to run. Thanks for the pointers.
Do I really need a wild card certificate ?
Restricting IIS from serving static content Security of Webpage Iusr_Servername NetworkPrinter Simple Anonymous Access question Common Name question Communicator Web Access Authentication Not Working BIN Directory being hidden automatically Security trimming with impersonation Windows cannot unload your registry file |
|||||||||||||||||||||||