Showing posts with label permissions. Show all posts
Showing posts with label permissions. Show all posts

Wednesday, March 28, 2012

System.IO.StreamWriter -- Access to path is denied

Hi, I am trying to use the System.IO.StreamWriter to write to a file, and am getting an error that I have to set permissions for doing this in IIS -- I don't remember how to do this. Does anyone know how?

(Win XP Pro)


System.IO.StreamWriter writer = new System.IO.StreamWriter(@dotnet.itags.org."C:\NetApplicationTest",true);
Hi, u need to add aspNet User to the folder u trying to accessing and give the account have the permission to write/read it in the folder or file.

If u cant see any security tab on ur folder option, do tis below in any folder:
Tools>Folder Options>View>uncheck this "use simple file sharing(Recommended)"

then go to ur file's folder , note: folder
right click then properties> Security>Add > Advance> Find now>
Then u select ASPNET and add it, and set ASPNET to full control.

Hope tis help
life's Ng
beauty, thanks very much! -- I guess that I should study some XP Admin stuff... thanks 'gain ..

Monday, March 26, 2012

system.net permissions error

hey all,
i'm getting a systems.net permissions error on my page and not sure how to
resolve it. i've narrowed it down to one method. do i need to add an
attribute to that method for it to work or something?

thanks,
rodcharShow us your exact error - - -

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com
"rodchar" <rodchar@.discussions.microsoft.comwrote in message
news:3E53D057-5BCA-44FB-BFDD-FA62C00CD4F0@.microsoft.com...

Quote:

Originally Posted by

hey all,
i'm getting a systems.net permissions error on my page and not sure how to
resolve it. i've narrowed it down to one method. do i need to add an
attribute to that method for it to work or something?
>
thanks,
rodchar


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: Request for the
permission of type 'System.Net.WebPermission, System, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

"David Wier" wrote:

Quote:

Originally Posted by

Show us your exact error - - -
>
--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com
>
>
"rodchar" <rodchar@.discussions.microsoft.comwrote in message
news:3E53D057-5BCA-44FB-BFDD-FA62C00CD4F0@.microsoft.com...

Quote:

Originally Posted by

hey all,
i'm getting a systems.net permissions error on my page and not sure how to
resolve it. i've narrowed it down to one method. do i need to add an
attribute to that method for it to work or something?

thanks,
rodchar


>
>
>


i posted more details on my site:
http://www25.brinkster.com/rodchar/test.htm
the gist is i'm using Authorize.Net's credit card validation script for
asp.net and i'm deploying to NetworkSolutions Host Servers and i'm getting
this error. But it works on my local machine(that's a new one huh?)

any ideas would be greatly appreciated

"rodchar" wrote:

Quote:

Originally Posted by

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: Request for the
permission of type 'System.Net.WebPermission, System, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
>
"David Wier" wrote:
>

Quote:

Originally Posted by

Show us your exact error - - -

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com
"rodchar" <rodchar@.discussions.microsoft.comwrote in message
news:3E53D057-5BCA-44FB-BFDD-FA62C00CD4F0@.microsoft.com...

Quote:

Originally Posted by

hey all,
i'm getting a systems.net permissions error on my page and not sure how to
resolve it. i've narrowed it down to one method. do i need to add an
attribute to that method for it to work or something?
>
thanks,
rodchar