How to crash VS 2010 in 20 lines of code...
-
Why don't you post the code into the bugreport too?
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams
You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun -
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: 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[^]. -
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: 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[^].Awesome, when I pasted the entire code I, for a second, thought it would be bogus. But then the next second convinced me. I thought it would crash only when trying to use intellisense suggestions when pressing ".".
"To alcohol! The cause of, and solution to, all of life's problems" - Homer Simpson
-
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: 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[^].Shoot. I don't feel like I've really used a version of visual studio until I've crashed the compiler. I specialize in crashing the C++ compiler. I got an error message from vc++ 6 once saying something like "internal error : contact a graduate student." What's up with that? And it was legal C++ too.
-
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: 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[^].Brilliant! :laugh: I had code that crashed VS once too. Don't know what the code was or why it crashed VS. I do know I was in slight panic because it was our entire companies main product that crashed and I couldn't start it up again (I did somehow manage to change the erronous code). Luckily I came back to my senses and simply deleted the code using notepad :laugh:
It's an OO world.
public class Naerling : Lazy<Person>{
public void DoWork(){ throw new NotImplementedException(); }
} -
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: 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[^].Know how to protect yourself from this? Use ReSharper! As soon as you type the "Foo.", ReSharper adds "Crash." in front of it and prevents Visual Studio from having fits! ReSharper, best developer tool, EVER! (possibly even better than Visual Studio! ;) )
-
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: 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[^].wow, the moment I copied the code to VS 2010, it crashed immediately
-
Brilliant! :laugh: I had code that crashed VS once too. Don't know what the code was or why it crashed VS. I do know I was in slight panic because it was our entire companies main product that crashed and I couldn't start it up again (I did somehow manage to change the erronous code). Luckily I came back to my senses and simply deleted the code using notepad :laugh:
It's an OO world.
public class Naerling : Lazy<Person>{
public void DoWork(){ throw new NotImplementedException(); }
} -
Know how to protect yourself from this? Use ReSharper! As soon as you type the "Foo.", ReSharper adds "Crash." in front of it and prevents Visual Studio from having fits! ReSharper, best developer tool, EVER! (possibly even better than Visual Studio! ;) )
-
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: 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[^].Awesome finding... bye the way the only line of code which might caused issue is static void Method(dynamic d)!!!
-
Thanks :) No idea why someone would uni-vote such an innocent post of mine :~
It's an OO world.
public class Naerling : Lazy<Person>{
public void DoWork(){ throw new NotImplementedException(); }
} -
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: 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[^].Lol That's why I would never fly airplane having "Genuine windows" logo attached to it...
-
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: 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[^].public Foo Foo { get; set; }
to
public Foo foo { get; set; }
seems to work now if you want to reboot your system run this
#include
int main( void )
{
for( ;; )
{
printf( "hung up\t\t\b\b\b\b\b\b" );
}
return 0;
} -
I've had a love-hate relationship with Resharper in the past - a lot of useful functionality but it seemed to slow down the IDE. Has this been fixed in the latest versions?
It has been improved in the latest few versions (although I haven't upgraded to the latest latest one). Also, running on a quad core, 64-bit Windows 7 box with 8 GBs of RAM doesn't hurt either! :-D