Subject: Request for the permission of type 'System.Net.Web
Posted By: paranthaman Post Date: 8/21/2006 9:41:02 AM
hi

We are using some class in .NET like
System.Net
System.Net.Sockets
in our page. We used these classes to get the file from another ftp server, but we are getting an error regarding security.

like

 

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

 

We also tried to solve this security issue by adding some permission tags in web.config file like


  <location allowOverride="true">  
  <system.web>

  <trust  level="Full"/>


Server Error in '/' Application.
--------------------------------------------------------------------------------

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: This configuration section cannot be used at this path.  This happens when the site administrator has locked access to this section using <location allowOverride="false"> from an inherited configuration file.

Source Error:

Line 4:    <system.web>
Line 5:  
Line 6:    <trust  level="Full"/>
Line 7:  
Line 8:      <!--  DYNAMIC DEBUG COMPILATION

Even this didn't help us it gives some other error like "Administrator has locked the access". Please  

any one can suggest me

 

 


--------------------------------------------------------------------------------
Paranthaman R

Reply By: dparsons Reply Date: 8/21/2006 10:16:09 AM
The default ASP.NET user account (normally IWAM_[machineName]) by default has low permissions to do anything regarding the Operating System (for obvious reasons) and what you are probably running into here is that you are trying to open a socket from an ASP page which is not allowed.  (Judging from the error message this is being enforced by a Domain Controller)

The only suggestions I have for you is to 1)contact your Network Admin and have them grant higher privelages to that particular account, 2) Impersonate a user that has the rights to preform the actions, or 3)Search the MSDN for .NET ftp control.

.NET 1.1 does not support FTP natively but there is a way to write a control that will allow for FTP transmissions.  (I used the aforementioned MSDN article in one of my applications to facilitate an automatic FTP and it works very well)

Sorry but I can't seem to find the link to the article in my bookmarks, but do a quick search you are bound to find it.

HTH

"The one language all programmers understand is profanity."

Go to topic 48587

Return to index page 198
Return to index page 197
Return to index page 196
Return to index page 195
Return to index page 194
Return to index page 193
Return to index page 192
Return to index page 191
Return to index page 190
Return to index page 189