Click here to Skip to main content
12,403,378 members (72,368 online)

Welcome to the Lounge

   

For lazing about and discussing anything in a software developer's life that takes your fancy except programming questions.

Technical discussions are encouraged, but click here to ask your programming question.

The Lounge is rated PG. If you're about to post something you wouldn't want your kid sister to read then don't post it. No flame wars, no abusive conduct, no programming questions and please don't post ads.
 
GeneralRe: CCC 16/11/11 Pin
Dalek Dave15-Nov-11 23:53
mvpDalek Dave15-Nov-11 23:53 
GeneralRe: CCC 16/11/11 Pin
Johnny J.15-Nov-11 23:29
memberJohnny J.15-Nov-11 23:29 
GeneralRe: CCC 16/11/11 Pin
Dalek Dave15-Nov-11 23:40
mvpDalek Dave15-Nov-11 23:40 
GeneralRe: CCC 16/11/11 Pin
Richard MacCutchan15-Nov-11 23:48
mvpRichard MacCutchan15-Nov-11 23:48 
GeneralWhat is foobar? Pin
Abhinav S15-Nov-11 21:39
mvpAbhinav S15-Nov-11 21:39 
GeneralRe: What is foobar? PinPopular
mark merrens15-Nov-11 21:47
membermark merrens15-Nov-11 21:47 
GeneralRe: What is foobar? Pin
Erudite__Eric15-Nov-11 21:48
memberErudite__Eric15-Nov-11 21:48 
GeneralRe: What is foobar? Pin
virang_2115-Nov-11 21:53
membervirang_2115-Nov-11 21:53 
GeneralRe: What is foobar? Pin
Abhinav S15-Nov-11 21:54
mvpAbhinav S15-Nov-11 21:54 
GeneralRe: What is foobar? Pin
TorstenH.15-Nov-11 22:59
memberTorstenH.15-Nov-11 22:59 
GeneralRe: What is foobar? Pin
Slacker00715-Nov-11 23:46
memberSlacker00715-Nov-11 23:46 
GeneralRe: What is foobar? Pin
CDP180215-Nov-11 22:00
memberCDP180215-Nov-11 22:00 
GeneralRe: What is foobar? Pin
BobJanova16-Nov-11 2:36
memberBobJanova16-Nov-11 2:36 
GeneralHow to crash VS 2010 in 20 lines of code... PinPopular
J. Dunlap15-Nov-11 21:20
memberJ. Dunlap15-Nov-11 21:20 
namespace Crash
{
    public class Foo
    {
        public static void Method(object o)
        {
            
        }
    }
 
    public class Bar
    {
        public Foo Foo { get; set; }
 
        public static void Method(dynamic d)
        {
            Foo.Method(d); //This crashes VS instantly!
        }
    }
}

Sigh | :sigh: Took me a bit to figure out what triggers it because when I encountered it, there was a lot of other code involved. But basically the method being called must be static and must be referenced via the class name (without a namespace). The method making the call must also be static, and the class it belongs to must have a non-static property with the same name as the class whose method is being called. The dynamic value being passed to it can come from anywhere - it doesn't have to be an argument to the calling function.

The workaround is to use the namespace as well when referencing the class - e.g. Crash.Foo.Method(d).

EDIT: I submitted a bug report here[^].

modified 16-Nov-11 3:43am.

GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
RobCroll15-Nov-11 21:36
memberRobCroll15-Nov-11 21:36 
GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
d@nish 15-Nov-11 22:10
member d@nish 15-Nov-11 22:10 
GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
J. Dunlap15-Nov-11 22:30
memberJ. Dunlap15-Nov-11 22:30 
GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
d@nish 15-Nov-11 22:37
member d@nish 15-Nov-11 22:37 
GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
J. Dunlap15-Nov-11 22:46
memberJ. Dunlap15-Nov-11 22:46 
GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
d@nish 16-Nov-11 0:19
member d@nish 16-Nov-11 0:19 
GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
Firo Atrum Ventus15-Nov-11 22:14
memberFiro Atrum Ventus15-Nov-11 22:14 
GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
d@nish 15-Nov-11 22:16
member d@nish 15-Nov-11 22:16 
GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
Norm .net16-Nov-11 1:21
groupNorm .net16-Nov-11 1:21 
GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
J. Dunlap15-Nov-11 22:27
memberJ. Dunlap15-Nov-11 22:27 
GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
Kanasz Robert15-Nov-11 22:45
memberKanasz Robert15-Nov-11 22:45 
GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
Slacker00715-Nov-11 23:41
memberSlacker00715-Nov-11 23:41 
GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
ahmed zahmed16-Nov-11 3:22
memberahmed zahmed16-Nov-11 3:22 
GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
J. Dunlap16-Nov-11 7:29
memberJ. Dunlap16-Nov-11 7:29 
GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
samuelms17-Nov-11 4:12
membersamuelms17-Nov-11 4:12 
GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
Fabio Franco17-Nov-11 5:01
memberFabio Franco17-Nov-11 5:01 
GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
Member 294139217-Nov-11 5:24
memberMember 294139217-Nov-11 5:24 
GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
Naerling17-Nov-11 8:03
memberNaerling17-Nov-11 8:03 
GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
J. Dunlap17-Nov-11 16:54
memberJ. Dunlap17-Nov-11 16:54 
GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
Naerling17-Nov-11 20:35
memberNaerling17-Nov-11 20:35 
GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
HenryChilvers17-Nov-11 8:22
memberHenryChilvers17-Nov-11 8:22 
GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
J. Dunlap17-Nov-11 16:55
memberJ. Dunlap17-Nov-11 16:55 
GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
HenryChilvers23-Nov-11 6:43
memberHenryChilvers23-Nov-11 6:43 
GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
adewole ayobami17-Nov-11 9:54
memberadewole ayobami17-Nov-11 9:54 
GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
ShabanaParveen17-Nov-11 17:57
memberShabanaParveen17-Nov-11 17:57 
GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
Member 314096219-Nov-11 14:38
memberMember 314096219-Nov-11 14:38 
GeneralRe: How to crash VS 2010 in 20 lines of code... Pin
edmurphy9922-Nov-11 5:45
memberedmurphy9922-Nov-11 5:45 
GeneralSpeaking of kids... Pin
_Maxxx_15-Nov-11 20:53
member_Maxxx_15-Nov-11 20:53 
GeneralRe: Speaking of kids... Pin
Slacker00715-Nov-11 20:59
memberSlacker00715-Nov-11 20:59 
GeneralRe: Speaking of kids... Pin
_Maxxx_15-Nov-11 23:33
member_Maxxx_15-Nov-11 23:33 
GeneralRe: Speaking of kids... Pin
Slacker00715-Nov-11 23:37
memberSlacker00715-Nov-11 23:37 
GeneralRe: Speaking of kids... Pin
BobJanova16-Nov-11 2:40
memberBobJanova16-Nov-11 2:40 
GeneralRe: Speaking of kids... Pin
OriginalGriff15-Nov-11 21:29
mvpOriginalGriff15-Nov-11 21:29 
GeneralRe: Speaking of kids... Pin
GenJerDan16-Nov-11 3:27
memberGenJerDan16-Nov-11 3:27 
GeneralRe: Speaking of kids... Pin
Nagy Vilmos15-Nov-11 21:44
memberNagy Vilmos15-Nov-11 21:44 
GeneralRe: Speaking of kids... Pin
_Maxxx_15-Nov-11 23:34
member_Maxxx_15-Nov-11 23:34 

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.


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 28 Jul 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid