Medium Trust and Cloud Files .NET API

Questions:

I’m using Cloud Files for about a month now and I’m working on application which store files in Cloud Files.

I used .NET API for Cloud files to get Stream for File in Cloud and return content of file via ASP.NET HTTP Handler.

It works fine on my Development Server but as soon as I transfer it into Cloud Sites I get this while connecting to Cloud Files:

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

The command which I get this error is:

Connection CloudConnection = new Connection(new UserCredentials(ServerUsername, ServerPassword));

Is there anything which I need to done to be able to run application on Cloud Sites?

On my development Server I set Trust Level to Medium and I got same error!!! So I think it’s about Medium Trust, but I don’t have any idea if it’s possible to make it work on RackSpace Cloud Sites?

I really appreciate any help.

Answers:

Make sure you have the latest version of the Cloudfiles API. I was getting this with the older API. Authentication is different in the new API and it works in Medium Trust.

======================

I’m having this exact same problem, using a recent version of the API.

Does the Cloud Files .NET API definitely work in medium trust?

======================

Definitely works. i use it every day.

ASP.Net 2.0 – Membership and Role Providers using MySQL instead of Ms-SQL

Questions:

Hello,

I found an article about using ASP.Net 2.0 Membership and Role providers using the MySQL Connector.

http://www.marvinpalmer.com/MarvinPalmer/post/Implement-NET-Membership-and-Roles-using-MySql-Connector-523-on-GoDaddy.aspx

I followed these instructions to the tee, making sure that every step I followed was correct. My code works fine locally, but not when uploaded to Mosso. Mosso says that its got something to do with the medium trust level of ASP.Net on their servers.

Does anyone have any idea as to how I can get this working? Or another way that I could get authentication working using MySQL? I am pretty novice when it comes to ASP.Net, and probably cant really write my own authentication system.

Thanks in advance!

Answers:

The .net connector from mysql should be /bin deployable:
http://dev.mysql.com/downloads/connector/net/

You should be able to add the assembly and whatever version you choose into the web.config like this:
<add assembly=”MySql.Data, Version=x.x.x.xxxxx, Culture=neutral, PublicKeyToken=c5687fc88969c44d” />

Source:
http://www.eggheadcafe.com/community/aspnet/90/10123253/could-not-load-file-or-assembly-mysqldata.aspx

Hope that helps.