2010-06-24 3 views
4

У кого-нибудь была эта ошибка с IlMerge? Я пытаюсь объединить несколько сборок для .NET-проекта, используя 4.0 Framework.Построение с ошибкой ILMerge

ILMerge/log /lib:..\ Библиотеки/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 \ Libraries \ 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 \ v 2.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 "/ журнал /lib:"..\Libraries"/targetplatform: v4 /internalize:./.exited с кодом 1 ...

...

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

+0

Возможный дубликат [Номер ошибки ошибки ILMerge 1] (http://stackoverflow.com/questions/10130379/ilmerge-issue-error-code-1) – Veverke

ответ

11

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

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