Click here to Skip to main content
15,892,746 members
Home / Discussions / C#
   

C#

 
GeneralRe: My guess Pin
Not Active7-Jan-11 11:53
mentorNot Active7-Jan-11 11:53 
GeneralRe: My guess Pin
Eddy Vluggen7-Jan-11 22:05
professionalEddy Vluggen7-Jan-11 22:05 
GeneralRe: My guess Pin
Honeyboy_207-Jan-11 11:20
Honeyboy_207-Jan-11 11:20 
GeneralRe: My guess Pin
Not Active7-Jan-11 11:50
mentorNot Active7-Jan-11 11:50 
GeneralRe: My guess Pin
Honeyboy_207-Jan-11 12:04
Honeyboy_207-Jan-11 12:04 
GeneralRe: I Want to know where's the error in this update Method ? Pin
JOAT-MON7-Jan-11 9:29
JOAT-MON7-Jan-11 9:29 
AnswerRe: I Want to know where's the error in this update Method ? Pin
#realJSOP8-Jan-11 0:22
mve#realJSOP8-Jan-11 0:22 
Question.NET 4 changes to Type.GetProperties Pin
AndyGray7-Jan-11 6:07
AndyGray7-Jan-11 6:07 
Hi
I have discovered an issue using Type.GetProperties on a COM object when running under .NET 3.5 & .NET 4.0.

The following code uses the Microsoft Scripting Runtime COM object as an example - it has the same behaviour with any COM object I have tried. Under .NET 3.5, it correctly returns an array containing one property (the Drives property). Under .NET 4.0, it returns no properties.


Scripting.FileSystemObject fs = new Scripting.FileSystemObject();
Type t = fs.GetType();
PropertyInfo[] props = t.GetProperties();


Type.GetProperties seems to work correctly on .NET objects and only seems a problem with COM objects.

I have some generic code that sets property values by using a string variable as the name that works in .NET 3.5 and now fails in .NET 4.0.

I know that I can upgrade the code to use the dynamic type in .NET 4.0 to do this BUT why is this not backwards compatible or at least documented in some way that is easy to find?


Kind regards
Andy
AnswerRe: .NET 4 changes to Type.GetProperties Pin
Richard MacCutchan7-Jan-11 8:21
mveRichard MacCutchan7-Jan-11 8:21 
GeneralRe: .NET 4 changes to Type.GetProperties Pin
AndyGray8-Jan-11 6:37
AndyGray8-Jan-11 6:37 
AnswerRe: .NET 4 changes to Type.GetProperties Pin
#realJSOP8-Jan-11 0:26
mve#realJSOP8-Jan-11 0:26 
GeneralRe: .NET 4 changes to Type.GetProperties Pin
AndyGray8-Jan-11 6:39
AndyGray8-Jan-11 6:39 
GeneralRe: .NET 4 changes to Type.GetProperties Pin
#realJSOP8-Jan-11 6:48
mve#realJSOP8-Jan-11 6:48 
Questionenums in a class display in Class View alongside classes Pin
bob169727-Jan-11 4:53
bob169727-Jan-11 4:53 
Questionclipboard pastes two times Pin
Erdinc276-Jan-11 22:52
Erdinc276-Jan-11 22:52 
AnswerRe: clipboard pastes two times Pin
JF20156-Jan-11 22:58
JF20156-Jan-11 22:58 
GeneralRe: clipboard pastes two times Pin
Erdinc276-Jan-11 23:18
Erdinc276-Jan-11 23:18 
GeneralRe: clipboard pastes two times Pin
Erdinc276-Jan-11 23:23
Erdinc276-Jan-11 23:23 
GeneralRe: clipboard pastes two times Pin
JF20156-Jan-11 23:34
JF20156-Jan-11 23:34 
GeneralRe: clipboard pastes two times Pin
Luc Pattyn7-Jan-11 0:21
sitebuilderLuc Pattyn7-Jan-11 0:21 
AnswerRe: clipboard pastes two times Pin
#realJSOP7-Jan-11 1:45
mve#realJSOP7-Jan-11 1:45 
GeneralRe: clipboard pastes two times Pin
Erdinc277-Jan-11 22:01
Erdinc277-Jan-11 22:01 
GeneralRe: clipboard pastes two times Pin
#realJSOP8-Jan-11 0:30
mve#realJSOP8-Jan-11 0:30 
GeneralRe: clipboard pastes two times Pin
Dave Kreskowiak8-Jan-11 4:28
mveDave Kreskowiak8-Jan-11 4:28 
QuestionExtract the text on PDF Pin
abbd6-Jan-11 5:07
abbd6-Jan-11 5:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.