Skip to content
Denis Kuzmin (github/3F) edited this page Jun 10, 2025 · 3 revisions

Pre-processing

Some manipulation for modules together with .NET DllExport tool is not a rare question as we can see. [?]

Predefined features

Conari support

Easiest access to unmanaged things through integration with Conari in "one click".

There are no more any possible problems with loading the assembly and resolving its types: https://github.com/3F/Conari/issues/11#issuecomment-625436847

ILMerge & ILRepack support

Manual configuring (msbuild)

Example: https://github.com/3F/DllExport/issues/40#issuecomment-593147220

  <!-- For .NET DllExport 1.7 and newer -->

  <Target Name="Merging" BeforeTargets="DllExportMod">
    <Copy SourceFiles="$(DllExportMetaLibFullPath)" 
          DestinationFolder="$(TargetDir)" 
          SkipUnchangedFiles="true" 
          OverwriteReadOnlyFiles="true" />

    <Exec Command="$(ILMergeConsolePath) Conari.dll $(TargetFileName) /out:$(TargetFileName) /ndebug"
          WorkingDirectory="$(TargetDir)"
          ContinueOnError="true" />
    
    <Delete Files="$(TargetDir)$(DllExportMetaLibName)" ContinueOnError="true" />  
  </Target>

  <ItemGroup>
    <PackageReference Include="Conari" Version="1.5.0" />
    <PackageReference Include="ilmerge" Version="3.0.29" />
  </ItemGroup>

Alternative to AssemblyResolve

AssemblyResolve is one of the possible solutions to problems when you get an FileNotFoundException and related, for example:

Pre-processing with ILMerge or ILRepack is another way to achieve the same result without additional programming at all.

Same for Conari

πŸ—Ž

πŸ—”

πŸ“‚

Clone this wiki locally