Friday, November 25, 2011

MSBuild error related to missing Tracker.exe, AL.exe, LC.exe and so on

Today I got some frustrating error, when I've been setting up a new project on TeamCity and tried to run it:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1835, 9): error MSB3454: Tracker.exe is required to correctly incrementally generate resources in some circumstances, such as when building on a 64-bit OS using 32-bit MSBuild. This build requires Tracker.exe, but it could not be found. The task is looking for Tracker.exe beneath the InstallationFolder value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A. To solve the problem, either: 1) Install the Microsoft Windows SDK v7.0A or later. 2) Install Microsoft Visual Studio 2010. 3) Manually set the above registry key to the correct location. Alternatively, you can turn off incremental resource generation by setting the "TrackFileAccess" property to "false".

It was a bit strange to see a reference to the Windows SDK v7.0A, because I was pretty sure that there is just v7.1 installed. Thanks to the stackoverwflow for the solution that I found very quickly. The first (and the only in my case) thing you need to do is to tell MSBuild to use the latest version of the Windows SDK installed:
  1. Go to "Microsoft Windows SDK v7.1" from the Start menu
  2. Select "Windows SDK 7.1 Command Prompt" and enter
  3. > cd Setup
  4. > WindowsSdkVer -version:v7.1
After this I was able to build project on the server without any problems.

Tuesday, August 16, 2011

How to register COM-class within the application manifest file

You don't always need to register referenced COM-classes in the windows registry. Sometimes it's much more simple and reliable to use application manifest for referencing COM-classes. This feature is called Registration-free COM and well described in this article.
In few words, you can add application manifest file to you .NET application project (Add New Item -> Application Manifest File). Then you can reference COM this way:
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <file name="MyPrivateCOM.dll">
    <comClass clsid="{AC78B8E2-6C4D-11d1-ADE2-0000F8754B99}" threadingModel="Apartment" />
 </file>
</asmv1:assembly>


* This source code was highlighted with Source Code Highlighter.
I provided a simplified version of the manifest file with a COM-reference only. Though, it's correct and working sample. Of course, application manifests allows to do much more than just referencing COM-classes, but it's an another big and interesting topic.

Saturday, March 5, 2011

How to install SQL Server Management Studio Express 2008

In the SQL Server 2005 installing of SSMSE (SQL Server Management Studio Express) was very easy, just all about launching the installation file. In the SQL Server 2008 process of installing SSMSE is a bit different, since installation is represented as a part of the SQL Server Installation Center Utility.
In order to install SSMSE 2008 you need to perform the following steps:
  1. Download the installation package and launch it.
  2. Click "New SQL Server stand-alone installation or add features to an existing installation".
  3. Wait untill installation setup support files and configuration checks, then click OK and Install.
  4. Click "Perform a new installation of SQL Server 2008", but not "Add features to an existing instance of SQL Server 2008" (!!!).
  5. Click Next in the Product Key dialog even if all the options are disabled.
  6. In the feature selection dialog enable Management Tools feature and click Next.
  7. Wait untill installation performs an additionnal configuration checks. Then click Install. Note: You might receive a configuration error, if you have SQL Server 2005 Express tools already installed on the machine. In my case I removed SQL Server 2005 Express tools. But it was not enough. I also used solution provided here (removing registry key). It was helpfull.
  8. Wait untill installation completed. Enjoy!