简体   繁体   English

MS Visual Studio 2012 Ultimate-调试器.NET版本

[英]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.

相关问题 Visual Studio 2012 Ultimate中的移动应用程序开发 - Mobile application development in Visual Studio 2012 Ultimate 使用Visual Studio 2012 Ultimate进行Silverlight 4负载测试 - Silverlight 4 Load Testing with Visual Studio 2012 Ultimate 我在 Microsoft Visual Studio Ultimate 2012 Version 11.0.50727.1 的“表”选项中看不到简单的数据库 - I can't see the simple database in the "Table" option in Microsoft Visual Studio Ultimate 2012 Version 11.0.50727.1 Microsoft Visual Studio Ultimate 2012 版本 11.0.50727.1 中没有“添加新表”选项 - No "Add New Table" option in Microsoft Visual Studio Ultimate 2012 Version 11.0.50727.1 MS Visual Studio 2012调试器不适用于在TFS 2010上构建的解决方案 - MS Visual studio 2012 debugger is not working for solution those build on TFS 2010 Visual Studio 2012 Ultimate-在URL中创建随机字符串 - Visual Studio 2012 Ultimate - creates a random string in the URL 如何将C#安装到Visual Studio 2012 Ultimate - How To Install C# to Visual Studio 2012 Ultimate 无法在Visual Studio Ultimate 2012上安装BenchmarkDotNet 0.10.2 - Can't install BenchmarkDotNet 0.10.2 on Visual Studio Ultimate 2012 Visual Studio 2012调试器无法正常工作 - visual studio 2012 debugger doesn't work 如何部署Windows应用商店项目(Visual Studio Ultimate 2012) - How to deploy windows app store project (Visual Studio Ultimate 2012)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM