Trust permission opening a project.

J

JohnGoogle

Hi,

This is a novists question so please bear with me!

I downloaded a test C# project from 'The Code Project' internet site.
Unzipped the project to my local folder 'C:\Test'. When I open the
project (SingleInstanceApp.csproj file) from within Visual C# I get the
following error dialog:

The project location is not trusted.

Running the application may result in security exceptions when it
attempts to perform actions which require full trust.

I click OK and can compile and run it OK. It's a simple app which does
no file access etc. so I assume for this application the full trust
requirement is not an issue.

When I go into the .NET Framework 2.0 Configuration utility and look at
this node:

Runtime Security Policy\Machine\Code Groups\All_Code\My_Computer_Zone

It has the following description:

Code group grants full trust to all code originating on the local
computer

Assembly evidence must match this membership condition to belong to the
code group: Zone: MyComputer.

Assemblies matching the membership condition are granted this
permission set at the current policy level: FullTrust.

Permission Set Description:
Allows full access to all resources


I assume it's the 'Assembly evidence must match' part that is causing
me trouble. My question is, what do I need to do to get rid of this
error and ensure that the project gets Full trust status. BTW. The
projects that I have created from scratch do not have this problem when
I open the project.

TIA.

John.
 
N

Nicole Calinoiu

Hi,

This is a novists question so please bear with me!

I downloaded a test C# project from 'The Code Project' internet site.
Unzipped the project to my local folder 'C:\Test'.

When you download a file, it gets flagged as originating from outside the
local machine. When you extract a downloaded zip archive, each extracted
file receives the same flag. This means that all your project files appear
to be located in the internet zone, which is why they are receiving only a
partial CAS permission grant. The best way to avoid this problem is to
remove the flag from the zip archive before extracting it. To do so,
right-click the zip file, select the Properties item from the context menu,
then click the Unblock button on the General tab of the file properties
dialog.

When I open the
project (SingleInstanceApp.csproj file) from within Visual C# I get the
following error dialog:

The project location is not trusted.

Running the application may result in security exceptions when it
attempts to perform actions which require full trust.

I click OK and can compile and run it OK. It's a simple app which does
no file access etc. so I assume for this application the full trust
requirement is not an issue.

It may or may not be. If you compiled the app on your machine, it probably
isn't being flagged as originating elsewhere, so chances are that it's
receiving an unrestricted CAS permission grant.
 
J

JohnGoogle

Thanks Nicole, I'll try that.

Nicole said:
When you download a file, it gets flagged as originating from outside the
local machine. When you extract a downloaded zip archive, each extracted
file receives the same flag. This means that all your project files appear
to be located in the internet zone, which is why they are receiving only a
partial CAS permission grant. The best way to avoid this problem is to
remove the flag from the zip archive before extracting it. To do so,
right-click the zip file, select the Properties item from the context menu,
then click the Unblock button on the General tab of the file properties
dialog.



It may or may not be. If you compiled the app on your machine, it probably
isn't being flagged as originating elsewhere, so chances are that it's
receiving an unrestricted CAS permission grant.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top