[英]MS Visual Studio 2012 Ultimate - Debugger .NET Version
I have written a Program in C#/WPF and the .Net Version is 4.0 . 我已经用C#/ WPF编写了一个程序, .Net版本是4.0 。
When I set breakpoints in my project I can hover over the variables in Debug-Mode and lookup all Properties and Methods of that variable. 当我在项目中设置断点时 ,我可以将鼠标悬停在“调试模式”下的变量上并查找该变量的所有属性和方法。
But in Debug-Mode I still get to see the Properties of .Net-4.5, although my project is set to .Net-4.0. 但是在调试模式下,尽管我的项目设置为.Net-4.0,但仍然可以看到.Net-4.5的属性。
For example, the BindingExpression Class has different Properties in .Net-4.0 and .Net-4.5: In .Net-4.0 the aforementioned class DOES NOT have the Property named Target and in .Net-4.5 the class HAS the Property named Target . 例如, BindingExpression类在.Net的4.0和.Net-4.5 不同的性质 :在.Net的4.0上述类没有属性命名的目标和.Net的4.5类有属性指定的目标 。
But in my Debug-Mode I still see that Property although my project is set to .Net-4.0. 但是在我的调试模式下,尽管我的项目设置为.Net-4.0,我仍然看到该属性。
How to change the version of the Debugger in Microsoft Visual Studio 2012 Ultimate ? 如何在Microsoft Visual Studio 2012 Ultimate中更改调试器的版本?
or 要么
Am I misinterpreting the Debug-View ? 我误解了Debug-View吗?
You are just mis-interpreting what setting the project's Target Framework version does. 您只是在误解项目的目标框架版本的设置。 You don't have .NET 4.0 on machine.
您在计算机上没有.NET 4.0。 You have 4.5, you got it when you installed VS2012.
您有4.5,是在安装VS2012时获得的。 If you ever had 4.0 then it got overwritten by the 4.5 installer.
如果您使用过4.0,那么它会被4.5安装程序覆盖。 So inevitably you are going to see 4.5 properties, they are actually there and cannot be hidden from the debugger.
因此,您不可避免地会看到4.5属性,它们实际上在那里并且不能从调试器中隐藏。
What you can't do is use those properties in your program, the compiler is going to complain. 您不能做的是在程序中使用这些属性,编译器会抱怨。 Which ensures that your program will run correctly on a machine that only has 4.0 installed.
这样可以确保您的程序将在仅安装4.0的计算机上正确运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.