Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - Extension Method Question for ServicedComponent

Reply
 
Old 04-05-2008   #1 (permalink)
coconet


 
 

Extension Method Question for ServicedComponent

..NET 3.5
If I understand correctly, extension methods must be in a public
static class. I have some code that executes in a COM+ application for
object pooling purposes. I am trying to update it by using LINQ and an
extension method. I think my code that inherits from ServicedComponent
cannot have any public static code, all methods must be instance
methods.

How can I make this stuff all work together?


Thanks.


My System SpecsSystem Spec
Old 04-06-2008   #2 (permalink)
Anthony Jones


 
 

Re: Extension Method Question for ServicedComponent

"coconet" <coconet@xxxxxx> wrote in message
news:g2dgv3l28lev12mj6g0rmjvj3kflltc7ls@xxxxxx
Quote:

> .NET 3.5
> If I understand correctly, extension methods must be in a public
> static class. I have some code that executes in a COM+ application for
> object pooling purposes. I am trying to update it by using LINQ and an
> extension method. I think my code that inherits from ServicedComponent
> cannot have any public static code, all methods must be instance
> methods.
>
> How can I make this stuff all work together?
>
If I've understood your question correctly I don't think you can.

You will need to create additional interfaces to expose your new methods,
extension methods are not callable via COM since COM requires an interface.

--
Anthony Jones - MVP ASP/ASP.NET


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Question about Copy() method in Excel PowerShell
method not many Vista mail
Method invocation failed because [System.String] doesn't contain a method PowerShell
Question about passing array to a .Net method PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46