1

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)

Alao
  • 390
  • 5
  • 11
  • Is that path longer than 255 characters? Also, you need to make very sure that the build is actually being executed with the tfsbuild user and that the user has **Full** access (no limitations) to the `c:\builds`. – NotMe Apr 01 '15 at 01:10
  • I don't think so. The path is below. I've removed some sensitive info. C:\Builds\2\*****\EPS Continuous Integration\src\***.*****\***.****\Web.config' is denied. – Alao Apr 01 '15 at 01:11
  • I have given the TFSBuild user full access to the share and the build folder How can i see if it is actually being executed by the TFSBuild user. – Alao Apr 01 '15 at 01:16
  • Is it executing on the same machine as the file system? Also see http://stackoverflow.com/questions/12905693/tfs-2012-build-access-to-path-denied – NotMe Apr 01 '15 at 01:18
  • Yes the build folder is on the same machine as the build service. I checked out the link and it seems pretty confusing. I added the /p:BuildInParallel=false that was suggested in one of the comments – Alao Apr 01 '15 at 01:28
  • When I commented out the line in the wpp.target it started working. So i guess the real question is how do i get the web.config transform to work. – Alao Apr 01 '15 at 01:47
  • Have you looked at: http://stackoverflow.com/questions/16311981/tfs-2012-and-web-config-transforms – NotMe Apr 01 '15 at 02:32

0 Answers0