Microsoft KB Archive/945357

= Error message when you click &quot;Calculate Permissions&quot; for a Visual Studio 2008 ClickOnce application: &quot;Calculating permissions failed&quot; =

Article ID: 945357

Article Last Modified on 12/12/2007

-

APPLIES TO


 * Microsoft Visual Studio 2008 Standard Edition
 * Microsoft Visual Studio 2008 Professional Edition
 * Microsoft Visual Studio 2008 Academic Edition

-



SYMPTOMS
When you click Calculate Permissions on the Security tab for a Microsoft Visual Studio 2008 ClickOnce application, the Calculate Permissions process may not run successfully. Additionally, you may receive the following error message:

Calculating permissions failed.

Could not load file or assembly ' ' or one of its dependencies. An attempt was made to load a program with an incorrect format.



CAUSE
This problem occurs when the Platform target property is set to x64.



WORKAROUND
To work around this problem, use one of the following methods.

Method 1
Change the value of the Platform target property to x86 or to Any CPU. To do this, follow these steps:
 * 1) In Solution Explorer, click the project name.
 * 2) On the Project menu, click   Properties.
 * 3) Click the Build tab, and then select one of the following items in the Platform target list:
 * 4) * x86
 * 5) * Any CPU
 * 6) Click the Security tab, and then click Calculate Permissions.

Note You should use Method 1 only if you are not using 64-bit-specific assemblies. If you use Option 1 when you are using 64-bit-specific assemblies, the Calculate Permissions process fails.

Method 2
Use the PermCalc.exe file to manually create the permissions for your assembly. To do this, follow these steps:  Click Start, click Run, type cmd, and then click OK. Type the following command, and then press ENTER:

cd :\ Program Files\Microsoft SDKs\Windows\v6.0A\bin\

 Type the following command, and then press ENTER:

PermCalc –CleanCache &quot; &quot;

 Locate and then open the XML file that the PermCalc.exe file created. Copy and then paste the contents of the XML file into the App.manifest file in your project.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.

Keywords: kbtshoot kbpubtypekc kberrmsg kbprb KB945357

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.