简体   繁体   中英

How to merge several Visual Studio projects in 1 Launcher project

So i made 6 different little applications each in its own Project.

And my idea is now to build some kind of Launcher with 6 buttons each of them launching their respectives applications.

I know how to /Add/Existing Projects/Select Project, but my worry is more upon managing to run those application on a Button_Click.

I'm thinking about copy/paste-ing my .cs files of each apps, and their resources.

Should I ? Shouldn't I ? What would be the best thing to do ?


EDIT1

Well, as i said, my apps are very small, i mean like very very small. It's mostly about automating templates mails sendings and opening/closing reports.

All my apps are in a single form each and they only refer to .png or .txt to store datas or dress up fancy-ish reports with images.

Right now, I'm in the process of importing FormX.cs one by one, as NonStatic said, re-referencing the UI and renaming some functions. I did 2 so far, and i'm hitting a generic file path issue.

I'm not sure how ressources are working once the .exe is built. Are they "embed" whereever the ressources file is located ? (Resources folder, or ..\\bin\\debug) or should i be carefull with this and systematicly put tehm in some specific folder ?

Also, thanks for your point Zdravko Danev, i was about to just copy/paste everything. You made me think slower about this. But i'm kind of searching for a real merged solution, "fusioned solution" if i may say. I don't want buttons to just run .EXEs. :p


EDIT2

I managed to copy/paste all my forms, was kinda easy, though time consumming to check every references. But it's done.

Most definitely do not copy the code!

It is relatively easy to create a simple launcher. Take a look at Process.Start:

https://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx

I think your question is not about merge projects but how to launch them in a uniformed application or launcher.

  1. You could copy files together, rebuild user interface. In the user interface, calling methods in the copied files. Then you could public a single EXE file other than multiple files.
  2. If your original projects generate dll files, you could build a new app which reference those dll files. Loading them when you need it and invoke methods from there.
  3. If your original projects generate exe files, then @Zdravko's solution, using Process.Start() to launch those exe files with correct parameters.

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