繁体   English   中英

mscorlib.ni.dll中发生类型为'System.IO.FileNotFoundException'的第一次机会异常-Windows Phone

[英]A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.ni.dll - windows phone

在我的xaml页面中,当我创建一个复选框时,该错误出现,但是将其删除后,该错误消失。 如果我忽略该错误,它将仍然运行,但是我仍然想知道是什么导致该错误出现。 我在这里做错了什么?

以下是xaml代码:

        <toolkit:DatePicker Name="dateData"  
                            HorizontalAlignment="Center" 
                            Width="456"
                            Background="DarkBlue" 
                            ValueStringFormat="{}{0:D}"
                            Foreground="White"
                            BorderBrush="DarkBlue" 
                            />

        <TextBlock HorizontalAlignment="Left"
                   Text="Title" Margin="18,0,0,0" 
                   />

        <TextBox x:Name="titleTBox"  
                 Text="Add New Title"
                 FontFamily="{StaticResource PhoneFontFamilyLight}"      
                 GotFocus="newToDoTextBox_GotFocus" 
                 Grid.ColumnSpan="3" 
                 BorderBrush="Silver" 
                 />
        <TextBlock HorizontalAlignment="Left"  
            TextWrapping="Wrap" 
            Text="Description" 
            VerticalAlignment="Top" Margin="18,0,0,0"
                   />
        <TextBox
                x:Name="descriptionTBox"   
                Text="Add New Description"
                TextWrapping="Wrap"
                FontFamily="{StaticResource PhoneFontFamilyLight}"                    
                GotFocus="newToDoTextBox_GotFocus" Height="125" 
                BorderBrush="Silver" 
                />

        <CheckBox Name="cBox" 
                  Content="Reminder"/>


        <TextBlock HorizontalAlignment="Left"
                   Name="textRDate"
                   Text="Reminder Date" 
                   Margin="18,0,0,0" 
                   Visibility="Collapsed"
                   />

            <toolkit:DatePicker  
                Name="rDate" 
                HorizontalAlignment="Left" 
                Width="456"
                Visibility="Collapsed"
                />

        <TextBlock HorizontalAlignment="Left"
                   Name="TextTDate"
                   Text="Reminder Time" 
                   Margin="18,0,0,0" 
                   Visibility="Collapsed"
                   />

            <toolkit:TimePicker  Name="rTime" 
                                 HorizontalAlignment="Right" 
                                 Width="456"
                                 Visibility="Collapsed"
                                 />
    </StackPanel>

您需要在Xaml文件中的CheckBox中添加以下代码,也可以通过代码来处理...

Checked="CheckBox_Checked" Unchecked="CheckBox_Unchecked"

代码MainPage.xaml.cs句柄

    private void CheckBox_Checked(object sender, RoutedEventArgs e)
    {
        //Add code here

    }

    private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
    {
        //Add code here
    }

希望这可以帮助

尝试从需要在C#中访问的API引用.dll文件时遇到了此错误。 您必须绝对确定自己满足参考的所有要求-通常容易忽略其中的一些要求:

您是否具有正确的驱动程序,并且自安装它们以来已重新启动计算机?

您所引用的文件是否针对正在构建要运行的应用程序的处理器类型而创建? (请参阅选择正确的Active Solution Platform的说明。这篇文章可能会有所帮助: Visual Studio“任何CPU”目标是什么意思?

尝试验证所引用文件的依赖性(它是否需要某种硬件连接?它在寻找或识别什么内容?)。

暂无
暂无

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

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