合并mongodb生成的DLL

================================start 合并dll ==============================

<Target Name="ILMerge">

    <Exec Command="&quot;$(ILMergeConsolePath)&quot; /ndebug /target:dll /out:$(OutputPath)MongoDBAdapter.dll /log $(OutputPath)MongoDB.Bson.dll /log $(OutputPath)MongoDB.Driver.dll /log $(OutputPath)MongoDB.Driver.Core.dll /log $(OutputPath)MongoDB.Libmongocrypt.dll /log $(OutputPath)MongoDBClass.dll /targetplatform:v4" />

  </Target>

  <Target Name="_ProjectRemoveDependencyFiles" AfterTargets="AfterBuild" DependsOnTargets="ILMerge">

    <ItemGroup>

      <_ProjectDependencyFile Include="$(OutputPath)MongoDB.Bson.dll" />

      <_ProjectDependencyFile Include="$(OutputPath)MongoDB.Driver.dll" />

      <_ProjectDependencyFile Include="$(OutputPath)MongoDB.Driver.Core.dll" />

      <_ProjectDependencyFile Include="$(OutputPath)MongoDB.Libmongocrypt.dll" />

    </ItemGroup>

    <Delete Files="@(_ProjectDependencyFile)" />

  </Target>

<Target Name="_ProjectRemoveDependencyFiles" AfterTargets="AfterBuild" DependsOnTargets="ILMerge">

    <ItemGroup>

      <_ProjectDependencyFile Include="$(OutputPath)Crc32C.NET.dll" />

      <_ProjectDependencyFile Include="$(OutputPath)DnsClient.dll" />

      <_ProjectDependencyFile Include="$(OutputPath)MongoDB.Bson.dll" />

      <_ProjectDependencyFile Include="$(OutputPath)MongoDB.Driver.dll" />

      <_ProjectDependencyFile Include="$(OutputPath)MongoDB.Driver.Core.dll" />

      <_ProjectDependencyFile Include="$(OutputPath)MongoDB.Libmongocrypt.dll" />

      <_ProjectDependencyFile Include="$(OutputPath)SharpCompress.dll" />

      <_ProjectDependencyFile Include="$(OutputPath)Snappy.NET.dll" />

      <_ProjectDependencyFile Include="$(OutputPath)System.Buffers.dll" />

      <_ProjectDependencyFile Include="$(OutputPath)System.Runtime.InteropServices.RuntimeInformation.dll" />

      <_ProjectDependencyFile Include="$(OutputPath)MongoDBClass.dll" />

    </ItemGroup>

    <Delete Files="@(_ProjectDependencyFile)" />

  </Target>

<Exec Command="&quot;$(ILMergeConsolePath)&quot; /ndebug /target:dll /out:$(OutputPath)$(AssemblyName).dll /log $(OutputPath)Crc32C.NET.dll /log $(OutputPath)DnsClient.dll /log $(OutputPath)MongoDB.Bson.dll /log $(OutputPath)MongoDB.Driver.dll /log $(OutputPath)MongoDB.Driver.Core.dll /log $(OutputPath)MongoDB.Libmongocrypt.dll /log $(OutputPath)SharpCompress.dll /log $(OutputPath)Snappy.NET.dll /log $(OutputPath)System.Buffers.dll /log $(OutputPath)System.Runtime.InteropServices.RuntimeInformation.dll /log $(OutputPath)MongoDBClass.dll /targetplatform:v4" />

ilmerge /ndebug /target:dll /out:MongoDBClass.dll /log Crc32C.NET.dll /log DnsClient.dll /log MongoDB.Bson.dll /log MongoDB.Driver.dll /log MongoDB.Driver.Core.dll /log MongoDB.Libmongocrypt.dll /log Newtonsoft.Json.dll /log SharpCompress.dll /log Snappy.NET.dll /log System.Buffers.dll /log System.Runtime.InteropServices.RuntimeInformation.dll /targetplatform:v4

================================end==============================

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容