如何为特定命名空间的代码生成单独的dll文件
我有一个 asp.net mvc 应用程序,当我编译时,它会创建一个 dll 文件 但是,我有一些代码想在其他项目中重用,
我想我可以创建另一个项目,然后将此特定代码放入其中,它将生成一个单独的 dll 文件。
但是是否有另一种方法可以将当前项目的特定命名空间的代码放入单独的 dll 文件中?
谢谢
I have an asp.net mvc application, when I compile, it creates one dll file
However, I have some code that I would like to re-use in other projects
I guess I could create another project, then put this specific code inside it and it would generate a separated dll file.
But is there another way to process in order to put the code of a specific namespace of my current project inside a separated dll file?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将该代码放入一个单独的项目中——使该项目成为“类库”。这将为该项目创建一个 DLL,您只需将其添加为原始项目和需要共享该代码的任何其他项目的引用。
Put that code in a separate project--make that project a "Class Library". This will create a DLL for that project, and you only need to add it as a reference on the original project and any other project that needs to share that code.