When I package a Sharepoint 2010 project in Visual Studio 2010, I occasionally get the following error message:

Access to the path 'C:\path-to-my-project\pkgobj\Debug\Package_Manifest.xml' is denied.

I checked the file, and it seems to be read-only. Clearing the read-only flag helps, but eventually the problem reoccurs. What's causing it and how can I fix it for good?


I am able to get around the problem by checking-out the AppManifest.xml file in the project, thereby removing the read-only. For some reason the publish process copies this file over and keeps the read-only flag, causing the error.

| improve this answer | |

You need to run the visual studio as Administrator

| improve this answer | |
  • It made no difference. I don't see what administrator privileges have to do with the file system read-only flag. – Hirvox Jun 28 '12 at 5:48

The UAC requires that you run Visual Studio as a system administrator.

To develop SharePoint solutions, you must have sufficient permissions to run and debug SharePoint solutions. Before you can test a SharePoint solution, take the following steps to ensure that you have the necessary permissions:

  • Add your user account as an Administrator on the system.
  • Add your user account as a Farm Administrator for the SharePoint server.
  • In SharePoint Central Administration, click the Manage the farm administrators group link.


| improve this answer | |
  • Did you even read the question? This is not a Sharepoint permissions issue, it's an issue with Visual Studio. You don't even need to have a functioning Sharepoint instance to create a .wsp package in Visual Studio. That said, I am running Visual Studio with elevated privileges, and my user account is both a local administrator as well as the Sharepoint farm administrator. – Hirvox Apr 16 '13 at 10:16
  • I did read your question and I've experienced the problem myself. However, I delevop on a server with SharePoint. Regardless, VS need the rights. Another scenario where this might happen is if use a version controler and you your file is versioned and marked as read-only by default. Content of the folders bin, debug, release should not be versioned as they are automatically generated. – miracules Apr 16 '13 at 12:15

I just had this issue too. I don't know what was the problem exactly, but once I have logged off and log in again, this problem was gone. Probably it was because I changed password recently....

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.