?
Solved

Execution permission cannot be acquired

Posted on 2003-03-02
5
Medium Priority
?
2,149 Views
Last Modified: 2011-08-18
Hi All,

I created a vb.net project in my local pc. it was run quite Ok in that pc. but later I moved that project into our server, when I open the project from my pc, I got warning saying about some permisson issue, and I cann't run the project getting following error "Execution permission cannot be acquired"

I whould like to know the procedure to overcome this, and I'm new to .net

Pls help

Kumara.
0
Comment
Question by:Kumara
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 20

Accepted Solution

by:
Silvers5 earned 200 total points
ID: 8055785
What your application is trying to do? The user that is trying to run the application does not have enough permissions to run it on the server.. try to run it with higher privilieges.. also You can tell your administrator  (if it's not you) to setup the assembly of your project in the gac and assign a more privilieged account to run it
0
 
LVL 20

Expert Comment

by:Silvers5
ID: 8055798

Also use the Code Access Security Policy Tool (Caspol.exe)
to check needed permissions for your application


----------

.NET Framework Configuration Tool (Mscorcfg.msc)

The .NET Framework Configuration tool is a Microsoft Management Console (MMC) snap-in that allows you to manage and configure assemblies in the Global Assembly Cache, adjust code access security policy, and adjust remoting services.

Starting the .NET Framework Configuration Tool
To run Mscorcfg.msc from the Start menu

Click Start, point to Programs, and point to Administrative Tools. Click Microsoft .NET Framework Configuration.
Note   The command to start Mscorcfg.msc appears in the Start menu only if MMC version 1.2 or later is installed on the computer. A compatible version of MMC is included with Windows 2000 and Windows XP. If Windows 98, Windows ME or Windows NT 4 is running on the computer, you must download and install MMC 1.2 from Microsoft.com.
To run Mscorcfg.msc from the command line

At the command line, type <Drive>:\\Winnt\Microsoft.NET\Framework\
<Version number>\mscorcfg.msc
The user interface for the tool is displayed.

Using the .NET Framework Configuration Tool
You can do the following with the .NET Framework Configuration tool:

Assemblies

Manage assemblies in the global assembly cache

Configure assemblies in the global assembly cache

Remoting

Adjust remoting services

Security

View the current .NET Framework security configuration

Increase assembly trust

Adjust zone security

Evaluate an assembly

Create a deployment package

Reset all policy levels

Individual Applications

View applications previously configured with this tool

Add an application to configure with this tool

View an application's properties

View an application's assembly dependencies

Configure an assembly for an application

Adjust remoting services for an application

Assemblies
To manage assemblies in the global assembly cache

Click the Assembly Cache node of the console tree. Alternately, you can click the Manage the Assembly Cache link in the pane on the right.
The tool displays all assemblies in the Global Assembly Cache in the pane on the right. The tool also displays all native image versions of assemblies in the cache. Native images are versions of assemblies that have been pre-compiled to native code using the Native Image Generator (Ngen.exe).

To delete an assembly from the cache, right-click the assembly name in the pane on the right and choose Delete from the shortcut menu.
To add an assembly to the cache, right-click the Assembly Cache node and choose Add from the shortcut menu. The tool displays the Add an Assembly dialog box. Navigate to the assembly to add.
To configure assemblies in the global assembly cache

Click the Configured Assemblies node of the console tree.
Click the View List of Configured Assemblies link in the pane on the right to display a list of configured assemblies.
To add an assembly to configure, click the Action menu and select Add.
Alternately, you can right-click the Configured Assemblies node and select the Add command on the shortcut menu, or you can click the Configure an Assembly link in the pane on the right. The tool displays the Configure an Assembly wizard.

Choose an assembly from the list of assemblies in the cache, or manually enter the information for an assembly.
The tool displays a Properties window for the assembly to configure.

Choose the Binding Policy tab to specify binding redirections from a requested version to a new version. For more information on binding redirections, see Redirecting Assembly Versions.
Choose the Codebases tab to specify codebases for specific versions of the assembly. For more information on codebases, see Specifying an Assembly's Location.
Remoting
To adjust remoting services

Click the Remoting Services node of the console tree.
Click the Action menu and select Properties.
Alternately, you can right-click the Remoting Services node and select Properties from the shortcut menu, or you can click the View Remoting Services Properties link in the pane on the right. The tool displays the Remoting Services Properties window.

Choose a communication channel to configure, and edit its properties.
Security
To view the current .NET Framework security configuration

Expand the Runtime Security Policy node in the console tree.
Expand the User, Enterprise, or Machine policy nodes to view information about code groups, permission sets, and policy assemblies for the selected policy level.
Expand the Code Groups node to view the code groups associated with the policy level. For more information on code groups, see Code Groups and Using the .NET Configuration Tool to Work with Code Groups.
Expand the Permission Sets node to view the permissions associated with the policy level. Click the View Permissions link in the pane on the right.
The tool displays the permissions in the selected permission set. For more information on permissions, see Named Permission Sets and Using the .NET Configuration Tool to Work with Permission Sets.

Click the Policy Assemblies node. Then, click the View Policy Assemblies link in the pane on the right.
The tool displays the list of assemblies that are used for evaluating policy for the selected level.

To increase assembly trust

Click the Runtime Security Policy node of the console tree.
Click the Action menu, and select from the available commands.
Alternately, you can right-click the Runtime Security Policy node and select from the same list of commands on the shortcut menu, or click the Increase Assembly Trust link in the pane on the right. The tool displays a corresponding wizard.

Follow the directions that appear in the wizard to increase the level of trust granted to an assembly that you specify.
The wizard allows you to modify security policy based upon available information about the assembly's evidence. For a list and description of the common types of evidence, see the Evidence topic.

To adjust zone security

Click the Runtime Security Policy node of the console tree.
Click the Action menu, and select from the available commands.
Alternately, you can right-click the Runtime Security Policy node and select from the same list of commands on the shortcut menu, or click the Adjust Zone Security link in the pane on the right. The tool displays a corresponding wizard.

Follow the directions that appear in the wizard to modify the level of trust granted to all assemblies from a particular zone. For a list and description of valid zones, see the Security topic.
To evaluate an assembly

Click the Runtime Security Policy node of the console tree.
Click the Action menu, and select from the available commands.
Alternately, you can right-click the Runtime Security Policy node and select from the same list of commands on the shortcut menu, or click the Evaluate Assembly link in the pane on the right. The tool displays a corresponding wizard.

Follow the directions that appear in the wizard to evaluate the permissions that will be granted to an assembly or the code groups that give permissions to an assembly. You can use this information to determine the effect of current security policy on an assembly that you specify.
To create a deployment package

Click the Runtime Security Policy node of the console tree.
Click the Action menu, and select from the available commands.
Alternately, you can right-click the Runtime Security Policy node and select from the same list of commands on the shortcut menu, or click the Create a Deployment Package link in the pane on the right. The tool displays a corresponding wizard. The wizard allows you to create a Windows Installer Package (.msi file) that you can use to deploy a policy using Group Policy or Systems Management Server.

Follow the directions that appear in the wizard to create the deployment package.
To reset all policy levels

Click the Runtime Security Policy node of the console tree.
Click the Action menu, and select from the available commands.
Alternately, you can right-click the Runtime Security Policy node and select from the same list of commands on the shortcut menu, or click the Reset All Policy Levels link in the pane on the right. This command resets security policy to the Default Security Policy settings.

Individual Applications
To view applications previously configured with this tool

Expand the Applications node of the console tree to view the list of applications configured with this tool.
To add an application to configure with this tool

Click the Applications node of the console tree, and then click the Add an Application to Configure link in the pane on the right.
The tool displays the Configure an Application dialog box, which contains a list of managed applications that have run at least once on the current computer.

Choose an application from the list, or click the Other button to navigate to an application that does not appear in the list.
Alternately, you can navigate to a configuration file to add.

To configure the application, click the View the Application's Properties, View the Assembly Dependencies, Configure an Assembly, and Adjust Remoting Services links in the pane on the right. For more information on using these links, see the corresponding procedures later in this topic.
To view an application's properties

Expand the Applications node of the console tree and click the name of the application for which to view properties. If the application is not in the list, follow the procedures to Add an Application to Configure.
Click the View the Application's Properties link in the pane on the right.
The tool displays the Properties window for the selected application.

To view an application's assembly dependencies

Expand the Applications node of the console tree and click the name of the application for which to view assembly dependencies. If the application is not in the list, follow the procedures to add an application to configure.
Click the View the Assembly Dependencies link in the pane on the right.
To configure an assembly for an application

Expand the Applications node of the console tree and click the name of the application for which to configure an assembly. If the application is not in the list, follow the procedures to add an application to configure.
Click the Configure an Assembly link in the pane on the right.
The tool displays the View List of Configured Assemblies and Configure an Assembly links in the pane on the right.

Click the Configure an Assembly link.
The tool displays the Configure an Assembly wizard.

Choose an assembly from the list of assemblies the application uses or the list of assemblies in the cache, or manually enter the information for an assembly.
The tool displays a Properties window for the assembly to configure.

Choose the Binding Policy tab to specify binding redirections from a requested version to a new version.
Choose the Codebases tab to specify codebases for specific versions of the assembly.
To adjust remoting services for an application

Expand the Applications node of the console tree and click the name of the application for which to adjust remoting channels and object endpoints. If the application is not in the list, follow the procedures to add an application to configure.
Click the Adjust Remoting Services link in the pane on the right. For more information on remoting services, see .NET Remoting Overview, and Channels.
Click the View Remoting Services Properties link in the pane on the right.
The tool displays the Remoting Services Properties dialog box.

Select the Remote Applications, Exposed Types, or Channels tab to view and edit the corresponding properties.
Remarks
This tool is intended to help advanced administrators perform tasks related to configuring applications. It is not intended for use by application users. Administrators should direct users who want to perform limited configuration tasks to the Microsoft .NET Framework Wizards (Configwizards.exe). This executable provides three wizards: Adjust .NET Security, Trust An Assembly, and Fix An Application. Users can click the links to start the wizards. You can run Configwizards.exe from the Start menu by pointing to Programs, pointing to Administrative Tools, and clicking Microsoft .NET Framework Wizards. You can also run the executable from the command line by typing <Drive>:\\Winnt\Microsoft.NET\Framework\<Version number>\configwizards.exe.
 
0
 
LVL 20

Expert Comment

by:Silvers5
ID: 8055813
Sorry for the long post.. look for caspol info here if you have msdn installed with VS.NET:
ms-help://MS.VSCC/MS.MSDNVS/cptools/html/cpgrfcodeaccesssecuritypolicyutilitycaspolexe.htm

0
 
LVL 28

Assisted Solution

by:iboutchkine
iboutchkine earned 200 total points
ID: 8057095
The reason this happens is that the UNC path is not trusted by the .NET
runtime. By
default, local paths are trusted and so the exception is not raised. To
have the
NET runtime trust the UNC path do the following:

1. Open Control Panel -> Administrative Tools
2. Open Microsoft .NET Framework Wizards
3. Double-click Trust an assembly.
4. Select Make changes to this computer.
5. Click Next.
6. Enter the UNC path for the executable. For example
\\SERVER\share\app.exe
7. Click Next
8. Now adjust the security. Set it to Full Trust. This was the only level
I could  get the application to work with. By default, "No trust" is set.
9. Click Next, Finish, and close the Wizard.
Once the path is trusted, the application should work from the command
line by  specifying the UNC path

0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 9650645
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Split between Silvers5 and iboutchkine

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

TheLearnedOne
EE Cleanup Volunteer
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question