简体   繁体   中英

MS Visual Studio 2012 Ultimate - Debugger .NET Version

I have written a Program in C#/WPF and the .Net Version is 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.

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 .

But in my Debug-Mode I still see that Property although my project is set to .Net-4.0.

How to change the version of the Debugger in Microsoft Visual Studio 2012 Ultimate ?

or

Am I misinterpreting the 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. You have 4.5, you got it when you installed VS2012. If you ever had 4.0 then it got overwritten by the 4.5 installer. So inevitably you are going to see 4.5 properties, they are actually there and cannot be hidden from the debugger.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM