繁体   English   中英

如何在Visual Studio 2010 Express for C#中进行调试生成

[英]How do I build for debug in Visual Studio 2010 Express for C#

我最近开始学习C#,很快发现我在运行项目时未引发任何异常。 我正在观看的教程提到异常在Release配置中的工作方式与在Debug配置中的不同,因此我认为必须在Release配置下运行。

我在Microsoft网站上找到了一篇文章,指出了如何切换配置,但是由于我仍然无法弄清楚如何切换设置,因此我必须在说明中缺少一些内容。

我正在使用Visual Studio Express 2010 for C#。 有人可以告诉我为什么未抛出以下异常以及如何解决该异常吗?

这是我正在使用的代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ReallySimpleLifeCounter
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            _testLabel.Content = "Working";
            throw new Exception(); //not being thrown
        }
    }
}

您可以使用配置管理器设置模式,通常是热键F5。

确保从那里选择了“标准”工具栏,您可以选择运行Build {Debug,Release}的模式

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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