WiX build failing in TFS but working locally - tfs

We're using TFS Server 2010 for continuous integration, and also using WiX 3.7 for building. I'm having a problem with the build failing in TFS with the following error:
Unresolved reference to symbol 'Directory:DocumentationDirectory' in section 'Fragment:SharedFragment'.
Now the build works fine on my local machine, but fails in TFS. There is a DocumentationDirectory element in the script so I have no idea why TFS is failing. I've asked around the office and no one can help so I'm posting on StackOverflow.
Any ideas? Help greatly appreciated!
Mark

I have now found the cause of the problem: programmer stupidiy! I had another project in VS that was unloaded but being built by the TFS Server.

Related

Error building installshield project with TFS 2013

I'm trying to build a fairly complex project using TFS that was just upgraded from InstallShield 2013 to 2015 and I got all of the errors except for this one:
C:\Program Files (x86)\MSBuild\InstallShield\2015\InstallShield.targets (77): -7325: An unexpected error occurred validating the architecture for file C:\Users\sa_pgtfs\AppData\Local\Temp\ISCE9F4.tmp\AWSSDK.dll.
Any ideas on how to approach this?
You could first try to run the build on the build agent manually (with build service account) to narrow down if it's an environment issue.
It's better to make sure the build agent environment is as same as your local develop machine. Such as VS version , InstallShield version...
Double check if the AWSSDK.dll is exist on the build agent.
Another thing is try editing your build platform to specify x86. You could do this follow answer in this question Howto Force TFS 2010 to build a website using the 32bit ASPNET Compiler on a 64 bit build machine

Nunit3TestAdapter and TFS Build vNext: Getting a warning: Dependent Assembly nunit.framework not found within VS Test step

I've been scouring various Nunit articles for the past several days trying to figure out the issue with why my Nunit tests are not running.
I am using TFS 2015 Build vNext engine and the Visual Studio Test step to execute my Nunit test cases. The VS 2015 solution used for generating the Nunit test dlls contains the several .net projects and 2 Nunit test projects. Nunit3.0 and Nunit3.0 Test Nuget packages are being used to create and execute the tests. Here is the nuget configuration and nunit.framework reference in my Visual Studio 2015 solution. The test cases run fine in the Visual Studio IDE and compile without error when the solution is build in vNext.
When the VS Test step executes in Build vNext, I get the following warning:
Warning: Dependent Assembly nunit.framework of E:\TFSBuild_Directory\14\s\EBS\B_WebEnable\ABC.Data\ABC.Data.Core.Nunit.Tests\obj\UnitTesting\ABC.Data.Core.Nunit.Tests.dll not found. Can be ignored if not a NUnit project.
The VS Test step is configured:
VS Test Step Configuration
I have confirmed on the build server that the nuget packages are getting restored to the build server and the Nunit.framework.dll appear to be in the expected file path as compared to my local path.
Any ideas as to what could be causing this issue? Any input is appreciated!
I have restored Nunit and Nunit3TestAdapter from Nuget to have a test on my side, but couldn't reproduce your issue. I'd like to share my steps here for your reference:
Restore Nunit and Nunit3TestAdapter from Nuget in VS for the test project (as your first screenshot), and check in the packages.config file.
In "Visual Studio Test" task, specify $(Build.SourcesDirectory)\packages in "Path to Custom Test Adaptors". As if there is a packages folder in the sources directory, it is automatically searched for testadapters (It seems you have a long path, you may need to check it).
I use the default VS template:
No error or warning occurred during this process. You can compare your steps with mine and correct yours. Hope this helps you.
Ok - after stepping away from the issue and coming back to it with fresh eyes, I found the issue causing the nunit.framework.dll issue.
After going step by step through the build definition, I forgot that I had an MSBuild parameter in the build step that was copying the compiled output to another location /p:OutDir=$(build.stagingDirectory)\ABC. Once I changed the test step to point to the new location, everything worked fine. Thanks everyone for the feedback!

What am I doing wrong - problems building using TFS 2012

I am trying to get the most basic configuration of TFS 2012 up and running.
So far I installed the TFS server using the simplest option (the 1st option in the installer - the one that comes with a bundled SQL express),
I configured the build service (1 controller, 1 agent, both on the TFS machine).
My project consists of 2 parts: a C#/silverlight part, and a C++ part.
After adding the silverlight prerequisites the C# project builds correctly.
However I can't get the C++ project to build.
I guess I am missing a prerequisite since I am getting the following errors:
C:\Builds\1\proj1\Client\src\Code\Client\proj\main (VC11).vcxproj
(19): The imported project "C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\v110\Microsoft.Cpp.Default.props" was
not found. Confirm that the path in the declaration is
correct, and that the file exists on disk.
Indeed, the TFS server does not have a "C:\Program Files (x86)\MSBuild\Microsoft.Cpp" folder (while my dev machine has one).
I installed the windows SDK, but that didn't help.
I saw on some posts that I need to install VS 2012 on the build machine. Is that correct? will VS express do?
I have been banging my head on this for the last 2 days, and any help would be appreciated.
Installing Visual Studio on your build server seems like a strange thing to do, but having been around the TFS block a bit, I have found it to be the simplest way to manage build servers.
You can copy the files manually from your dev machine to your build server, but if an update to visual studio comes out, you will need to figure out what has changed and make sure you update all those files too. These files typically include Targets files and associated dlls.
Also with all the extensions and packages that are available now, it is just easier to load Visual Studio on your build server and install the required packages than try to work out what is needed to replicate the functionality.
This was made very clear to me recently when Microsoft released ASP.Net and Web Tools 2012.2. This altered the publishing pipeline for Web Sites and Web Projects and I needed to use this in my TFS build. It was so much easier to just be able to log onto my build server, load Visual Studio and download the new update.
I would definitely support installing Visual Studio on your build server.

Why Code Analysis is not working on TFS 2012 build?

As suggested in one of the related questions that you need to install VS 2012 on the TFS 2012 build server to run Code Analysis as a part of build process.
Due to some reason it is still not working nor giving any error.
Build settings for Code Analysis is set to Always but still it does not run.
However, I have open the same project on the TFS build server in VS 2012 and try to run the Code Analysis and it ran successfully.
I need to get it working.
Can anyone please suggest if I am missing anything here?
You project configuration will need a Code Analysis Ruleset to run against.
You can set this per configuration in your Project Options:

MSBuild or TFSBuild Conditional for One Project?

I have a long-time-to-build (setup) project in a Visual Studio 2010 Solution. It is set not to build in the Solution configuration. That way, when a developer builds locally they are not burdened with waiting for the setup to compile in Visual Studio.
However, I am looking for a way to change the configuration in tfsbuild or msbuild files so whenever things are built on the server, the setup project is always built, regardless of what the setting might be when a developer checks in their solution. TFS 2008 is the source control system but just a plain Server 2008 (with devenv fully installed) is the build server.
All clues appreciated.
Thanks.
I would suggest creating a new configuration in your solution, named e.g. Release_Setup, that way you have seperate configurations for developer and setup build (note that developers can choose that config and build everything locally if they so choose, which is quite nice when all Build agents are busy and you want to check that everything's fine).
In Solution Properties->Configuration Properties->Configuration you can even tell it to build the normal Release Configuration and still choose which projects to build and which to exclude.
Hope this helps. I haven't actually tested this, so please try it and comment back if there are any problems or this doesn't solve your specific question.

Resources