Hi, im trying to create a "scripting" tool for a game, me and some other dude is working on. We need to make sure that the scripts (that are normal C# files) will compile, and run under low-trust.
We found out that a way to do this is to make an appdomain, and then give it low security, but that means that all objects have to be serierilize to be send over the wire.
Is there away to set the permissions of a single assembly in the current appdomain

Help on dynamicly compiling and security
Josamoto80
I'll recommend that article as well
You've correctly figured out that to securely sandbox some code, you'll need to run it in a seperate AppDomain. Running within the same domain leads to all sorts of potential problems -- for instance, static state is shared so you can read static variables from partial trust that you might not want exposed. You'll have ot make sure that all of your code, and not just the subset that you load into the partial trust domain, is safe to be called from a lower trust level and was tested in that configuration.
-Shawn
CarlBrochu
http://msdn.microsoft.com/msdnmag/issues/05/11/HostingAddIns/default.aspx
This is an excellent article on properly handling Add-Ins (which your scripting code could qualify) in a secure fashion.