Missing compiler required member 'System.Runtime.CompilerServices.ExtensionAttribute..ctor'

2,308 views
Skip to first unread message

casebash

unread,
Feb 16, 2010, 9:54:40 PM2/16/10
to LINQBridge
I attempted to install LINQBridge work by coping the dll to my visual
studio 2008 project folder and adding it to the project reference.
This allows me to use LINQ in C# 3.0 with .NET 2.0, but whenever I
attempt to make an extension method I get the following error: "Error
1 Missing compiler required member
'System.Runtime.CompilerServices.ExtensionAttribute..ctor'
ConsoleApplication1'".

Previously I was allowing extension methods by using:

namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class
| AttributeTargets.Method)]
public sealed class ExtensionAttribute : Attribute { }
}

But if I include in then I get the error

Warning 1 The predefined type
'System.Runtime.CompilerServices.ExtensionAttribute' is defined in
multiple assemblies in the global alias; using definition from 'C:
\Users\chris.leong\Documents\Visual Studio 2008\Projects
\ConsoleApplication1\ConsoleApplication1\Class1.cs'
ConsoleApplication1

Reply all
Reply to author
Forward
0 new messages