Message 1 of 4
Error When Merging With ILMerge/Repack
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I want to combine my Revit add-in's DLLs together to work around version conflicts. I am using ILRepack to accomplish this. I have 3 projects and their dependency structure is A depends on B depends on C. I am also using the Autodesk.Revit.SDK Nuget package.
I have a build target like follows:
<Target Name="ILRepack" AfterTargets="Build">
<Exec
WorkingDirectory="$(OutDir)"
ConsoleToMsBuild="true"
Command="$(PkgILRepack)\tools\ILRepack.exe /out:Merged.dll ^
/target:library ^
B.dll C.dll
/>
</Target>
The build fails on any combination of merge targets EXCEPT C.dll, which makes me think it has something to do with the dependency structure. The projects all reference Autodesk.Revit.SDK, which makes the fact C builds successfully even more mysterious. I've also tried merging several DLLs without project dependencies together and that works as well.
The build fails with this error:
EXEC : error : Failed to load assembly B.dll
Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'RevitAPI, Version=20.0.0.0, Culture=neutral, PublicKeyToken=null'
Does anyone know what's happening here?