[Mono-dev] Mono 2.10.2 TargetFrameworkAttribute

John Fallows john.fallows at kaazing.com
Sat Jul 9 12:05:46 EDT 2011


Devs,

Is System.Runtime.Versioning.TargetFrameworkAttribute supported on Mono
2.10.2 ?

It appears to be available according to the documentation at
http://docs.go-mono.com/System.Runtime.Versioning.TargetFrameworkAttribute .

However, we are getting an unexpected compilation error for the simplest
example using TargetFrameworkAttribute, as shown below.

We are using Mono 2.10.2 installed alongside the default Mono 2.6.7 package
on Ubuntu 10.10.

~/mono-test$ uname -a
Linux jfallows-laptop 2.6.35-30-generic #54-Ubuntu SMP Tue Jun 7 18:41:54
UTC 2011 x86_64 GNU/Linux

~/mono-test$ which gmcs
/usr/bin/gmcs

~/mono-test$ gmcs --version
Mono C# compiler version 2.6.7.0

~/mono-test$ /opt/mono-2.10/bin/gmcs --version
Mono C# compiler version 2.10.2.0

~/mono-test$ cat src/AssemblyAttributes.cs
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly:
global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETPortable,Version=v4.0,Profile=Profile2",FrameworkDisplayName="Portable
Library")]

~/mono-test$ /opt/mono-2.10/bin/gmcs /target:library /out:bin/mono-test.dll
src/AssemblyAttributes.cs
src/AssemblyAttributes.cs(3,46): error CS0234: The type or namespace name
`TargetFrameworkAttribute' does not exist in the namespace
`System.Runtime.Versioning'. Are you missing an assembly reference?
src/AssemblyAttributes.cs(3,46): error CS0234: The type or namespace name
`TargetFrameworkAttributeAttribute' does not exist in the namespace
`System.Runtime.Versioning'. Are you missing an assembly reference?

If we comment out line 3 in src/AssemblyAttributes.cs as follows:
using System.Reflection;
using System.Runtime.CompilerServices;
//[assembly:
global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETPortable,Version=v4.0,Profile=Profile2",FrameworkDisplayName="Portable
Library")]

then compilation succeeds as desired.
~/mono-test$ /opt/mono-2.10/bin/gmcs /target:library /out:bin/mono-test.dll
src/AssemblyAttributes.cs
~/mono-test$ ls bin/
mono-test.dll

How can we make compilation successful when the TargetFrameworkAttribute
line is not commented?

Kind Regards,
John Fallows
-- 
>|< Kaazing Corporation >|<
John Fallows | CTO | +1.650.960.8148
444 Castro St, Suite 1100 | Mountain View, CA 94041, USA
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20110709/08875891/attachment.html 


More information about the Mono-devel-list mailing list