简体   繁体   English

如何使用GUI在Visual Studio项目中而不是直接从Visual Studio添加和编译Windows窗体?

[英]How to add and compile windows forms in Visual Studio project using a GUI, and not directly from Visual Studio?

I am developing a project in Visual Studio 2008 with a team of 5 people. 我正在由5个人组成的团队在Visual Studio 2008中开发一个项目。 Each of the 5 people develop Windows forms and a repository in maintained on the server. 这5个人中的每一个都开发Windows表单,并在服务器上维护一个存储库。 The problem is that I have to individually compile each form manually after opening Visual Studio and adding the forms in the project. 问题是,在打开Visual Studio并将表单添加到项目中之后,我必须分别手动编译每个表单。

I want to add and compile the forms using a GUI and not Visual Studio as such. 我想使用GUI而不是Visual Studio来添加和编译表单。 Is this possible? 这可能吗?

Basically, the solution lies in programmatically adding Forms to Visual Studio Project I am not sure if such an application could be developed. 基本上,解决方案在于以编程方式将Forms添加到Visual Studio Project中,我不确定是否可以开发这样的应用程序。 Any help will be highly appreciated. 任何帮助将不胜感激。

Thanks! 谢谢!

The problem is that I have to individually compile each form manually after opening Visual Studio and adding the forms in the project. 问题是,在打开Visual Studio并将表单添加到项目中之后,我必须分别手动编译每个表单。

You can csc.exe which is a commandline C# compiler. 您可以使用csc.exe,它是命令行C#编译器。 Make a script that pulls the code and compiles it. 创建一个脚本来提取代码并对其进行编译。

I want to add and compile the forms using a GUI and not Visual Studio as such 我想使用GUI而不是像这样的Visual Studio添加和编译表单

I don't understand .Do you want to add and compile forms using a GUI app or add GUI? 我不明白。您要使用GUI应用程序添加和编译表单还是添加GUI?

Basically, the solution lies in programmatically adding Forms to Visual Studio Project I am not sure if such an application could be developed 基本上,解决方案在于以编程方式将窗体添加到Visual Studio Project中,我不确定是否可以开发这样的应用程序

If you had already a project that is set-up (dependencies) is it fairly easy. 如果您已经有一个已设置的项目(相关性),这将非常容易。 You have to add C# code to the source code. 您必须将C#代码添加到源代码中。 It depends on the size of a modification, but it should be done with a couple of lines of script. 它取决于修改的大小,但应使用几行脚本来完成。

You could either develop scripts to execute msBuild tasks from the command line ( command line reference ) and develop a GUI to start a shell to run those, or you can use the csc.exe from a script/command prompt to do the compilation manually . 您可以开发脚本来从命令行( 命令行参考 )执行msBuild任务,或者开发GUI来启动外壳程序以运行这些任务,或者可以从脚本/命令提示符下使用csc.exe 手动进行编译

The MsBuild option will be useful if you have project files you want to build, the csc option is more low level and will require more work but will not require you to have a project file, just the source code files and dependencies. 如果您有要构建的项目文件,则MsBuild选项将很有用,csc选项的级别较低,将需要更多的工作,但不需要您拥有项目文件,而只需源代码文件和依赖项。

This sounds like the wrong way to go though. 这听起来像是走错了路。 Are you sure that you don't want to develop an application that can have plugins? 您确定不想开发可以具有插件的应用程序吗? then you develop each form to an interface and package it up in its own dll, and have the application load the plugin dlls and extract out the forms which implement the particular interface. 然后,您将每种表单开发为接口,并将其打包在其自己的dll中,并让应用程序加载插件dll,并提取出实现特定接口的表单。 That way you build the app once, and can add new forms without having to recompile at all... 这样,您就可以一次构建应用程序,并且无需重新编译就可以添加新表单...

You might want to consider using a plug-in/add-in framework such as MEF or MAF. 您可能要考虑使用诸如MEF或MAF的插件/插件框架。 Team members can then be responsible for their own forms which are popped into a plug-in for you to use. 然后,团队成员可以负责自己的表单,这些表单会弹出到插件中供您使用。

Choosing between MEF and MAF (System.AddIn) 在MEF和MAF之间选择(System.AddIn)

Such a thing allows you to dynamically control how forms/controls are displayed at runtime or depending how you implement the plug-in system, allow you to drag-n-drop your layout at design time. 这样的事情使您可以动态控制表单/控件在运行时的显示方式,或者取决于您如何实现插件系统,还可以在设计时拖放布局。

Much like user controls. 很像用户控件。

暂无
暂无

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

相关问题 如何在 Visual Studio 中将 Windows.Forms 框架添加到 WPF 项目 - How to add Windows.Forms framework to WPF project in Visual Studio 无法将QuickTime控件添加到Visual Studio中的Windows窗体项目 - Unable to add QuickTime control to Windows Forms project in Visual Studio 如何将Visual Studio Windows Forms项目转换为应用程序? - how to turn visual studio windows forms project into an application? 如何在 Visual Studio 2019 中添加对新 Windows Forms 项目的引用 - How do I add a Reference to a new Windows Forms Project in Visual Studio 2019 如何在Visual Studio 2010中添加System.Windows.Forms - how to add System.Windows.Forms in visual studio 2010 如何将自定义Windows窗体控件添加到Visual Studio工具箱 - How to add a Custom Windows Forms Control into Visual Studio Toolbox 在Visual Studio中使用Windows窗体应用程序 - Using a Windows Forms Application out of Visual Studio 如何在 visual studio 中隐藏已发布的 windows forms 项目中的所有额外文件? - How do I hide all the extra files from a published windows forms project in visual studio? 如何向我的 Visual Studio 项目添加对 Windows Media Player 的引用? - How to add reference to Windows Media Player to my Visual Studio project? 在 Visual Studio 中获取 Windows 窗体应用程序项目以从窗体运行,而不必打开 Visual Studio? - Get Windows Forms App project in Visual Studio to run from form, rather than having to open up Visual Studio?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM