简体   繁体   English

如何在1个Launcher项目中合并几个Visual Studio项目

[英]How to merge several Visual Studio projects in 1 Launcher project

So i made 6 different little applications each in its own Project. 因此,我在自己的项目中分别做了6个不同的小应用程序。

And my idea is now to build some kind of Launcher with 6 buttons each of them launching their respectives applications. 我现在的想法是用6个按钮构建某种启动器,每个按钮启动各自的应用程序。

I know how to /Add/Existing Projects/Select Project, but my worry is more upon managing to run those application on a Button_Click. 我知道如何/添加/现有项目/选择项目,但是我更担心的是设法在Button_Click上运行那些应用程序。

I'm thinking about copy/paste-ing my .cs files of each apps, and their resources. 我正在考虑复制/粘贴每个应用程序的.cs文件及其资源。

Should I ? 我是不是该 ? Shouldn't I ? 不是吗 What would be the best thing to do ? 最好的办法是什么?


EDIT1 编辑1

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. 我所有的应用程序都以单一形式存在,并且它们仅引用.png或.txt来存储数据或用图像装饰精美的报告。

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. 现在,正如NonStatic所说,我正在一个接一个地导入FormX.cs,正在重新引用UI并重命名一些功能。 I did 2 so far, and i'm hitting a generic file path issue. 到目前为止,我做了2个,但遇到了通用文件路径问题。

I'm not sure how ressources are working once the .exe is built. 我不确定.exe生成后资源如何工作。 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 ? (资源文件夹,或.. \\ bin \\ debug),还是我应该谨慎处理,并将tehm系统地放在某些特定的文件夹中?

Also, thanks for your point Zdravko Danev, i was about to just copy/paste everything. 另外,感谢您的发言,Zdravko Danev,我将要复制/粘贴所有内容。 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. 我不希望按钮仅运行.EXE。 :p :p


EDIT2 编辑2

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: 看一下Process.Start:

https://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx https://msdn.microsoft.com/zh-CN/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. 然后,您可以公开多个文件以外的单个EXE文件。
  2. If your original projects generate dll files, you could build a new app which reference those dll files. 如果您的原始项目生成dll文件,则可以构建一个引用这些dll文件的新应用。 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. 如果您的原始项目生成exe文件,则@Zdravko的解决方案,使用Process.Start()启动具有正确参数的那些exe文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Visual Studio 2017中调试几个项目 - debugging several projects in Visual Studio 2017 如何在Visual Studio中的其他项目中使用SQL Server数据库项目? - How to use SQL Server Database Project in other Projects in Visual Studio? 如何在 Visual Studio 代码中的多个项目之间包含共享的 class - how to include a shared class between several project in visual studio code SVN将Visual Studio 2008项目合并到2010项目中 - SVN Merge Visual studio 2008 projects into 2010 projects 在 Visual Studio 2010 中将项目添加到项目 - Adding projects to a project in Visual Studio 2010 Visual Studio 一个带有多个 dll 作为输出的项目? - Visual studio one project with several dlls as output? 将Angular应用分解为多个Visual Studio项目的方法 - A way to break Angular app into several Visual Studio projects 如何在Visual Studio 2015中将两个项目WinRT与Windows.Forms合并 - How to merge two projects WinRT with Windows.Forms in Visual Studio 2015 如何在“ Visual Studio 2013”​​中创建由其他库项目组成的统一c#库项目 - How to create an unifying c# library project in “visual studio 2013” consisting of other library projects 如何使用命名空间在Visual Studio中处理主项目和子项目 - How to work with a main project and sub-projects in visual studio using namespace
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM