Windows Phone Developers

Thursday, January 1, 2009

How to give file share FullTrust permission in .NET

To run Mscorcfg.msc from the Start menu

1. Click Start, click Control Panel, and then double-click Administrative Tools.

2. Double-click Microsoft .NET Framework Configuration.

To run Mscorcfg.msc from the command line

1. In the .NET Framework 1.0 and 1.1, type the following at the command line: %Systemroot%\Microsoft.NET\Framework\versionNumber\Mscorcfg.msc

2. In the .NET Framework 2.0, start the SDK Command Prompt and type mscorcfg.msc.

The user interface for the tool is displayed.

To run Mscorcfg.msc from the Microsoft Management Console

1. Start the Microsoft Management Console by typing the following at a command prompt: mmc.

2. On the File menu, click Add/Remove Snap-in (or press CTRL+M) to display the Add/Remove Snap-in dialog box.

3. In the Add/Remove Snap-in dialog box, click Add to display the Add Standalone Snap-in dialog box.

4. In the Add Standalone Snap-in dialog box, select a version of the .NET Framework Configuration tool, and then click Add.

One simple way to modify the policy affecting a file share is to give a specific file share FullTrust permission using Mscorcfg.msc. You must be an administrator on the computer to make this change.



To give a file share FullTrust permission

1. Start Mscorcfg.msc.




2. Expand the Runtime Security Policy node, the Machine node, the Code Groups node, and the All_Code node, and then highlight the LocalIntranet_Zone node.



3. In the right pane, click Add a Child Code Group.



4. Choose Create a new code group, enter a name for the code group, and then click Next.

5. Choose a condition type of URL, and enter the UNC path to the share location of your project, using the format file://\\servername\sharename\* where \\servername\sharename is the name of the share. Click Next.












To give a file share FullTrust permission

1. Start Mscorcfg.msc.

2. Expand the Runtime Security Policy node, the Machine node, the Code Groups node, and the All_Code node, and then highlight the LocalIntranet_Zone node.
3. In the right pane, click Add a Child Code Group.
4. Choose Create a new code group, enter a name for the code group, and then click Next.
5. Choose a condition type of URL, and enter the UNC path to the share location of your project, using the format file://\\servername\sharename\* where \\servername\sharename is the name of the share. Click Next.

Note:
Make sure to add the asterisk at the end of the path.
6. Choose Use existing permission set and select FullTrust, and then click Next.
7. Click Finish.
8. Restart Visual Studio.
Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon

No comments:

Post a Comment