mikeobrien.net Curriculum Vitae Blog Labs
Thursday, June 11, 2009

I have an WiX installer project that I wanted to produce the output as the product name and version number. This is pretty simple to do. First unload/edit your project file and then update the "AfterBuild" target as follows:

<Target Name="AfterBuild">
  <GetAssemblyIdentity AssemblyFiles="$(SolutionDir)MyApplication\bin\MyApplication.dll">
    <Output TaskParameter="Assemblies" ItemName="GetVersionAssemblyInfo"/>
  </GetAssemblyIdentity>
  <Copy SourceFiles="$(TargetPath)" DestinationFiles="$(TargetDir)MyApplication%(GetVersionAssemblyInfo.Version).msi" />
  <Delete Files="$(TargetPath)" />
</Target>
Thursday, June 11, 2009 2:09:00 PM (GMT Daylight Time, UTC+01:00)  #   |  Comments [0]  |  Trackback
Monday, July 28, 2008

Will Smith so kindly pointed out that the target file for web application projects is not installed by the .NET 3.5 redist (Along with msbuild). To fix this you can copy over the target file from a machine with VS2008 installed to the same folder on build server. The target file can be found under <ProgramFiles>\MSBuild\Microsoft\VisualStudio\v9.0\WebApplications.

Monday, July 28, 2008 9:21:18 PM (GMT Daylight Time, UTC+01:00)  #   |  Comments [0]  |  Trackback
Monday, November 26, 2007

I've tried playing with custom configurations (Outside the stock Debug/Release configurations) in the past and found it confusing. So today I tried it again and had much better success. One thing that had me confused is the relationship between Solution level configuration and Project level configuration. What I didn't realize is that they are all completely separate entities... The "Debug" configuration in SolutionA is different from the "Debug" configuration in ProjectA. The "Debug" configuration in ProjectA is different from the "Debug" configuration in ProjectB. They all just happen to have the same name for consistency (Which is where my confusion began; guess I should have read the manual...). Although they are different entities, project level configurations can be mapped to a solution level configuration.

The example below shows a possible configuration. The solution has 2 configurations: "PlanA" and "PlanB". The BLL project have 2 configurations: "Production" and "Staging". The UI project has 2 configurations: "Red" and "Blue". The "PlanA" solution configuration has the BLL project configuration set to "Staging" while the UI project configuration is set to "Red".

image

So basically the "PlanA" and "PlanB" solution configurations represent a specific combination of project configurations. When you build a solution with a specific solution level configuration it will know what project level configuration to use with each of the individual projects in the solution. "PlanA" would use "Staging" for the BLL and "Red" for the UI.

Another thing that got me is how to add/edit/remove the project level configurations. It's pretty simple; the solution level configuration dropdown (Shown in red above) has a "<New...>" and "<Edit..>" item that enables you to modify solution level configurations. Also each individual project has a configuration dropdown (Shown in blue and green above) that give you the same options for project specific configurations.

Another thing to remember is that when you add a new project, the Debug/Release solution configurations will be automatically re-added. So if you removed these earlier they will have to be removed again.

Oh, and one more thing. Website Projects (WSP) show up as having only one option for configuration and platform with no modification options (Shown in red below). This is because configurations do not apply to a WSP (Since it isnt really a project and does not have a project file). It's a little misleading that there is one item in the list as if its assigned to it. It should just be disabled IMO. In any event it can be ignored. If you want to configure build options for a WSP, create a corresponding Web Deployment Project (WDP). You can then create configurations on the WDP that apply to the the WSP.

image

Monday, November 26, 2007 9:31:44 PM (GMT Standard Time, UTC+00:00)  #   |  Comments [0]  |  Trackback
Creative Commons License