Can a VS project generate two execute files?
I want to develop a application including two execute files(one as main entry,the other as upgrader).
I'm wondering if the two execute files can be generated in a开发者_运维技巧 VS project ?
if can't,are there better way to develop the two execute files? and how to share some Model code?
thanks in advance!
You can extract you models into a separate project and reference that from any other projects in the solution.
A project would be an executable or a dll full of classes (your model classes), and a solution can have any number of projects which can reference any of other projects in the solution as well as external .dll files.
To add a project to a solution just right mouse click the solution and select add new project. If you only have one project open in visual studio use the File menu to add a new project
This link might help
You can just create to WinForm applications and a class library, so you would have:
- Main Application (Windows Form App)
- Upgarde Application (Windows Form App)
- Common Module (Class Library)
Of course the Upgarde Application doesn't have to have a form, you could remove the form and just stick your code in Main()
You need at least three projects:
- Model code
- Standalone executable
- Upgrade executable
The exe project is normally a very thin bootstrapper that executes code in another assembly. This approach allows you to share code between different projects.
精彩评论