Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio build not using Active Solution Configuration with WiX Project

Tags:

msbuild

wix

I have a VS2012 Solution with 3 build configurations:

  • Debug
  • Release
  • "Mine"

In the Configuration Manager, I have some .NET projects with options based on the Mine configuration. All ok.

I have a WiX installer project which in the Configuration Manager, appears to only support Release and Debug as options - I cannot add Mine as an option there.

As a consequence, when I build my WiX project, while each dependent C# project uses the Mine configuration, the WiX project uses Release.

Generally this would not be a problem, however I have a BeforeBuild action which is using $(Configuration). And this is pulling in Release instead of my desired and selected "Mine".

Any ideas how I can pass or reference Mine from MSBuild from a project that does not include it? Is there another $(ActiveConfiguration) or similar?

Thanks

like image 690
user1867382 Avatar asked Dec 24 '13 22:12

user1867382


People also ask

How do I change the build configuration platform in Visual Studio?

You can use the Configuration Manager dialog box to select or modify existing build configurations, or to create new ones. To open the Configuration Manager dialog box, in Solution Explorer, right-click on the solution node to open the shortcut menu for the solution, and then choose Configuration Manager.

How do I add WiX extensions to Visual Studio 2015?

To use a WiX extension when building in Visual Studio with the WiX Visual Studio package: Right-click on the WiX project in the Visual Studio solution explorer and select Add Reference... In the Add WiX Library Reference dialog, click on the Browse tab and browse to the WiX extension DLL that you want to include.

Is not selected for building in solution configuration debug any CPU?

When building a Visual Studio project, you may encounter the following error: The project "MyProject" is not selected for building in solution configuration "Debug|Any CPU". This error occurs because the project has not been configured to build in your Visual Studio solution.


1 Answers

I do believe it's a bug in WiX. If you edit your wxproj file, you should see that there is no record for "Mine". To fix such issues, you need to edit wixproj file manually and copy the relevant section for "Release" mode and dupliate it and change it to "Mine".

Some links: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Adding-deleting-project-configurations-td7582655.html

http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Changing-configuration-and-or-platform-in-solution-Configuration-Manger-does-nothing-td7588992.html

like image 106
Erti-Chris Eelmaa Avatar answered Sep 28 '22 06:09

Erti-Chris Eelmaa