Skip to main content

Posts

Specifying Reference Paths in TFS 2010 build definition

While creating build definition using TFS 2008, we could specify the path(s) where the build server could look for the references. This was of great help as it avoided installing dependent assemblies in the GAC in the build server. It was easily done by editing the project file and adding <AdditionalReferencePath> element. In Team Foundation Server 2010 , the build definition are workflow based and if you are creating any build definition using default template, there is no option to specify the additional reference paths. Since, new template also supports the msbuild arguments, we have to specify the reference path as a build argument. For this we have to add "ReferencePath" as property to the msbuild arguments. Go to Team Explorer >> Build Defintion >> Edit Build Definition >> Process >> Advanced Section >> MSBuild Arguments and Add the following: /p:ReferencePath=”{File path}” We can specify multiple reference paths separat...

The type 'System.Xml.IXmlLineInfo' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Xml, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'

I have been getting this weird exception out of nowhere while compiling my solution. Turns out I had two projects in my solution using different System.Xml assembly. One using straight from .NET Framework 2.0 and other using assembly 2.0.5.0. ( from Silverlight runtime). Referenced path were C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll & C:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.Xml.dll respectively. If a project file does not specify the exact reference assembly, compiler tries to use any matching assembly present in its cache. I could see the following reference in my csproj file. <Reference Include="System.Xml"/> I updated this reference with the correct version (along with the PublicKeyToken and Culture info) and made the SpecificVersion=True, enforcing compiler to use the specified assembly <Reference Include="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934...