TFS & VS 2012: Passing a TFS Build variable in as a custom property to MS Build

 I think this is a simple question but I can't find the answer.  TFS Build server is 2012, using VS 2012.  I would like to pass the value of
TF_BUILD_BUILDDIRECTORY  to MSBuild as a build argument.  I assume this is a 2012 tf variable and not 2013.  In a custom TF build template I am using the variable BinariesDirectory to copy all project output into their own directories.
 I am attempting to do this by setting the MSBuild Arguments setting of the Build definition to /p:tfs_Binaries_Directory="$(TF_Build_BinariesDirectory)".  I assume that this is the correct variable name for it in 2012.  Am I
missing something?
I want to use this variable in a Post Build event of the solution being built to copy out some additional data that needs to be deployed as part of the build.
Thanks,
John Sheppard

Hi John,  
Thanks for your post.
As far as I know TFS 2012 not support TFS 2013 Build environment variables. 
https://msdn.microsoft.com/en-us/library/hh850448.aspx.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Error: The Task has failed to load on Execute Package Task using TFS Build and MSBuild.exe on dedicated Build Machine.

    I'm trying to automate my building and deployment of SSIS packages using TFS build definitionss in conjunction with MSBuild.exe on a separate build machine.
    I have successfully built and deployed my projects but receive the following error:
    Error: Failed to load task "etl_UWP_Stage_tstg_7_Large",type "".  The contact information for this task is "Microsoft Corporation: Microsoft SQL Server .... "
    This error happens at runtime as well as if I perform a "Validate..." on the SSIS Catalog on the server.
    This only occurs when trying to execute a package that contains an Execute Package Task.  Any other packages that are doing the actual work are working just fine.
    In addition, when I do the MSBuild from my developer machine with the same deployment process everything works fine, even the Execute Package Task.
    I can even open up the project on the build machine in VS2012, rebuild all, then deploy and everything works fine.
    Some things I've considered/verified:
    1) Visual Studio 2012 and Visual Studio Data Tools 2012 are both on the build machine and my local machine.
    2) The .NET version being used by VS2012 is the same on the build machine and my local machine.
    3) I find it suspicious that the "Type" referenced in the error above is blank...but not sure where to go with that.
    4) Obvious difference is that during the TFS Build and Deploy on the build machine, everything is running under the TFS Service account, rather than my account...once again...not sure where to go with this, but it is a significant difference.
    Has anyone had similar issues or have any thoughts on things to try?
    Thanks,
    Jason

    Not sure why I couldn't find this answer in my earlier searches...
    But this thread solved it for me:
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/3aa1e324-da32-4ea0-865c-c69f610ef262/failed-to-load-execute-package-task-error?forum=sqlintegrationservices
    Essentially I had to install SSIS on the build machine so that the 64-bit version for
    ExecPackageTask.dll, was available.  I did this from the original media CD selection Integration Services as a feature.
    Hope this helps someone in the future.

  • TFS Build - Unit Test is showing wrong result

    HI Team,
           I have a build definition(“BDPR's Playground CI Build”)  which is compiling 2 solutions and running the unit tests in them. Globally I have
    6 unit tests that pass, 0 that fail and 2 that are inconclusive, which gives a total of 8 unit tests. When I run this build definition, what is reported in the build summary is “6/6 test(s) passed, 0 failed, 0 inconclusive”, which is obviously wrong. It looks
    like inconclusive unit tests are completely ignored by the build system. Is this a bug or am I missing some subtle option somewhere in the build definition to get this right? 
           Displaying a given build summary in Visual Studio gives less information that in the web portal. The web portal reports the number of inconclusive
    unit tests (but with a wrong value – see previous item) whereas Visual Studio doesn’t report the inconclusive unit tests at all. Example: for the build “BDPR's Playground CI Build_20150409.5”, web portal reports “6/6 test(s) passed, 0 failed, 0 inconclusive”
    while Visual Studio reports “6 of 6 test(s) passed”! Is this a bug or is there some misconfiguration somewhere?
    Regards
    Hem

    Hi Hem,  
    Thanks for your post.
    What’s the version of  your TFS and VS?
    Yes, as far as I know the inconclusive unit test result not show in TFS build summary by default. Bu you can view the TFS build
    Diagnostic log to view which inconclusive unit tests be executed in build.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to execute a batch file on different remote server using TFS Build

    I have a build server and have 2 web servers. I am deploying using TFS Builds. Now, I have a requirement to execute a batch file which is kept on these 2 web servers. i.e. C:\MyBatch\CreateMe.bat
    After my build is successful, I need to execute this batch from the build server.
    Note, I cannot make any shared folder.

    Hi Sameer, 
    Thanks for your post.
    What’s the version of your TFS?
    How do you deploy solution using TFS Build, run MSBuild deploy command or using Release Management?
    That C:\MyBatch\CreateMe.bat file stay on your two web server machines separately? 
    If you want execute this bat file on your two web server machines separately using build process template, you need configure your web server machine as build agent, then add the InvokeProcess activity in build process template to run the bat file on build
    agent machine after build, please refer to Hari’s answer reply in this post:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/b8bcb19f-1296-441c-8356-e701b949445a/tfs-2010-how-to-execute-a-batch-file-after-build?forum=tfsbuild.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • SSDT tries to alter timestamp column in TFS build

    We're trying to perform an upgrade test against a copy (backup/restore) of our customer database as target. There are some tables with  timestamp column in the database. The way we do this is by having a database project with a publish profile targeting
    that copy of customer database and then with TFS build server is used to build the database but only to generate a publish script (/p:UpdateDatabase=False) set in the build definition - msbuild argument.
    Example of table definition:
    CREATE TABLE dbo.CodeTable1
    (ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY
    ,Code CHAR(6)
    ,[Timestamp] TIMESTAMP NULL);
    We would like to have the "Code" column to have CHAR(7), so in the project we modify the table definition:
    CREATE TABLE dbo.CodeTable1
    (ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY
    ,Code CHAR(7)
    ,[Timestamp] TIMESTAMP NULL);
    Expecting SSDT build will generate alter script:
    ALTER TABLE dbo.CodeTable1 ALTER COLUMN Code CHAR(7);
    To our surprise the generated script was:
    ALTER TABLE dbo.CodeTable1 ALTER COLUMN Code CHAR(7);
    ALTER TABLE dbo.CodeTable1 ALTER COLUMN [Timestamp] TIMESTAMP NULL;
    Which will cause error when the script is executed: "Cannot alter column 'TIMESTAMP' to be data type timestamp."
    Why is SSDT generating the change script for that timestamp column??
    We then try a local build in VS, the issue is not happening, SSDT correctly generates alter script only for the "Code" column to CHAR(7);
    Both local machine and TFS Build server are having VS 2013 Update 4- SSDT 12.0.50318.0 installed.
    As we tried to troubleshoot further, we found out that it seems it only happens on a restored database from a backup copy of our customer database. It doesn't happen for databases created by SSDT build from scratch or that we manually created. We've tried make
    sure all database properties are the same as the database that correctly built. But still if the target database is the one we restored from a customer's copy, SSDT always tries to alter timestamp column (on server build).
    Anyone have same experience?
    I have posted a bug in ms connect: https://connect.microsoft.com/SQLServer/feedback/details/1266051
    Thanks!

    Thanks Paul!
    However, it doesn't happen when I build the database project locally or if the target database was created by SSDT (or manually for that matter). The issue happens when I change the target database to the one we restored from a backup copy of our customer's
    database and run the build through our TFS build server.
    So I thought there must be something different with the restored database (which causes SSDT to alter timestamp column) as opposed to the one SSDT/manually created (which doesn't alter the timestamp column). Maybe there is difference on database property/settings?
    Whatever it is, I just couldn't find it.
    The only thing we will do now as workaround is to get db schema creation script from that of customer's database and run that script to re-create the database from scratch and use that as target database instead, as luck would have it, the issue would be
    gone.
    Still, why the heck SSDT tries to alter timestamp column in that specific case and not in other case as described above??
    Elvin

  • How to publish MVC project using WebDeploy from TFS Build

    Please help me on how to publish MVC project using WebDeploy from TFS Build

    Hi Jeevan,
    You might want to setup an TFS build server for web deployment. Please refer to the link for the details:
    http://www.asp.net/web-forms/overview/deployment/configuring-team-foundation-server-for-web-deployment/configuring-a-tfs-build-server-for-web-deployment
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • TFS Build - Code Analysis is not happening.

    Dear support,<o:p style="font-family:'Times New Roman';font-size:medium;line-height:normal;"></o:p>
    <o:p style="font-family:'Times New Roman';font-size:medium;line-height:normal;"> </o:p>
    I have the following issue with TFS build system.
    <o:p style="font-family:'Times New Roman';font-size:medium;line-height:normal;"> </o:p>
    Although I have configured the projects in my solutions to run the static code analysis during build, and I have created a build definition to build these solutions, I’m unable
    to get the corresponding static code analysis report in the build summary. This is also the case if I set Perform Code Analysis to Always in the build definition. Is this a bug or am I missing something?
    Regards
    Hem

    Hi Hem,  
    Thanks for your reply.
    You’re using TFS 2013 Update 4?
    Do you mean that you have installed the VS 2013 Premium on your build agent machine, and if you manually build your solution using this VS 2013 Premium on build agent machine, the code analysis result show correctly in build result?
    Please follow the steps in document to check your solution and build definition settings:
    https://msdn.microsoft.com/en-us/library/bb668977.aspx?f=255&MSPPError=-2147217396.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Measuremen​t Studio with TFS Build Server

    Hello,
    I searched for both a FAQ and specific answers, so I hope I'm asking my question in the correct place.
    I am using the Enterprise version of Measurement Studio, and want to start a continuous build process using Team Foundation Server.  Adding the NI DLLs to my repository and setting the references isn't sufficient.  I get the following error:
    (CompileLicxFiles target) ->
    Properties\licenses.licx(4): error LC0004: Exception occurred creating type 'NationalInstruments.Restricted.AnalysisLicenser, NationalInstruments.Analysis.Enterprise, Version=9.0.35.292, Culture=neutral, PublicKeyToken=18cbae0f9955702a' System.DllNotFoundException: The NI License Manager client DLL was not found. Reinstall NI License Manager.
    Hence my question:  Is there a best practice or documented method to configure Measurement Studio to compile with the TFS Build Server?
    Thank you,
    Mike

    i recently began using jenkins as a build system (we develop not only in c# but also java, python and php for websites) and installed the full measurement studio on the buildserver. the only problem that occured after that was, that LC.exe sometimes stops working, so i wrote a 10 line autoit script to automatically close that window and now everything works as expected.
    maybe you should try to install measurement studio on your buildserver?

  • What target property must be specified while passing a object type variable to child package in SSIS 2012

    What target property must be specified while passing a object type variable to child package in SSIS 2012???

    As shown below, there is variable strVar and it's Value property is selected. Likewise you have to select the property that you need to pass.
    Please refer:
    http://www.bidn.com/blogs/MikeDavis/ssis/155/passing-variable-values-from-parent-package-to-child-ssis
    -Vaibhav Chaudhari

  • Biztalk 2009 and TFS Build

    we have  a situaltion like we have code merged our application and changed the solution version of the code created new code branch.
    we have build the solution it got succeded even the version of  DLLs have got changed
    when we build from TFS build agent its pointing to the rigtht node but the DLL versions are not getting chaged
    can you help us with this?

    Hi Sujith,
    I've also seen this happen. When the version number in the BuildNumber.txt file does not match the version numbers in the Property AssemblyInfo.cs file, the DLL version numbers do not get updated. Also, if you are adding new projects to an existing build
    and are finding just the new projects are not getting their DLL version numbers updated, make sure their Property AssemblyInfo.cs files match existing project's Property AssemblyInfo.cs files. 

  • MSTest not running in TFS build but tests works fine locally in visual studio

    Hi Team,
    I have 18 unit tests in my test project wanted to run in TFS build. But build says no tests to execute. please find the below details and images for more info.
    Even MSTest command is not working. 
    TFS : 2010
    BUild Server has visual studio 2010 ultimate with SP1.
    Thanks in Advance,
    Shree
    $hree

    Hi Shree,
    I am glad to hear you resolved the issue. Thanks for sharing your experience here, it is good to other members who experience the same issue in the community.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Reference problem in TFS build

    Hi
     I am getting reference problem in TFS build.
    how to update nugget package in  command prompt in TFS server.
    Please advice.
      Primary reference "EntityFramework".
    C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets(1697,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "EntityFramework". Check to make sure the assembly exists on disk. If
    this reference is required by your code, you may get compilation errors. [C:\Builds\1\ACIS\ACISApplication\src\ACIS.Model\ACIS.Model.csproj]
              For SearchPath "{HintPathFromItem}".
              Considered "..\packages\EntityFramework.6.1.1\lib\net45\EntityFramework.dll", but it didn't exist.
              For SearchPath "{TargetFrameworkDirectory}".
              Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\EntityFramework.winmd", but it didn't exist.
              Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\EntityFramework.dll", but it didn't exist.
              Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\EntityFramework.exe", but it didn't exist.
              Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Facades\EntityFramework.winmd", but it didn't exist.
              Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Facades\EntityFramework.dll", but it didn't exist.
              Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Facades\EntityFramework.exe", but it didn't exist.
              For SearchPath "{Registry:Software\Microsoft\.NETFramework,v4.5,AssemblyFoldersEx}".
              Considered AssemblyFoldersEx locations.
              For SearchPath "{AssemblyFolders}".
              Considered "C:\Program Files\Microsoft SQL Server\110\SDK\Assemblies\EntityFramework.winmd", but it didn't exist.
              Considered "C:\Program Files\Microsoft SQL Server\110\SDK\Assemblies\EntityFramework.dll", but it didn't exist.
              Considered "C:\Program Files\Microsoft SQL Server\110\SDK\Assemblies\EntityFramework.exe", but it didn't exist.
              Considered "C:\Program Files\Microsoft SQL Server\120\SDK\Assemblies\EntityFramework.winmd", but it didn't exist.
              Considered "C:\Program Files\Microsoft SQL Server\120\SDK\Assemblies\EntityFramework.dll", but it didn't exist.
              Considered "C:\Program Files\Microsoft SQL Server\120\SDK\Assemblies\EntityFramework.exe", but it didn't exist.
              Considered "C:\Program Files\IIS\Microsoft Web Deploy V3\EntityFramework.winmd", but it didn't exist.
              Considered "C:\Program Files\IIS\Microsoft Web Deploy V3\EntityFramework.dll", but it didn't exist.
              Considered "C:\Program Files\IIS\Microsoft Web Deploy V3\EntityFramework.exe", but it didn't exist.
              Considered "C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\bin\EntityFramework.winmd", but it didn't exist.
              Considered "C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\bin\EntityFramework.dll", but it didn't exist.
              Considered "C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\bin\EntityFramework.exe", but it didn't exist.
              Considered "C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\EntityFramework.winmd", but it didn't exist.
              Considered "C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\EntityFramework.dll", but it didn't exist.
              Considered "C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\EntityFramework.exe", but it didn't exist.
              Considered "C:\Program Files\Microsoft.NET\ADOMD.NET\110\EntityFramework.winmd", but it didn't exist.
              Considered "C:\Program Files\Microsoft.NET\ADOMD.NET\110\EntityFramework.dll", but it didn't exist.
              Considered "C:\Program Files\Microsoft.NET\ADOMD.NET\110\EntityFramework.exe", but it didn't exist.
              For SearchPath "{GAC}".
              Considered "EntityFramework", which was not found in the GAC.
              For SearchPath "{RawFileName}".
              Considered treating "EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" as a file name, but it didn't exist.
              For SearchPath "C:\Builds\1\ACIS\ACISApplication\bin\".
              Considered "C:\Builds\1\ACIS\ACISApplication\bin\EntityFramework.winmd", but it didn't exist.
              Considered "C:\Builds\1\ACIS\ACISApplication\bin\EntityFramework.dll", but it didn't exist.
              Considered "C:\Builds\1\ACIS\ACISApplication\bin\EntityFramework.exe", but it didn't exist.
      Primary reference "EntityFramework.SqlServer".

    Hi Narasimha,
    I'd like to know whether you can build locally with MSBuild. You need to make sure you can build successfully in local with MSBuild before you can use TFS build, since TFS build use MSBuild as its default compiler.
    However, from the error message, seems you don't have entity framework installed properly. Please have a try to reinstall entity framework for the needed version, also get the assemblies stored in GAC. If you have any other related concerns, you can
    open a new thread in entity framework forum for a better response.
    Best regards,

  • Invoking Beyond Compare script using TFS build script

    Hi,
    As a part of automated build process in TFS I used invoke-process activity to run Beyond Compare script to generate report for comparing different versions of same xls file. Report was never created. I had gone through the tfs build log and it does not show
    any error but with result = 0 ( as far as the beyond script is concerned "result=0" is successful). I compared same file of different versions manually on the same build server using beyond compare, it works like a gem resulting xml report. Same
    TFS build process for other format files like .csv and .txt works smoothly generating xml report. The only issue is with .xls files. 
    If not Beyond Compare is the right one to call its script from TFS build process, is there any other tool or software that fits to my requirement? I need your guidance and help to take it forward.
    FYI, We are using TFS 2010 and Beyond Comapare pro 3.3.3
    Thanks
    Adithya

    Hi Adithya, 
    Thanks for your post.
    In your build definition, change the Logging Verbosity =
    Diagnostic, then queue your build definition, after build run completed, you can find the build in
    Build Explorer, then open build in VS, under View Log section to check which command line be executed in your invoke-process activity section. Then logon your build agent machine, and try to execute the same command line, ensure
    the command line can be executed correctly and you will receive the expected result.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Web.config tranformations with TFS Build/Release

    Hello,
    We have recently started using TFS build/Release Manamement . I wanted to make continuous deployments to Dev and Test environments in one build by using the corresponding web.config transforms (Web.Dev.config and Web.Test.config). Please explain me the process
    and can we accomplish it in one build definition?

    Hi Pavani1234,
    Thanks for your post.
    For the configuration file transformations in Release Management, please refer to solution in this article:
    http://www.prowareness.com/blog/release-management-configuration-file-transformations-an-insight/ and the example in this
    http://vgaltes.com/index.php/2013/12/23/microsoft-release-management-part-3-configuring-the-release/.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Passing value to bind variable of another table from one table

    hi,
    I have a multi select table. When one row is selected from this table (no button is clicked, only selection is done), an attribute from that selected row (say userid) should be passed to the bind variable of another table and the corresponding details of that particular userid should be displayed in the other table. When more than one row is selected, the other table should display no rows.
    My main problem is what code has to be written to pass value to bind variable and where it should be written.
    Please give me a detailed explaination as soon as possible.
    Thank you.

    Sorry, didnot add this. The table is multi select table.

Maybe you are looking for

  • ALV to Excel problems

    HI      I have created an ALV report with 87 fields in it. Whenever I am trying to download that report into excel the number of column breaks into 2 rows. In this case, The downloaded file contains 57 Columns in 1 row and remaining 29 Columns in sec

  • Finding users in a group

    Hi everyone i am try to use ids:getUsersInGroup('name of the group', true,'remal name') function in order to retrieve the user names of a group and append them in the Users element of the related variable that is based on users element in identityser

  • Dynamic pages submitting data to stored procedure

    Hi, I am developing an Oracle Portal application and I am facing a problem, if anyone could help me I'd be very grateful. I have the latest version of Portal 3.0.9, installed on a linux server. I'm using I.E. 6.0 to interface with Portal. I have a dy

  • Can I append a Ticker on a Canvas?

    Hi, I am very new to J2ME. Just want to know whether it is possible to append a Ticker onto a Canvas as done in a Form. Please help me by giving any suggestions on some method to do this.

  • Loop Timing at alternating speeds

    I am having difficulty finding a solution to having i.e. controlling a lamp to remain OFF for longer periods than ON. There is Timer that allows no wait states if signal is False but it requires Front Panel action if the signal is True. Is there a VI