Thursday, November 22, 2012

Building apps in visual studio with TFS gives a build error


Something I came across and didn’t find any documentation for,

I started a Napa SharerPoint Office 365 app, and later on exported it to visual studio to get access to some more features that Napa does not provide.

Once I checked in all my code to TFS I started getting errors during deploy:

Access to the path ‘…..\pkgobj\Release\AppManifest.xml’ is denied.


Access to the path ‘…..\pkgobj\Debug\AppManifest.xml’ is denied.

well, looking at the file it seems every time the package was built – this file was marked as read only.

I tried to unmark it but again, after every build it was marked as read only.

this let me to believe that the file is being copied as-is from the project into the package folder, which means that if it is read only in the project – it will be read only in the package!

Now, I guess this specific file has some tokens that needs to be replaced during the packaging, so when visual studio tries to edit this file it gets the access denied error above.

The fix was simple: check out this file in the main project, and delete it from the pkgobj folder. this would make sure the file is not marked as read only when being copied and will allow visual studio to edit it while building the package.

A bug, hopefully that will be fixed soon (I reported it to MSFT).


1 comment:

Anonymous said...

Good workaround!!!