Welcome

You have reached the blog of Keith Elder. Thank you for visiting! Feel free to click the twitter icon to the right and follow me on twitter.

Speaking at and Announcing the Mississippi Coast .NET User Group November 23rd

Posted by Keith Elder | Posted in .Net, Speaking | Posted on 10-11-2010

0

It is with great joy that I get to announce a new user group in Mississippi starting up.  The group is meeting in Biloxi, MS and is called the Mississippi Coast .NET Users Group.

I will be speaking at the first meeting of the group on November 23rd, 2010. 

The topic will be “Structure and Guidance for Organizing Applications within Visual Studio”.  Here is an abstract:

Visual Studio is an outstanding tool when it comes to building applications on the .Net Framework. It can be confusing for users when trying to initialize a new software deliverable though. For example, how do you name your projects? Where do you put third party assemblies so they can be re-used? How do you set things up for an n-tier architecture? And the list goes on. I’ve given various talks throughout the US and it never fails that I end up in a conversation with multiple people on what are the best ways to organize projects within Visual Studio. This session should answer these questions and provide some proven guidance that works. In this session we’ll cover some best practices on how to organize your projects and solutions. We’ll also look at some tricks and guidance on how to map your folder structure to your namespaces. During the session we are going to build a new application from scratch and cover how to initially incorporate an n-tier design when initializing your project. Even if you are an experienced .Net developer this is one session you will not want to miss!

Hope to see you there!

ILMerge – How to Merge Assemblies After A Build

Posted by Keith Elder | Posted in .Net | Posted on 02-11-2010

4

The other day I mentioned I was working on an API to communicate with Sonic, an enterprise messaging system.  After getting the API to the point where I wanted to send it to some other developers I wanted to package everything up as on DLL.  ILMerge to the rescue!

Sonic provides their own DLLs that were ported from Java for .NET developers.  There are 7 DLLs you have to reference in order to communicate with Sonic.  Here’s how this can be done using ILMerge by simply modifying the project file using an after build target.

The following below does a few things.

  1. It takes all of the assemblies that are outputted to the build directory and passes that to the ILMerge command.
  2. Once they are merged the files are deleted.
   1: <Target Name="AfterBuild">

   2:     <CreateItem Include="@(ReferenceCopyLocalPaths)" Condition="'%(Extension)'=='.dll'">

   3:       <Output TaskParameter="Include" ItemName="IlmergeAssemblies" />

   4:     </CreateItem>

   5:     <Exec Command="&amp;quot;$(MSBuildProjectPath)..\..\ThirdPartyAssemblies\Ilmerge\Ilmerge.exe&amp;quot; /allowDup /log /keyfile:$(AssemblyOriginatorKeyFile) /out:@(MainAssembly) &amp;quot;@(IntermediateAssembly)&amp;quot; @(IlmergeAssemblies->'&quot;%(FullPath)&quot;', ' ')" />

   6:     <Delete Files="@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')" />

   7:   </Target>

Very easy as you can see although the syntax is a little finicky.  What does this mean? It means that developers can just add the one DLL to their project and everything works. 

Hopefully this will help someone as well.