i am attempting to use Rebex ftp using a shared virtual server, CloudSites from www.rackspace.com. This hosting strictly imposes medium trust restrictions. when I run the app on my development PC which runs IIS locally -no problem. Same code on the host I get the following error message.

Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Is there something I can set or switch off to make it work.

Googling this, i see this is a medium trust

My application is an ASP.NET version 3.5 web based application rather than windows forms

Code which fails

Dim ftp As New Ftp()
ftp.Connect("ftp.ibexis.com", 21)

asked 16 Aug '10, 19:04

andy%20jones's gravatar image

andy jones
162
accept rate: 0%

edited 03 Aug '11, 14:55

Martin%20Vobr's gravatar image

Martin Vobr ♦♦
335310


Unfortunately, there are some permissions we need that are not available in medium trust. For example, one of them is System.Net.SocketPermission – this allows us to utilize TCP sockets to access FTP server. Without SocketPermission we are unable to connect to network.

Is it possible to ask rackspace to prepare a customized permission set for you and add at least SocketPermission?

Some methods (like using proxy with NLMN or Windows integrated authentication) also require permission to execute unmanaged code but if you do not call them rest of app should execute fine).

link

answered 16 Aug '10, 20:22

Martin%20Vobr's gravatar image

Martin Vobr ♦♦
335310
accept rate: 37%

unfortunately Rackspace requires that all applications conform to medium trust condtions. Can you prepare a customised version which does not sue socketpermission? If not I am unable to use this control and would kindly request a refund.

Thanks

(16 Aug '10, 21:20) andy jones

The SocketPermission means that application is allowed to communicate over network. Creating a functional FTP component without using this permission is impossible to anyone, sorry. Regarding refund - sure, no problem - each order come with a money back guarantee (30 days by default). To request a refund send us your order number to support@rebex.net.

(17 Aug '10, 07:28) Martin Vobr ♦♦

I have the same problem, but the issue is not related to SocketPermission, which Rackspace Cloud grants. The problem is that the Rebex SFTP library demands FileIOPermission, even if I am using Streams and not file names in my API calls. Actually the Connect method fails because it requires FileIOPermission. Is it possible to have a version which does not require FileIOPermission?

Here's the stack trace: why do you try reading the Assembly location? Is that for licensing purposes? It just does not work.

System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) at System.Security.CodeAccessPermission.Demand() at System.Reflection.Assembly.get_Location() at cfDEPv.blAlGPZ.COzXmRZ() at cfDEPv.blAlGPZ.AiWkiLZ() at Rebex.Net.Sftp.beYqct() at Rebex.Net.Sftp.Connect(String serverName, Int32 serverPort, SshParameters parameters) at Rebex.Net.Sftp.Connect(String serverName) at Antea.ECG.NetworkProtocols.SFTP.Connect()

link

answered 28 Feb '11, 09:27

Roberto%20Rossi's gravatar image

Roberto Rossi
181
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×152
×8

Asked: 16 Aug '10, 19:04

Seen: 1,084 times

Last updated: 03 Aug '11, 14:55