[英]Reference other project in solution without separate dll
At the moment I have added and referenced another project to my main solution. 目前,我已经在主要解决方案中添加并引用了另一个项目。 It works, but then I need the separate dll that is compiled.
它可以工作,但随后我需要编译的单独的dll。
How can I reference another project without the need for a separate dll that I have to distribute with my final exe? 我如何可以引用另一个项目,而无需使用必须随最终exe分发的单独的dll?
AC# class project in a Visual Studio solution always compiles to an assembly, so adding a project reference will inevitably mean that your executable references the assembly built as a result of compiling the other project. Visual Studio解决方案中的AC#类项目始终会编译为程序集,因此添加项目引用将不可避免地意味着您的可执行文件将引用由于编译另一个项目而生成的程序集。 If you don't want to distribute the separate assembly with your executable the only thing you can do is to ILMERGE the assembly into your executable as a part of your deployment build process,
如果您不希望将单独的程序集与可执行文件一起分发,那么您唯一可以做的就是在部署构建过程中将程序集整合到可执行文件中,
You can't. 你不能。 The way .net works is to load an additional assembly and using its meta data the classes inside that.
.net的工作方式是加载附加程序集,并使用其元数据将其中的类加载到其中。 If you are attempting to have a set of classes that you refer to by source similar to the way c++ uses header files you will have to import those files into your project.
如果您尝试使用类似于c ++使用头文件的方式引用的一组类,则必须将这些文件导入到项目中。
This sounds like you're trying to statically compile a library. 听起来您正在尝试静态编译库。 This is not (easily) offered by .NET without manually creating and merging assemblies.
如果没有手动创建和合并程序集,.NET不会(轻松)提供此功能。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.