开发者

Can a VS project generate two execute files?

开发者 https://www.devze.com 2023-01-10 17:45 出处:网络
I want to develop a application including two execute files(one as main entry,the other as upgrader).

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:

  1. Model code
  2. Standalone executable
  3. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号