你知道,我在任何地方都没有看到一个好的答案.是否可以将预先存在的DLL嵌入到已编译的C#可执行文件中(这样您只能分发一个文件)?如果有可能的话,怎么去做呢?
通常情况下,我很酷,只是将DLL放在外面并让安装程序处理所有内容,但是有几个人在工作,他们问我这个,老实说我不知道.
可能重复:
在c#.exe中嵌入.net dll
我一直在尝试将.dll(特别是Ionic.Zip.dll)嵌入到我的应用程序中,然后使用CodeDom编译新的.exe并需要Ionic.Zip.dll.我希望能够在没有任何额外的.dll的情况下分发我的程序.如果工作目录中有DLL,则程序和编译的程序运行正常.我没有使用ILMerge,因为编译的程序需要.dll而我不能强迫用户获取ILMerge.但是,如果没有.dll,我会收到此错误.
原始程序不会使用此错误编译代码
error CS0006: Metadeta file 'Ionic.Zip.dll" could not be found.
Run Code Online (Sandbox Code Playgroud)
编译程序(在原始程序的工作目录中具有dll时编译)
Description:
Stopped working
Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01: scrub.exe
Problem Signature 02: 0.0.0.0
Problem Signature 03: 50b0f364
Problem Signature 04: Scrub
Problem Signature 05: 0.0.0.0
Problem Signature 06: 50b0f364
Problem Signature 07: 1
Problem Signature 08: 38
Problem Signature 09: System.IO.FileNotFoundException
OS Version: 6.1.7601.2.1.0.256.48
Locale ID: 1033
Run Code Online (Sandbox Code Playgroud)
调试错误
Could not load file or assembly 'Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c' or one of …Run Code Online (Sandbox Code Playgroud) 我有一个在Visual Studio 2010中构建的控制台应用程序.
当我实际构建项目时,我得到\ bin\Debug\MyProj.exe下的.exe文件.
当我粘贴并从其他位置运行此.exe时,它也期待其他文件.
有什么想法我怎么能把它作为独立的exe文件.
我在构造函数中有这个代码:
InitializeComponent();
textBox3_text_valid = 0;
label8.Visible = false;
label8.Visible = false;
Logger.exist();
Run Code Online (Sandbox Code Playgroud)
我在我的项目中添加了一个引用dll OpenHardwareMonitor.dll问题是dll在我的调试目录中.但是当我重建解决方案并全部保存时
然后将项目exe文件发送给我的兄弟或在我删除调试目录后在我的电脑上运行该程序我得到的错误是OpenHardwareMonitor.dll缺失.
在openhardwaremonitor.dll上引用的项目属性中,我看到:
别名:全球
复制本地:真
Ember Interop:错
我怎样才能将dll添加到项目中的exe文件或其他东西所以我不需要将它发送给我的兄弟dll?如果我必须发送我的兄弟dll文件他应该把它放在哪里?他没有Debug目录.