(转)C#将多个DLL集成到EXE文件中的方法

C#将多个DLL集成到EXE文件中的方法
问题:
使用C#编写程序有时需要引用多个DLL,发布程序的也必须附带上引用的DLL,附带的DLL过多会导致部署不便。

解决方法:
1、安装并使用Costura.Fody

打开 “VS主菜单->工具->NuGet程序包管理器->程序包管理器控制台”

执行命令:

Install-Package Costura.Fody -Version 1.6.2
注:现在(2019.8.31)Costura.Fody最新版本的已经到了4.1,具体请查看:https://www.nuget.org/packages/Costura.Fody
————————————————
版权声明:本文为CSDN博主「野猪乱撞」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/Daming113132/article/details/100172622

添加后提示错误如:

错误提示如下:
Fody: No configuration entry found for the installed weaver Costura. This weaver will be skipped. You may want to add this weaver to your FodyWeavers.xml
添加并修改FodyWeavers.xml:

<?xml version="1.0" encoding="utf-8"?>
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
  <Costura />
</Weavers>

 转载自本站博主:  多见多闻

 

posted @ 2020-03-11 14:27  clarklxr  阅读(310)  评论(0)    收藏  举报