Extension method issue

107 views
Skip to first unread message

kentar...@gmail.com

unread,
Jun 24, 2008, 3:02:11 AM6/24/08
to ninject
Hi Nate, I found a issue using both extension method and ninject
together,

It initially threw a Warn like this one:
The predefined type
'System.Runtime.CompilerServices.ExtensionAttribute' is defined in
multiple assemblies in the global alias; using definition from 'c:\xxx
\Ninject-1.0-release-net-2.0\Ninject.Core.dll'

And then The compiler Threw an error saying:
Missing compiler required member
'System.Runtime.CompilerServices.ExtensionAttribute..ctor'

Seems that a temporary solution is to remove and readd the ninject v.
1.0.0.82 dll
But if I was in you i will investigate a bit on this issue ;D

Michael Hart

unread,
Jun 24, 2008, 3:25:00 AM6/24/08
to nin...@googlegroups.com
Hi kentaromiura,

I had this problem when using Ninject in a .NET 3.5 project - to
compile Ninject for .NET 3.5, you'll need to add the NET_35
preprocessor flag to build process of the Core project (and possible
the Test project too if memory serves).

There's a submitted issue already to make this a little easier to do (http://bugs.ninject.org/jira/browse/NINJECT-4
), so track that for any changes.

Cheers,

Michael

Nate Kohari

unread,
Jun 24, 2008, 9:01:55 AM6/24/08
to nin...@googlegroups.com
Sorry about this, this is definitely a mistake on my part. I incorrectly assumed that the .NET 2.0 build would work for .NET 3.5 as well, but the extension method patch will screw things up. I'll be posting a .NET 3.5 build soon to fix this problem.


-Nate

CodeFuzion

unread,
Jun 25, 2008, 8:59:47 PM6/25/08
to ninject
Any word on a fix or a manual fix to get around this? Do I just
download the source and pre-pend a preprocessor flag to the build?

Code Fuzion

On Jun 24, 8:01 am, "Nate Kohari" <nkoh...@gmail.com> wrote:
> Sorry about this, this is definitely a mistake on my part. I incorrectly
> assumed that the .NET 2.0 build would work for .NET 3.5 as well, but the
> extension method patch will screw things up. I'll be posting a .NET 3.5
> build soon to fix this problem.
>
> -Nate
>
> On Tue, Jun 24, 2008 at 3:25 AM, Michael Hart <michael.hart...@gmail.com>
> wrote:
>
>
>
> > Hi kentaromiura,
>
> > I had this problem when using Ninject in a .NET 3.5 project - to
> > compile Ninject for .NET 3.5, you'll need to add the NET_35
> > preprocessor flag to build process of the Core project (and possible
> > the Test project too if memory serves).
>
> > There's a submitted issue already to make this a little easier to do (
> >http://bugs.ninject.org/jira/browse/NINJECT-4
> > ), so track that for any changes.
>
> > Cheers,
>
> > Michael
>

Nate Kohari

unread,
Jun 25, 2008, 9:59:18 PM6/25/08
to nin...@googlegroups.com
Yes, if you define NET_35 in the meantime, it will take care of the problem. I'll fix up the build script in the near future.

-Nate

kentar...@gmail.com

unread,
Jun 26, 2008, 6:45:46 PM6/26/08
to ninject
I take out of the project the reference to ninject.core and then i
readd ninject.core to the reference, in this way the build process
take the correct dll and don't blame for a while (if later it give
another time the error i repeat the procedure)

Michael

unread,
Dec 7, 2012, 8:32:21 PM12/7/12
to nin...@googlegroups.com
I seem to be experiencing the same issue. Trying to use Ninject.Extensions.Conventions from the online NuGet source. When I do I get the errors:

Error    4    Missing compiler required member 'System.Runtime.CompilerServices.ExtensionAttribute..ctor'    C:\Source\Detectachem\Seeker\dchem-platform\DChem.Platform\CSC    DChem.Platform

The project is .NET 4 heading into a WPF application. Is there an alternate, cleaner source?

Bartelink, Ruben

unread,
Dec 8, 2012, 4:15:05 AM12/8/12
to nin...@googlegroups.com
Hi,

Mostly this situation occurs with particular versions of Mono mixing .NET 2.0 and 3.5 etc.

If you're on the latest version, and there are no Mono builds in the mix (anywhere), there's no common reason for this to occur.

Can you tell us a little more about what versions of things you're using where?

--Ruben
Reply all
Reply to author
Forward
0 new messages