Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1020399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:09:40+00:00 2026-05-16T11:09:40+00:00

So something I’ve been doing recently is adding an additional project to my code

  • 0

So something I’ve been doing recently is adding an additional project to my code solutions and doing my post build stuff programmatically in it. This project builds last and then launches itself.

cool stuff I can do there is run an ILMerge automation class I created to perform merges automatically if i just give it a project folder, increment version numbers in my assembly info, copy files where-ever i want, etc etc etc. It seems to me like the possibilities here are endless.

example of one I’m working with now — I’ve got a fairly large framework library that i’m going to be deploying with one of our applications, but we don’t want to include all the dlls separately (there are like 20). Also I don’t need every class in the library for this application, so it makes sense to trim it down. In the library’s post build project, I’m doing this…

outputDirectory = new DirectoryInfo(@"...postbuildmerges\output");
solutionDirectory = new DirectoryInfo(@"...mainSolutionDirectory");

#region Web Lib
List<string> webLibraryNames = new List<string>
{
    "Lib.Configuration",
    "Lib.Web",
    "Lib.Data",
    "Lib.Utilities",
    "Lib.Threading"
};
List<string> AllNeededAssemblies = new List<string>();
webLibraryNames.ForEach((libname) => 
    {
        foreach (string assembly in GetLibraryAssemblies(libname))
            if (AllNeededAssemblies.Exists((assemblyName) => Path.GetFileName(assemblyName) == Path.GetFileName(assembly)) == false)
                AllNeededAssemblies.Add(assembly);
    });

SharpMergeAutomator.Merge(
    @"...path to primary assembly...",
    AllNeededAssemblies.ToArray(),
    "...desired output file...",
    //merges xml documentation
    true);
#endregion

So is this post-build project thing a good approach? is it needlessly complicated? is there a better way? do people normally do stuff like this?

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T11:09:40+00:00Added an answer on May 16, 2026 at 11:09 am

    MSBuild is the scripting language for builds, it gives the ability to easily iterate folder trees committing actions against any filter of files you like etc. You should be doing these things in an MSBuild script I would posit because when a new .net comes out, it will most likely still be the scripting language for builds, and you wont have to change the build scripts to work with the new .net, whereas the more build work you do in code like this, that’s just more code you’ll have to rewrite as files and things have moved. Plus with MSBuild you get logging by default along with tons of built in stuff.

    Also, there are lots of community tasks to easily use for things like ILMerge:
    http://code.google.com/p/ilmerge-tasks/wiki/HowToUse

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Something like this: _declspec(align(16)) float dens[4]; //Here the code comes. F32vec4 S_START, Pos, _Vector
Something like this: I am not sure how to code for this as I
Something upgraded my Microsoft.Data.Entity.Design to version 10.6.10617.1. This broke some EntityFramework code generators which
Something terrible as happened with my poor attempt at adding a CountIf forumula to
Something I've wanted to learn for quite a time now, but haven't been able
Something went wrong with my code. The insert code does not work. Can someone
something similar to futon for couchdb? also where is the source code fo futon?
Something I stumbled upon and made me wonder. Why does this work? void foo
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Something I've been wondering for a while. I know that in order to free

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.