Is it possible to make a change to a project that will cause it’s assembly to be executed in a different trust level? If so what is it?
From what I understand this can only be determined form outside of the project itself…
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t think this is possible directly through the project’s settings. But you could try to leverage the application domains in your project. This means that you have to change your program’s code so I’m not sure if that’s OK with you.
With the help of appdomains, you can create little sandboxes for each of your assemblies and run the assemblies inside their sandboxes. For every appdomain, you can change their permission sets by using the parameters in AppDomain.CreateDomain-method. Here’s a good tutorial by David DeWinter on “How to Host a Partial Trust Sandbox”.
Also you can use the .NET Framework Configuration tool to adjust the assembly’s trust level or the caspol to give it the full trust. But these are controlled outside your project.