Microsoft KB Archive/817941

= Unexpected Results When You Use Visual Studio to Output Assemblies to WSS Bin Folder =

Article ID: 817941

Article Last Modified on 7/27/2006

-

APPLIES TO


 * Microsoft Windows SharePoint Services

-



SYMPTOMS
When you use Microsoft Visual Studio to output assemblies to the application bin folder of a Windows SharePoint Services virtual server (for example, to the c:\inetpub\wwwroot\bin folder), you may experience unexpected behavior. You may also receive the following error message:

Required permissions cannot be acquired.



CAUSE
This behavior may occur if the following conditions are true:
 * The project assemblies are output to the WSS application bin folder.
 * The Copy Local property is set to true on the referenced Microsoft.SharePoint.dll file.

Visual Studio provides an option for copying a referenced assembly to the project's output folder. The option is governed by the CopyLocal property of the referenced Microsoft.SharePoint assembly. However, if these conditions exist, two copies of the Microsoft.SharePoint assembly will exist in the specified Windows SharePoint Services virtual server (one copy in the Global Assembly Cache (GAC) and another copy in the bin folder). This may cause loading conflicts.



WORKAROUND
To work around this behavior, set the Copy Local property for the referenced Microsoft.SharePoint assembly to &quot;false&quot; to prevent Visual Studio from copying the assembly to the output folder.

Keywords: kberrmsg kbprb KB817941

-

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

© Microsoft Corporation. All rights reserved.