I'm having a problem trying to get my builds to work on TFS. I have a user called TFSBuild and it has access to the C:\Builds security and sharing tab. I've searched and adding the following MSBuild arguments still doesn't seem to work:
/m:1 /p:UseWPP_CopyWebApplication=true /p:PipelineDependsOnBuild=false /p:BuildInParallel=false /p:DeployOnBuild=true
I also have a wpp.target file and this seems to be what is failing
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="TransformXml"
AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.Tasks.dll"/>
<!-- Make sure web.config will be there even for package/publish -->
<!--Target Name="CopyWebConfig" BeforeTargets="Build;Rebuild;ConfigTransform">
<Message Text="Replacing web.config with base." Importance="high" />
<Copy SourceFiles="Web.base.config"
DestinationFiles="Web.config"
OverwriteReadOnlyFiles="true"
SkipUnchangedFiles="false" />
</Target-->
<Target Name="ConfigTransform" BeforeTargets="Build;Rebuild" Condition="Exists('Web.$(Configuration).config')">
<Message Text="Transforming: Web.$(Configuration).config" Importance="high" />
<!--TransformXml Source="Web.Base.config"
Transform="Web.$(Configuration).config"
StackTrace="True"
Destination="Web.config" /-->
</Target>
</Project>
The error is below and I'm fresh out of ideas...
C:\Builds***.wpp.targets (17): Exception: Could not write Destination file: Access to the path 'C:\Builds***Web.config' is denied. at Microsoft.Web.Publishing.Tasks.TransformXml.SaveTransformedFile(XmlTransformableDocument document, String destinationFile) at Microsoft.Web.Publishing.Tasks.TransformXml.Execute() UnauthorizedAccessException: Access to the path 'C:\Builds**Web.config' is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost) at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize) at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding) at Microsoft.Web.Publishing.Tasks.XmlAttributePreservingWriter..ctor(String fileName, Encoding encoding)