0

I have a software that up to now was run with UI or command scripts. My job was removing all UI and make it run automatically using tfs builds. Using TFS 2012 VS 2012

My questions: 1. How to run software that it is being build. I tried with MSBuild Arguments using

/p:DeployOnBuild=True /p:DeployTarget=Package /p:CreatePackageOnPublish=True
      /p:OutputPath=bin /p:VisualStudioVersion=11.0 /p:MSDeployPublishMethod=InProc 
      /p:MsDeployServiceUrl=localhost 
      /p:DeployIisAppPath=@"\\filer01\FDrive\public\documents\new\\"

No errors, but my testing solution doesn't produce anything. For testing it should create a file. Same code works fine from within custom code activity so it means the software doesn't run. I want to run software from source control.

Question 2. What is the best way to pass arguments from TFS Build Definition to software I am Building and Running? Can I call them from withing software?

Edit: Solution: custom activity:

var process = new Process
            {
                StartInfo = new ProcessStartInfo
                {
                    FileName = String.Format("{0}\\TestingForm.exe", binaries)

                }
            };

            process.Start();
            process.WaitForExit(); 
Claudius
  • 1,883
  • 2
  • 21
  • 34

1 Answers1

0

I've never tried the DeployIisAppPath argument but we routinely used TFS build definitions in the past to deploy our code to a remote IIS server. Works great. Maybe you can try dropping the DeployIisAppPath and deploying to local IIS instead?

The MSBuild arguments can be accessed during the build step. You can instruct MSBuild in your wpp.targets file to take those values and use them to alter the application files but it all depends how you want to use them.

chief7
  • 14,263
  • 14
  • 47
  • 80
  • I want to use them as configuration. I want to have about 70 build definitions using one template with same source but different configurations. I was thinking of creating xml or ini file on the fly and use that for configuration but also I was thinking of converting software to one big custom activity to also save space on the disk. Each build run = 60 MB * 70 * 2 times a day will end up taking lots of unnecessary space. – Claudius Jan 27 '16 at 13:10
  • Not sure what your question is. Need more info. – chief7 Jan 27 '16 at 18:37
  • Thank you for helping, I somehow figure it out with different approach. – Claudius Jan 28 '16 at 12:52
  • Please share your solution. – chief7 Jan 28 '16 at 13:51