visual-studio-2013,tfs,msbuild,wix , Deploy Any CPU build with WiX to x86 using MSBuild


Deploy Any CPU build with WiX to x86 using MSBuild

Question:

Tag: visual-studio-2013,tfs,msbuild,wix

I have a set of solutions that build a complete .NET Any CPU application. I have a WiX project that will deploy that application as x86 and I can run this all manually in Visual Studio 2013 without any issues. Now I'm trying to get this to work in MSBuild / TFS. The conflict is that I need to specify Any CPU for the code and x86 for WiX. My initial thought was to just hack the WiX solution / project to be Any CPU in name but let it actually make an x86 MSI. However the wixproj setup won't allow Any CPU to be used. I would expect the same issues with Any CPU and a 64 bit installer. WiX seems determined to not allow Any CPU.

The remaining option that I'm seeing here is to not build the WiX part with MSBuild but instead handle that in a post build batch file. However it really seems you should be able to deploy Any CPU code with WiX.


Answer:

It seems that WiX projects use the platform configuration to determine what mode they're building in so they only allow x86 or x64 platform configurations. So it is not possible to build a WiX project in the 'Any CPU' platform configuration because that platform does not exist.

The easiest option for to get your WiX project build in 32-bit (or 64-bit) is to set up a solution that has both your .NET projects and your WiX projects, like the image below. The projects in the first rectangle are the C# projects and the second rectangle has the WiX project in it.

Visual Studio solution with C# and Wix projects

Then setup one or more solution configurations for this solution with the .NET projects as 'Any CPU' and the WiX project as x86 (or x64 for the 64-bit installer). For example like this:

Solution configuration at Any CPU

If you want to have both an 32-bit and a 64-bit installer then I would recommend making an x86 solution configuration and a x64 solution configuration. Set your .NET projects to build either in the 'Any CPU' configuration or in the respective bitness (x86 or x64) and set the WiX project to build in the correct bitness (x86 for the 32-bit installer and x64 for the 64-bit installer).

Note that in either case you need to make sure that the installer project picks the binaries from the location where they are being placed by the compiler.

Then set your TFS build definition to build this solution with the solution configuration that you created. Like in the image below

enter image description here

TFS will then build your solution with the correct solution configuration which should build both your .NET projects and your WiX project in their respective correct configurations.


Related:


When I type static, Visual Studio replaces it with ContextStaticAttribute [closed]


c#,visual-studio-2013
Every time I'd put in static it would keep replacing it with ContextStaticAttribute. I need 10 rep to post images, but here's the link: http://i.imgur.com/jBOOF3s.png) I also do not want to have to press the right arrow to put in a local variable!...

Searching user tasks by task.body text


c#,visual-studio-2013,vsto,outlook-addin
Good morning all! I have spent a good bit of time searching and reading forums about this, but I can't seem to find a solution. Any help you all can offer is greatly appreciated. I have created an Outlook Add-In via C# and Visual Studio 2013. This add-in will create...

How can I run “query session” using vb.net?


vb.net,visual-studio-2013,cmd
I would like to get the results from executing "query session" in the cmd.exe and Store them in a string variable using VB.NET. I have been searching for two days now and I cannot get to run the command, I will try to save the result once I get the...

TFS Build Template Copy Directory and Exclusion of files


tfs,tfsbuild
I have TFS Build Default Template and I added to it, between "Run on Agent' and "Check In Gated Changes for CheckInShelveset Builds", Copy Directory with Source BuildDetail.DropLocation and destination a shared directory on a server. My problem comes that the Copy Directory is not executed or is executed, but...

VS2013 Error: LNK2019 When trying to build ZeroMQ server


c++,visual-studio-2013,zeromq
I'm trying to build this simple ZeroMQ server in C++ on Visual Studio 2013. #include "stdafx.h" #include "zmq.hpp" #include <string> #include <iostream> #include <windows.h> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { // Prepare context and socket zmq::context_t ctx(1); zmq::socket_t sckt(ctx, ZMQ_REP); sckt.bind("tcp://*:5555"); while (true) { zmq::message_t request; //...

How to stop visual studio generate typescript js and js.map files while publishing


visual-studio-2013,configuration,typescript,publishing
I set up my project that combine javascript output into file to $(ProjectDir)dist\output.js and uncheck generate source maps. Tools -> Options -> Text Editor -> Typescript -> Project -> Automatically compile Typescript files which are not part of a project is unchecked as well. While building and running project from...

TFS Work Item configuration - concatenate multiple fields to 1 string field


tfs,tfs2013,tfs-workitem,tfs-process-template
I've noticed, as we've started customizing TFS work item types, the workarounds that we have to do to have TFS support some basic tasks. One thing that we are trying to do is have a field that consists of concatenating 3 other fields. For example: New_Field = Field_1 + ",...

using for loop for a textbox in selenium C#


c#,visual-studio-2013,selenium-webdriver
for(int i=0;i<=10;i++) { Driver.Instance.Find Element(By.Id("id of element")).Send Keys("auto"+i); } I used this code but it does not work 1 to 10 numbers are printing in one attempt I am searching for the code which dynamically increment in each run with out changing the sendkeys values again and again...

HTTP Error 403.14


asp.net-mvc,visual-studio-2013
I'm developing my MVC 5 app using VS 2013, it was working fine, but suddenly it's giving the following error. HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory. I've already read this post, and it didn't solve the problem. I've...

Visual Studio C# Unit Tests


c#,unit-testing,visual-studio-2013
I'm trying to learn Unit Testing in C#. But I don't see how to relate the testmethods to the actual methods. In one guide it told me to right click the method name and click create unit test. I don't see that. Another told me to create a Unit Test...

Visual Studio 2013 closes


visual-studio,visual-studio-2013
I recently installed Visual Studio 2013, so I'm relatively new to it. I'm trying to run the code below: #include <iostream> int main() { std::cout << "Hello World! "; } but the terminal that's supposed to open to display "Hello World" closes immediately and doesnt give me the chance to...

Change mapping option replaced with cloak option in TFS


visual-studio-2013,tfs
I want to change the mapping location for trunk in TFS and get latest but instead of 'change mapping' I now have the option to 'cloak'. What do I need to do in order to get the 'change mapping' option back again? I can't see a way to change the...

How to make a programs icon in the task bar change based on something like time? [duplicate]


c#,.net,vb.net,visual-studio-2013
This question already has an answer here: Can I change my programs tray icon while it runs in c#? 1 answer I just want to know how to change the default program icon to have the current time on it and have it update whenever necessary. Thanks for any...

How to use ajax to post json string to controller method?


jquery,asp.net-mvc,visual-studio-2013,asp.net-mvc-5
I want to be able to post a json string to a control action but it's always receive the string as null. If I create a view model for the controller method, it works, but that's not what I want since there will be too much view models to maintain....

Tfs and nuget: project files are forever in check out after build with restore nuget packages


visual-studio-2012,tfs,nuget
MS VS 2012 I have solution in tfs with enabled nuget packages restore. Every time when I build solution all my project files are cheked out with this changes: <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" /> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet...

Visual Studios building and debugging .cpp file without main()


c++,assembly,visual-studio-2013
Professor just gave us a block of c++ code in order to learn about the debug windows in Visual Studio, however after creating a blank win32 console project and then dragging in the .cpp file I get the missing .exe error message when attempting to debug. I've looked everywhere and...

Can't reinstall package


visual-studio-2013,nuget
On a new Win8.1 reinstall, with all of my code restored from backup, I'm suddenly now getting a yellow NuGet warning when I issue the command update-package -reinstall -project ui: Skipped reinstalling package 'AeroWizard 2.0.9' in project 'Ui' because the package does not exist in the package source. I'm using...

TFS 2013 Dashboard contributor graph like in github


tfs,tfs2013,tfvc
Is there a way to show a graph of repository contributors in TFS 2013 dashboard like github shows as shown here : About Repository Graphs ETA: I need graph for TFVC...

Method declared with dynamic input parameter and object as return type in fact returns dynamic


c#,.net,dynamic,visual-studio-2013
namespace ConsoleApplication1 { class Program { static void Main(string[] args) { var objectGetter = new ObjectGetter(); var obj = objectGetter.GetItem(); //Visual Studio shows that obj type is System.Object } } public class ObjectGetter { public object GetItem() { dynamic dObj = "123"; var obj = this.Convert(dObj);//Visual Studio shows that obj...

Relationship between SonarQube Runner and SonarQube.MSBuild.Runner


tfs,msbuild,sonarqube,sonar-runner
Regarding the announcement of SonarQube integration with MSBuild and Team Build, can anyone advise on the relationship between SonarQube Runner and SonarQube.MSBuild.Runner? I'm unclear whether SonarQube.MSBuild.Runner replaces SonarQube Runner or whether it sits on top of it.

Visual Studio 2013 C# compile with /main


c#,visual-studio-2013
I'm new to programming and I'm trying to write a code for a port scanner. When I click build I'm getting the following error messages...I realize its the same error just in two different locations but I figured it would hurt to list both: Error 1 Program 'c:\Users\pat_000\Documents\Visual Studio 2013\Projects\WpfApplication2\WpfApplication2\obj\Debug\WpfApplication2.exe'...

TF400889 Long path error received from TFS


visual-studio-2013,tfs,tfvc
Can someone please help me out with this? I tried using long path tool but they want me to pay in order to delete the folder. However I cant find the file the system is complaining about. I went to the folder C:\Users\Casey\Desktop\Workspace\LegalHoldings\Sprints\Sprint5\Expunctions\LegalHoldings.Expunctions.Service.External\ServiceReferences\FillingReviewMDEService\LegalHoldings.Expunctions.Service.External.FilingReviewMDEService.GetFeesCalculationsResponse.datasource This file:...

How do I install the Wix extension on after a Visual Studio 2013 Update?


visual-studio-2013,wix
I have installed Wix 3.9 on VS 2012. Recently, I just got VS 2013 and I am not sure how to install just the extension on there? How do I do without uninstalling wix 3.9 and reinstalling it back again?...

Adding WCF Services / Project Templates in Visual Studio Pro 2013?


c#,wcf,visual-studio-2013,sharepoint-2010
I'm very new to .NET and developing within VS, and I'm trying to make a few basic WCF Web Services for testing purposes. I'm running Visual Studio Profession 2013 on a Win 7 x64 computer that is also running Sharepoint 2010 Server. I'm trying to go through the following tutorial:...

How to get previous version using git and VS Express for web 2013?


git,visual-studio-2013
I want to find the cause of a bug which caused by one of the recent commits. Is it possible to get a specific version, and then undo the checkouts?

Programmatically accessing TFS history [closed]


c#,.net,powershell,tfs
I have a solution under TFS source control and had written some sample code using an external library that was deleted a few months ago. I am certain that the code was checked in before that class file was deleted. I am able to manually browse to previous versions of...

Using Try/Catch block to set file path?


visual-studio,visual-studio-2013
I'm having a bit of trouble figuring out an assignment for my Visual Basic course. I am told to assume that a given text file is not in the \bin\Debug folder of my program, so I am trying to throw an exception error and get the correct path from the...

Using/abusing a conditional breakpoint to manipulate a value


.net,visual-studio-2013,visual-studio-debugging
For a temporary workaround, I have to set User.ID to 0 in a certain line. My usual approach for similar cases is to set a breakpoint at the corresponding line and use the watch to manipulate the value: User.ID = 0 In an attempt to streamline this by automatically setting...

VS2013 Is Not Compatible With VS2015 Project Type


asp.net-mvc,visual-studio-2013,asp.net-mvc-6
I am using Visual Studio 2013. But when i open the MVC project code in Github: https://github.com/betimer/Mvc I found that the solution was built on the new type (project contains: xxx.xproj + xxx.json) (I think they are VS 2015 types) Is there any way to let my VS 2013 compatible...

Creating a 25fps slow motion video from a 100fps GoPro .mp4 video with C++/OpenCV


c++,opencv,video,visual-studio-2013,slowmotion
I have a 100fps .mp4 GoPro video and I want to create from it a slow Motion one with 25fps. I'm trying since two days but to no avail. I could play the video, save a video from the GoPro's WiFi stream, but when I try to read the 100fps...

Visual Studio Ctrl + F search freezes when including a '(' character


visual-studio,visual-studio-2013
For some reason whenever I include the '(' character in a Ctrl + F search in Visual Studio 2013 the search bar never works. It doesn't matter what other text is included in the search bar. It doesn't matter if I choose to search on just the current document, or...

Cannot add new shared dataset to report


visual-studio-2013,reporting-services,sql-server-2008-r2,ssrs-2008-r2
I have a summary report with about 20 datasets, linking to 20 detail sub-reports. I have added datasets based on stored procedures for each of the detail reports. Now when I try to add another one I get an error message Could not create a list of fields for the...

IIS Express 8 - Max allowed length


c#,asp.net,iis,visual-studio-2013,iis-express
In case the below is too long, my question is whether IIS Express 8 in Visual Studio 2013 obeys the maxAllowedContentLength attribute or if it has some overriding value that prevents large requests When debugging some webapi calls against Visual Studio 2013, I'm receiving this error: Maximum request length exceeded....

Visual Studio Assembly force-installs Target Framework


c#,.net,visual-studio-2013,.net-framework-version
I have this Assembly targeted at .NET 3.5. The code will work on later versions as well, but I like this to work on Windows XP. I mean, .NET is backwards compatible, right? I can run apps for .NET 3.5 on Windows 8.1. However, when I run my own assembly,...

Parallel.ForEach loop is performing like a serial loop


c#,tfs,parallel-processing,invalidoperationexception,parallel.foreach
I've spent about 8+ hours searching online for help and I couldn't find anything so, here goes. I'm working with Team Foundation Server and C# and I'm trying to acquire a list of work items and convert them into a generic object we made to be bound to a special...

How to create a folder that contains the current date and time instead of name


winforms,visual-studio-2013,c++-cli
I use C++ Windows Form application in Visual Studio 2013 for one project. I wonder how to create a folder that contains the current date and time instead of name? It is possible to make such folder?? DirectoryInfo^ directory = Directory::CreateDirectory("C:\Users\Desktop\" + ??); ...

Ability to vote on User Story?


tfs,tfs2013
I would like my stake holders to be able to vote on user stories or features in TFS 2013 (or 2015 if this is coming?). The end result is so I can see how much interest there is in a given idea and help prioritize work. This seems like something...

Visual Studio 2013 LINK : fatal error LNK1181: cannot open input file


c++,visual-studio,opencv,visual-c++,visual-studio-2013
I am using Visual Studio 2013. I'm trying to build some code given to me from my professor and I keep getting this error: LINK : fatal error LNK1181: cannot open input file 'C:\Users\manduchi\Documents\eyegaze\EyeGazeDemo..\Libraries\OpenCV\lib\opencv_core249.lib' However, on my computer opencv_core249.lib is located somewhere else. I've tried updating the linker directories to...

How can I add a .props file to a C# project?


azure,visual-studio-2013,azure-webjobs
I am trying to set up continuous delivery of Azure Web Jobs, and came across this post from the Azure blog. One of the steps there is to add a .props file to the web job application's properties. I am having difficulty adding a .props file. My web searches indicate...

OData Endpoint with .NET


c#,asp.net,visual-studio-2013,odata,web-api
I am trying to create an odata endpoint for a table valued function in a database. I am sure with the code, however upon running the application i get the error Server Error in '/' Application. Parser Error Description: An error occurred during the parsing of a resource required to...

In Visual Studio 2013, what does this black arrow-shaped symbol in the breakpoint bar mean? [duplicate]


c#,visual-studio,visual-studio-2013,ide
This question already has an answer here: Black dash / line on visual studio 2012 left margin 1 answer Somehow, one of the lines in my source code became marked with a black arrow-shaped icon pointing to the right. I'm familiar with bookmarks and breakpoints, but I can't find...

Redirect Visual Studio to new TFS Location


visual-studio-2013,tfs
We have migrated TFS from one server to another. I have verified that the source files and history do exist in the new server location. How do I now redirect Visual Studio to look at the new server location? I would like to not lose any of the files, history...

How to install Xamarin for Visual Studio 2015 when Visual Studio 2013 is installed too?


visual-studio-2013,xamarin,visual-studio-2015
I install both Visual Studio 2013 and 2015. I need install Xamarin for VS 2015. But I can't do it because by default it's installing for VS 2013.

The name 'Thread' does not exist in the current context


c#,visual-studio-2013,namespaces
When I put this code Thread.Sleep(2000); it gives me the error: The name 'Thread' does not exist in the current context`. I already included the namespace using System.Threading;. See System.Threading.Thread.Sleep() on MSDN....

RichTextbox write in place to current line


c#,text,visual-studio-2013,richtextbox
Clarification: I want to output line of text to the same "position" in a RichTextBox, replacing the previous line. In C# Windows Forms Application trying to use RichTextBox for displaying messages. Most of the messages are appended, so that is fine but at one point in the program it has...

Visual Studio 2013 Report RDLC with related datasets


visual-studio-2013,report,relational-database,rdlc
I currently have two tables in a database "customer" and "pricelist" where a customer can have multiple pricelist items linked to their ID. I'm trying to build a report in VS2013 where it lists all customers [alphabetically], then all of their pricelist items [alphabetically], then page break between each customer....

devenv.exe hogs CPU when debugging


asp.net-mvc,visual-studio-2013
Short version: When I debug ASP.NET MVC apps in VS2013 and try to edit razor views or css files, the CPU usage of devenv.exe skyrockets to the point where VS becomes unresponsive. Browser link is turned off, yet this still happens. Restarting debugging doesn't help, restarting VS doesn't help, restarting...