分享2个项目的code没有一个dll [英] Sharing code between 2 projects without a dll
问题描述
我如何能有两个项目之间code-共享而不做一个dll?
How can I have code-sharing between two projects without making a dll?
的问题是:我有一个同步的用户和放大器的工具;从LDAP组到数据库。
The issue is: I have a tool that syncs users & groups from LDAP to a database.
现在的工具是一个窗口服务,但测试它本身是非常困难和费时的。
Now the tool is a windows service, but testing it as such is very difficult and time consuming.
这就是为什么我做了一个控制台应用程序,我可以测试LDAP同步,然后就各自的源$ C $ C-文件复制过来的服务项目。
Which is why I made a console application where I can test the LDAP syncing, and then just copy the respective sourcecode-files over to the service project.
但是......保持同步的共同文件是有点问题的。 我不想做一个DLL,因为这可能造成了我一个问题 第三个项目,一个Windows安装程序(的服务),我必须使用ExecutingAssembly路径...
But... keeping the common files in sync is a bit of a problem. I don't want to make a dll, because this probably creates me a problem with the 3rd project, a windows installer (for the service) where I have to use ExecutingAssembly path...
有没有办法不作单独的DLL共享code? AUTOMAGIC静链接,可以这么说?
Is there a way to share the code without making a separate dll? Automagic statical linking, so to say ?
推荐答案
How about adding a file as a link.
在Visual Studio中右键单击您的控制台测试应用程序的项目 - >选择添加现有文件 - >在文件中添加对话框中定位到文件中的实际Windows服务项目 - >选择要共享的文件 - >及附加按钮,选择添加为链接选项。
In Visual Studio right click on your console test app project -> select add existing file -> in the file add dialog navigate to files in your actual windows service project -> select the files you want to share -> and on add button select add as link option.
这篇关于分享2个项目的code没有一个dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!