简体   繁体   中英

How to create different DLL's for different customers

I have several customers using the same application, but different customers have different needs. For example.

Default context menu

  • Add record
  • Delete record
  • Modify record

Customer 1 context menu

  • Browse database
  • Print record

Customer 2 context menu

  • Exit program
  • Print record
  • Modify record

How can I create 1 project (with multiple 'Setups') that creates

Setup 1

  • Main application
  • DLL Default Context menu

Setup 2

  • Main application
  • DLL Context menu Customer 1

Setup 3

  • Main application
  • DLL Context menu Customer 2

Or is there another way to create different setups in visual studio for different customers without recompiling main application for each one.

One way would be using #if #endif statements. You need to use #define or put the symbol into the project (under Project Settings, Conditional compilation symbols). Only when a symbol is present at build time, this part of the code will be build. The other part is not accessible anymore. I think you can make a own solution configuration for each customer with own symbols. Building each configuration seperate, gives you a own dll for each customer.

How you deliver these dlls to your customers, is your problem. Own setups for each customer would be perfect but you can make your setup different, but i have no clue about complicated setups.

There is a way to set these symbols from the outside. Our company has a own application, that starts vs for us, with all configs we want. I only know that we put a variable into the cs projects and thats get filled beforehand.

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