Ontem durante o Ask The Experts no TechEd Brasil 2009, alguém perguntou se era possível combinar diversos assemblies em um só para não ter que distribuí-los separadamente.

Um exemplo disto seria pegar um executável como MeuExecutavel.exe e alguns assemblies dependentes como MinhaDllA.dll e MinhaDllB.dll  e juntá-os todos em um único assembly como MeuAssemblao.exe.

A resposta é: Sim é possível e para tanto você pode usar o ILMerge

Fantastic Four

To celebrate the announcement of .NET Framework 4.0, here are four links to stuff I found interesting enough to share with you guys:

  1. .NET 4.0’s game-changing feature? Maybe contracts…
  2. What’s New in the BCL in .NET 4.0
  3. Code Contracts – Make Coding Assumptions Explicit and Tool Discoverable in .NET
  4. Microsoft Solver Foundation – Customer Technology Preview

The main point being that it looks like we’re going to gain Design by Contract (pre-conditions, pos-conditions, etc.) features in the next version of the framework.

Although there are people not very happy about it being a feature of the framework library instead of the language, I’d like to remember that it is totally possible that in the future, the language incorporates syntax sugar that beneath uses the library’s features.

LINQ, “using”, “lock” all use .NET Framework class library methods under the covers, so there’s still hope! If today we have “int?” as a shorthand for Nullable<int>, how cool would it be to have something like “Customer!” for a non-nullable Customer parameter, field or variable!

Most of this design by contract stuff is based on ideas from Spec# – a research language developed by Microsoft Research.

Poster do .NET Framework 4.0

Durante o PDC que rolou lá nos “States” esta semana, a Microsoft liberou a primeira versão preliminar pública do .NET Framework 4.0, Visual Studio 2010 e os planos sobre um monte de outras coisas como o Windows Azure, Windows 7 e por aí vai.

Eu já estou com a minha VM do VSTS 2010 aqui, mas ainda não tive tempo de mexer muito com ele.

A primeira coisa que percebi foi que a Start Page parece ser feita com WPF. Estou bastante curioso para ver o que vem no C# 4.0.

Eles também lançaram um poster sobre as novidades que vieram com a SP1 do Fx 3.5 e o que deve vir no 4.0.

Você encontra uma versão online usando Deep Zoom aqui.

Tem um monte de vídeos a respeito disto tudo lá no Channel 9 .

Bem legal!

Dependency Hell – Or Compilation-time DLL Hell

For the last couple of months I’ve been working on a project on which the entire Visual Studio solution has 65 projects.

Luckily I’ve been able to work with a smaller solution with only a subset of the projects: The ones that I was working directly with and the ones that I needed for a reason or another.

Unfortunately a couple of weeks ago, the time to start integrating my projects to the main solution arrived and since then I and other team members have been having troubles setting up references between projects.

I ended up detecting that the problems where caused by the references being set by file when for the sake of easy compilation they should been referenced by project.

I then reviewed all the projects setting their reference types to project references and the number of issues fell dramatically.

But occasionally a team member was getting compilation errors during to version number conflicts.

Imagine that project A depends on projects B and C and that B and C depend on different versions of D.

When you try to build the entire solution, although references where set to projects instead of files, Visual Studio 2003 couldn’t compile project A stating that there where conflicting versions of D in the bin folder.

Well, to get the story short, after trying to get rid of the error I searched around and ended up finding an article the explained how to resolve the issue: Error: the dependency ‘file’ in project ‘project’ cannot be copied to the run directory because it would conflict with dependency ‘file’