Albacore and .NET 4.0

I love albacore and that’s a fact! I use it to build all my .Net projects (some I even deploy with it). But after the introduction of the .NET 4.0 framework there has been a problem. The msbuild task has a hard-coded path to the msbuild.exe and that points to the 3.5 framework.

This is not a big problem but still does not look good in the rake script. Sadly at this point in time there is still not a “nice” fix for this problem but there is a “good” workaround.

msbuild :msbuild do |msb|
 msb.path_to_command =  File.join(ENV['windir'], 'Microsoft.NET',
 'Framework',  'v4.0.30319', 'MSBuild.exe')
 #... other settings here

Hope this helps you stay on albacore until this little thing gets fixed 🙂


3 thoughts on “Albacore and .NET 4.0

  1. Hi Dejan

    This being fixed in the next release, and there should be a preview release out in a day or two, to get feedback before things are finalized. It will default to .net 4 and will be easy to change using several different options. For example:

    Albacore.configure do |config|
    config.msbuild.use :net35

    This will configure all msbuild tasks to use .net 3.5

    Or you can configure a specific msbuild task instance like this:

    msbuild :build do |msb|
    msb.use :net35

    Of course setting the command manually will also work, but the syntax has changed to .command instead of .path_to_command to make things a little easier.

    I hope those options will make albacore even easier to use. If you have any other suggestions feel free to let me know! 🙂


  2. Pingback: Albacore v0.2.0 Preview 1 Is Available - new ThoughtStream("Derick Bailey"); - Los Techies : Blogs about software and anything tech!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s