In my previous post, I described MSBee - a project to build .NET 1.1 C# and VB projects using MSBuild. Since I've already gotten some emails regarding when it will be released, I decided to add posts describing my progress. Right now, I've written the CSharp targets file for building Everett C# projects. I'm also working on a task to replace Whidbey assembly references - more on that later.

The three key issues that need to be resolved are:

1. Resolving a registry problem in AssemblySearchPaths

2. Being able to replace assembly references before they are resolved by the ResolveAssemblyReferences task

3. Confirm project to project references still work

I'll focus on 1 and 2 since I've spent time on those issues already.

When targeting Everett, we want to include the appropriate Everett references (as opposed to Whidbey references). Some of the paths to Everett references are easily changed by changing values in the targets file. One non trivial change, however, is altering the registry paths that are searched by ResolveAssemblyReferences (RAR). RAR examines registry keys that contain paths to references. The references in these paths help make up the reference list you see when you select "Add Reference" in the Visual Studio IDE. Because MSBuild ships with the .NET framework, these keys are tied to the .NET framework and are under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx. A PropertyGroup in Microsoft.Common.targets sets properties to build the key:

    <PropertyGroup>
        <FrameworkRegistryBase Condition=" '$(FrameworkRegistryBase)' == '' ">Software\Microsoft\.NetFramework</FrameworkRegistryBase>
        <TargetFrameworkVersion Condition=" '$(TargetFrameworkVersion)' == '' ">v2.0</TargetFrameworkVersion>
        <AssemblyFoldersSuffix Condition=" '$(AssemblyFoldersSuffix)' == '' ">AssemblyFoldersEx</AssemblyFoldersSuffix>
    </PropertyGroup>

In Everett, however, the keys are tied to the IDE and thus are stored under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\AssemblyFolders. Now, in the Everett targets file, I expected that I could override the default properties for the registry path with values that point to the Everett path. Unfortunately, there is something in the task that is preventing the changed registry path from being acknowledged. Once I discover the culprit, I'll post an entry.

The second issue has to do with allowing the user to replace assembly references before invoking RAR. The idea is that if you're aware of a Whidbey to Everett reference mapping that you want to maintain, you can replace specific Whidbey references with Everett references via this task. The task is designed to accept a list of references as input and return a new list of references (with any mappings applied) as ouput. My expectation was that I could use the same list as input and output so I would overwrite the old list with the new list. Unfortunately, you can't do that. Instead, MSBuild appends the output of the task to the list. Also, there is no way to change MSBuild's behavior to overwrite the list instead. I'm working with the MSBuild team to decide what to do about this.