How does MSBuild CoreCompile target identify referenced assemblies

Can anyone shed some light on how the CoreCompile task in TFS2010 (RC). Do Microsoft.TeamFoundation.Build targets generate assembly references that are passed to csc.exe?

We see references to versions 2.0 and 4.0 of System.Xml.dll (in bold below), however we are using the "Specific Version: True" flag in the project's assembly link, and there are no references to 4.0 in the btproj file:

C:\Windows\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /platform:x86 /errorreport:prompt /warn:4 /define:TRACE 
/reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Configuration.dll 
/reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll 
**/reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll** 
/reference:C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.dll 
**/reference:C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Xml.dll** 
/reference:C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Data.dll 
/reference:C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Web.Services.dll 

      

Update . I checked the output of the ResolveAssemblyReferences target (from Microsoft.Common.targets) and see that only assemblies referenced in the project (for example, 2.0 Framework assembly) are included in the '_ResolveAssemblyReferenceResolvedFiles' item list:

ResolveAssemblyReferenceResolvedFiles:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Configuration.dll;
C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll;
C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll

      

However, the CoreCompile target still includes 4.0 assemblies as described above.

Update 2 . Ok, I traced this back to an obscure error in the AddBizTalkHiddenReferences object in the BizTalk build scripts. This particular target tries to add additional assemblies, including those duplicated above.

However, it uses GetCORSystemDirectory from 'mscoree.dll' which returns the CLR installation directory loaded into the process, in this case the 4.0 framework loaded into MSBuild; as a result, the helper does not think it has the System.Xml assembly and adds it, hence a duplicate.

+2


a source to share


1 answer


Referenced assemblies are resolved using ResolveAssemblyReferences

target in the file Windows\Microsoft.NET\Framework\$(Version)\Microsoft.Common.targets

based on the elements Reference

defined in your project file.



+3


a source







All Articles