我有以下错误消息:
An unhandled exception of type 'System.IO.IOException' occurred in PresentationFramework.dll
Additional information: Cannot locate resource 'Sections/MainWindow.xaml'.
我创建了文件夹,然后将我的 MainWindow.xaml 移动到名为 Sections 的文件夹中。我收到错误,然后找到了这里已经存在的问题,即确保我将 starupURI 更改为 Section/mainwindow.xaml
但是我仍然收到错误消息,我不知道为什么。
编辑:所以我再次运行代码,没有进行任何更改,现在我得到了这个
A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll
Additional information: 'Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '5' and line position '54'.
我在那个位置的代码:
<Window x:Class="CTaC_Information_System.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
WindowStartupLocation="CenterScreen"
Title="CTaC Information System" Height="828" Width="1486.5" Icon="AISLogov2.ico" Loaded="Window_Loaded" FontFamily="Georgia">
红线在>
下方。我转到代码末尾并添加了</Window>
,因为由于某种原因我仍然收到错误消息。
非常感谢所有帮助。
我认为第二个错误是由您的图标引起的。尝试删除该代码并重新编译以检查是否可以隔离问题。您可以尝试将图标图像更改为.png
而不是.ico
。
,当我将类MainWindows.xaml和App.xaml从根文件夹移动到/UI文件夹时,就会发生这种情况。
当我将它们移回时 - 一切又恢复正常,错误消失了。