简体   繁体   中英

Visual Studio 2008 C# Deployment Variables

I inherited a project, that was just a modified sample project from Honeywell.

Whenever you make a build, you have to uncomment lines for variables setting the client, the server url, and the device the build is being made for. Then, you need to go into the solution's Cab project, and change the application name (based on client / server), and change the shortcut's name to match. After the build, I then need to rename the CAB file it created. And usually I have to do this for a combination of 5 servers, 3 clients and 2 devices.

It's all very redundant. My absolute ideal would be to pick each ( or the combination "Client Server Device" ) from a dropdown ( such as the configuration ), then simply make the build. Most of my googling around suggests I can make this much more streamlined using "Configurations", but I can't seem to find instructions on how to actually set it up.

I am limited to Visual Studio 2008 due to .NET restrictions (v3.5) on the Honeywell SDK.

Any help would be greatly appreciated.

You need to separate out build-time parameters (baked into the code at build time), from install-time parameters (determined when the software is installed), from run-time parameters (configurable at run-time, eg, after installation). Typically things like server urls are environment specific and are should therefore be determined at install-time, not at build-time as this project you inherited seems to be doing. You need some sort of installer to enable the configuration of the install-time parameters, and possibly an administration utility to enable the configuration of any run-time parameters after installation.

The goal is to be able to build once, but install many times (into different environments with different configurations).

There are a lot of tools available to help with this. This is a list of build automation tools: https://en.wikipedia.org/wiki/List_of_build_automation_software#Continuous_integration_tools . And here is a list of tools for writing installers: https://en.wikipedia.org/wiki/List_of_installation_software .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM