Hello,
I am trying to merge all assemblies in a ASP.NET MVC 3 project and I am using the following:
<Import Project="$(MSBuildExtensionsPath)\ExtensionPack\4.0\MSBuild.ExtensionPack.tasks" /> <Target Name="AfterBuild"> <ItemGroup> <Input Include="$(ProjectDir)\Bin\AttributeRouting.dll" /> <Input Include="$(ProjectDir)\Bin\AjaxMin.dll" /> </ItemGroup> <MSBuild.ExtensionPack.Framework.ILMerge InputAssemblies="@(Input)" TargetPlatformVersion="v4" OutputFile="C:\Users\Miguel\Desktop\Merged.dll" LogFile="C:\Users\Miguel\Desktop\ILMergeLog.log" LogMessages="true" /> </Target>
I don't get anything in the log but I get the following error on Visual Studio:
Error 1 The "MSBuild.ExtensionPack.Framework.ILMerge" task failed unexpectedly.
System.NullReferenceException: Object reference not set to an instance of an object.
at MSBuild.ExtensionPack.Framework.ILMerge.GenerateCommandLineCommands() in D:\Projects\MSBuildExtensionPack\Releases\4.0.4.0\Main\Framework\Framework\ILMerge.cs:line 328
at Microsoft.Build.Utilities.ToolTask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult)
Any idea what is wrong? Is it a problem with my code?
Two site questions:
1 - Instead of enumerating all DLL's can I say to merge all DLL references in this project?
2 - Is it possible to create a T4 template that when I add it to the project the MERGE code lines are added automatically to project file?
Thank You,
Miguel