[Mono-list] xbuild uses 2.0.5.0 version of System.dll when no explicit version specified
William S.
loumzie+mono-list at gmail.com
Sat Nov 22 14:18:09 EST 2008
I'm using mono 2.0.1 under OSX, installed from Novell's installer. It
seems that xbuild wants to use the "newest" version of assemblies
referenced in a .csproj file. In this case it picks up version 2.0.5.0
of the System.dll (used for silverlight?) which seems to have fewer
members than the version 2.0.0.0. Here are the files I used to test
and the output:
-- Foo.cs
using System.CodeDom.Compiler;
class Foo {
GeneratedCodeAttribute a;
}
-- Foo.csproj
<Project DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<OutputType>Library</OutputType>
<AssemblyName>Foo</AssemblyName>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Foo.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>
-- xbuild output
XBuild Engine Version 0.1
Mono, Version 2.0.1.0
Copyright (C) Marek Sieradzki 2005. All rights reserved.
Build started 11/21/2008 6:59:42 PM.
__________________________________________________
Project "/private/tmp/Foo.csproj" (Build target(s)):
Target PrepareForBuild:
Configuration: Platform:
Target ResolveAssemblyReferences:
Target CoreCompile:
Tool
/Library/Frameworks/Mono.framework/Versions/2.0.1/bin/gmcs execution
started with arguments: /noconfig /out:Foo.dll Foo.cs /target:library
/unsafe- /reference:/Library/Frameworks/Mono.framework/Versions/2.0.1/lib/mono/gac/System/2.0.5.0__7cec85d7bea7798e/System.dll
/warn:2
Foo.cs(1,14): error CS0234: The type or namespace name `CodeDom'
does not exist in the namespace `System'. Are you missing an assembly
reference?
Foo.cs(1,14): error CS0234: The type or namespace name `CodeDom'
does not exist in the namespace `System'. Are you missing an assembly
reference?
Build succeeded.
0 Warning(s)
3 Error(s)
Time Elapsed 00:00:00.3583950
I can force xbuild to use the proper version by explicitly asking for
version 2.0.0.0 in the .csproj file, but does anyone know of a better
way?
More information about the Mono-list
mailing list