Tuesday, September 25, 2012

The type or namespace name 'TargetFrameworkAttribute' does not exist...

Since installing VS2012, I've seen a few of these errors in my VS2010 VSMonoTouch (Visual Studio MonoTouch) builds:

The type or namespace name 'TargetFrameworkAttribute' does not exist in the namespace 'System.Runtime.Versioning' (are you missing an assembly reference?)   

To workaround these, I've had to resort to adding a hacky line to my project files to prevent the attribute being generated and to keep them compiling:

<!-- somewhere after the Import of Microsoft.somelanguage.targets -->
<Target Name="GenerateTargetFrameworkMonikerAttribute" />

This hack from an answer in http://stackoverflow.com/questions/3104356/in-visual-studio-2010-why-is-the-netframework-version-v4-0-assemblyattributes-c

No comments:

Post a Comment