![](/img/trans.png)
[英]Microsoft Visual Studio C# 2010 Express: Can debug but not build
[英]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.