如何从exe,命令提示符或任何其他方式将类文件添加到现有项目? [英] How do I add a class file to an existing project from an exe, command prompt or any other way?

查看:63
本文介绍了如何从exe,命令提示符或任何其他方式将类文件添加到现有项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个Windows应用程序项目,它可以将.cs文件(它将由我的项目生成)添加到另一个项目(在不同的解决方案中可用)。



可以通过C#实现,如果没有其他方法吗?

解决方案

如果你有办法将它编译成dll,你可以始终使用System.Reflection在运行时加载dll(参见这个 StackOverflow问题)。如果没有,你可以随时尝试lua,有一篇很好的文章关于 DreamInCode

I want to create a windows application project which can add .cs file(it will be generated by my project) to an another project(available in a different solution).

Can it be achieved by C#, if no is there any other way?

解决方案

If you have a way to compile it into a dll, you can always use System.Reflection to load a dll at runtime(see this StackOverflow question). If not you can always try lua, there's a good article about that over on DreamInCode.


这篇关于如何从exe,命令提示符或任何其他方式将类文件添加到现有项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆