我對Windows Forms有一些練習,但現在我決定在Visual Studio中嘗試WPF;通過XAML,我在網格中放置了一個圖像,名爲Street2.jpg,圖像可以在工作室中看到。 但是,如果我嘗試啓動它只是不打開(altough它在我的任務管理器生成下面的一個進程)的應用程序,如果我調試它,顯示一條消息:我通過XAML(Visual Studio)放置圖像後,我的WPF應用程序無法打開
這裏是我的XAML代碼(我沒有插在C#代碼做任何事):
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="WhenItAllEndedWPF.MainWindow"
Title="MainWindow" Height="600" Width="800" Background="{x:Null}">
<Grid>
<Grid.Background>
<ImageBrush ImageSource="Images\Street2.jpg"/>
</Grid.Background>
</Grid>
我能做什麼來解決這個問題?謝謝您的幫助!
[編輯]
這是在輸出標籤表明:
線程0x1f0c已退出與代碼259(0x103)。 'WhenItAllEndedWPF.vshost.exe'(CLR v4.0.30319:WhenItAllEndedWPF.vshost.exe):加載'c:\ users \ vini \ documents \ visual studio 2013 \ Projects \ WPF \ WhenItAllEndedWPF \ bin \ Debug \ WhenItAllEndedWPF.exe」。符號加載。 'WhenItAllEndedWPF.vshost.exe'(CLR v4.0.30319:WhenItAllEndedWPF.vshost.exe):Loaded'C:\ Windows \ Microsoft.Net \ assembly \ GAC_MSIL \ System.Configuration \ v4.0_4.0.0.0__b03f5f7f11d50a3a \ System。 Configuration.dll」。找不到或打開PDB文件。
查看內部例外... –
內部的異常會更有用,它可能是沿着「無法找到資源」圖像/ Street2.jpg「 – BenjaminPaul
」我很抱歉;對於那些尋求內在例外的人,我正在尋找究竟是什麼以及如何得到它;對不起,我是一名初學者自學成才的程序員,仍然不知道很多事情。 –