Построить с ошибкой ILMerge - PullRequest
4 голосов
/ 24 июня 2010

Кто-нибудь имел эту ошибку с IlMerge?Я пытаюсь объединить несколько сборок для проекта .NET с использованием 4.0 Framework.

ILMerge / log /lib:..\Libraries / targetplatform: v4 /internalize:..\SolutionFiles\CJCommon.exclude /ndebug /out:bin\Release\Common.dll obj \ Release \ Common.dll C: \ Development \ CJCommon \ Libraries \ FluentNHibernate.dll C: \ Development \ CJCommon \ Библиотеки \ HibernatingRhinos.Profiler.Appender.dll C: \ Development\ CJCommon \ Libraries \ Iesi.Collections.dll C: \ Development \ CJCommon \ Libraries \ log4net.dll C: \ Development \ CJCommon \ Libraries \ Microsoft.Practices.ServiceLocation.dll C: \ Development \ CJCommon \ Libraries \ NHibernate.ByteCode.Castle.dll C: \ Development \ CJCommon \ Libraries \ NHibernate.dll C: \ Development \ CJCommon \ Libraries \ NHibernate.Linq.dll C: \ Development \ CJCommon \ Libraries \ StructureMap.dll

Установить платформув 'v4', используя каталог 'C: \ Windows \ Microsoft.NET \ Framework64 \ v2.0.50727 .. \ v4.0.20107' для mscorlib.dll

Исключительная ситуация при объединении:

Ссылка на объект не установлена ​​на входвремя объекта.

 at System.Compiler.CoreSystemTypes.GetSystemAssembly(Boolean doNotLockFile, Boolean getDebugInfo)
 at System.Compiler.CoreSystemTypes.Initialize(Boolean doNotLockFile, Boolean getDebugInfo)
 at System.Compiler.SystemTypes.Initialize(Boolean doNotLockFile, Boolean getDebugInfo)
 at ILMerging.ILMerge.Merge()
 at ILMerging.ILMerge.Main(String[] args)

C: \ Program Files (x86) \ MSBuild \ Ilmerge.CSharp.targets (8,5): ошибка MSB3073: команда "" C: \ Program Files (x86)) \ Microsoft \ Ilmerge \ Ilmerge.exe "/ log /lib:"..\Libraries" / targetplatform: v4 /internalize:./.exited с кодом 1 ...

...

========== Перестроить все: 3 успешно выполнено, 1 не выполнено, 0 пропущено ==========

1 Ответ

11 голосов
/ 08 июля 2010

Включите путь к 4.0 Framework в вашей целевой платформе и обязательно используйте кавычки.Например, из PowerShell:

.\ILMerge /out:Merged.dll /targetplatform:'v4,C:\Windows\Microsoft.NET\Framework\v4.0.30319' .\Assembly1.dll .\Assembly2.dll
...