1
的Visual Studio不叫2015年调试空例外 - 男星在WPF
在XAML得到一个错误的
xmlns:local="clr-namespace:Poker"
的错误是XMLParseException,然后SystemArgumentNullException在System.Core.DLL
Poker.MainWindow
ctor从未被称为
App.xaml.cs被调用,但它什么都不做
下一步是xmlns上的错误:local
这是一个程序,我一直在努力的几个星期,并没有任何问题
清洁,重建未显示错误
运行代码分析没有发现错误
我觉得有一些事是打破它运行时解析。
如果我删除的xmlns:地方我可以通过浏览扑克
其他应用程序运行这台电脑上就好添加回来
的PC没有崩溃
有人问代码
<Window x:Class="Poker.MainWindow"
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"
xmlns:local="clr-namespace:Poker"
mc:Ignorable="d"
ResizeMode="NoResize"
DataContext="{Binding RelativeSource={RelativeSource self}}"
Title="No Limit Holdem Poker 6 Player Sit And Go (SNG) - Beat the Bots" Height="600" Width="650">
<Window.Resources>
<BooleanToVisibilityConverter x:Key="bvc" />
<local:BackGroundConverter x:Key="backGroundConverter"/>
<local:BackGroundConverterCard x:Key="backGroundConverterCard"/>
<local:BackGroundConverterSuit x:Key="backGroundConverterSuite"/>
<Style TargetType="TextBlock">
<Setter Property="FontSize" Value="20"/>
</Style>
<Style TargetType="TextBlock" x:Key="StdMargin">
<Setter Property="FontSize" Value="18"/>
<Setter Property="Margin" Value="16,0,0,0"/>
</Style>
<Style TargetType="TextBlock" x:Key="StdMarginPlus">
<Setter Property="FontSize" Value="20"/>
<Setter Property="Margin" Value="24,0,0,0"/>
</Style>
<Style TargetType="ComboBox">
<Setter Property="FontSize" Value="18"/>
</Style>
<Color x:Key="ColorMyLighLightGray">#EDEDED</Color>
<SolidColorBrush x:Key="BrushMyLightLightGrey" Color="{StaticResource ColorMyLighLightGray}"/>
</Window.Resources>
<Grid Margin="10,0,2,0">
</Grid>
</Window>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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;
using System.ComponentModel;
using System.Diagnostics;
//using System.Threading;
namespace Poker
{
public enum enumSuite : byte { spade = 0, club = 1, heart = 3, diamond = 4, none = 5 };
public enum enumRank : byte { one = 1, two = 2, three = 3, four = 4, five = 5, six = 6, seven = 7, eight = 8, nine = 9, ten = 10, jack = 11, queen = 12, king = 13, ace = 14 };
public enum enumHand : byte { high = 0, onePair = 1, twoPair = 2, trip = 3, straight = 4, flush = 5, boat = 6, quad = 7, strtFlush = 8 };
public enum enumHandDraw : byte { onePair = 1, twoPairTrips = 2, straight = 4, flush = 5, boat = 6, quad = 7, strtFlush = 8 };
public enum enumPlayerType : byte { callSn = 0, rock = 1, GTO = 2 };
// 0 nothing
// 1 pair
// 2 pair
// 3 trips
// 4 straight
// 5 flush
// 6 boat
// 7 four of a kind
// 8 straight flush
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window, INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
private void NotifyPropertyChanged(String info)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(info));
}
}
public MainWindow()
{
Debug.WriteLine("ctor"); // does not get called
//LoopCount();
ProcessShuffle();
EveryOneBet(0, true);
before = false;
InitializeComponent();
}
@Clemens主窗口有一个不好的事爆发ctor,它不叫 – Paparazzi
不清楚我在问什么?没有别的要给。这是错误信息,这是错误信息。你还需要什么? – Paparazzi
重现问题的工作示例(MainWindow.xaml,MainWindow.cs)有助于理解问题的根本原因。 –