VS2012: Access to path is denied when executing publish

visual studio 2012

When trying to publish an application (a WCF Service specifically) in VS2012, I get an error stating: "Exception in executing publishing: Access to the path [path] is denied." The file referenced is the publish profile I'm trying to execute and is type ".pubxml"

I've used SysInternals Process Explorer to check if another process has the file locked, I've closed VS2012 and reopened it with administrator rights, and have rebooted my PC.

This is the same issue described here: VS2012 Error when creating publish package: Exception in Executing Publishing Access to path is denied and I'd rather comment on that question asking if he ever found a solution but unfortunately I don't have comment rights yet.

EDIT ——

I'm using Visual Studio 2012 Ultimate with Update 2 (11.0.60315.01 Update 2)

Best Answer

I just had the same issue crop up.

The reason why is because the files are read only. Simply browse to the folder where the profiles are kept, select them all, and drop a click on that checkbox:

enter image description here

This is probably caused by your profiles being checked into source control without your knowledge.

Related Topic