System.Runtime PresentationCore

时间:2016-12-18 10:32:20

标签: c# wpf notifications runtime windows-10

今天我遇到System.Runtime问题。

当我尝试执行某个功能时,会出现此异常错误:

  

L'exception System.IO.FileNotFoundException n'apasétégérée   消息:Une例外非géréedu类型'System.IO.FileNotFoundException's'est produite dans PresentationCore.dll   信息supplémentaires:无法加载文件或程序集'System.Runtime,Version = 4.0.20.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a'或其依赖项之一。系统找不到指定的文件。

你能帮助我吗?

THX。

编辑:添加了之前作为答案错误发布的代码:

using System;
using System.Windows;
using Windows.UI.Notifications;
using Microsoft.Toolkit.Uwp.Notifications;
using Windows.Data.Xml.Dom;

namespace PB_CMN_1
{
    /// <summary>
    /// Logique d'interaction pour MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void button_Click(object sender, RoutedEventArgs e)
        {
            ToastContent content = new ToastContent()
            {
                Launch = "lei",

                Visual = new ToastVisual
                {
                    BindingGeneric = new ToastBindingGeneric()
                    {
                        AppLogoOverride = new ToastGenericAppLogo
                        {
                            HintCrop = ToastGenericAppLogoCrop.Circle,
                            Source = "http://messageme.com/lei/profile.jpg"
                        },
                        Children =
                        {
                          new AdaptiveText {Text = "New message from Lei" },
                          new AdaptiveText {Text = "NotificationsExtensions is great!" }
                        },
                        Attribution = new ToastGenericAttributionText
                        {
                            Text = "Alert"
                        },
                    }
                },
                Actions = new ToastActionsCustom()
                {
                    Inputs =
                    {
                        new ToastTextBox("tbReply")
                        {
                            PlaceholderContent = "Type a response"
                        }
                    },    

                    Buttons =
                    {
                        new ToastButton("reply", "reply")
                        {
                            ActivationType = ToastActivationType.Background,
                            ImageUri = "Assets/QuickReply.png",
                            TextBoxId = "tbReply"
                        }
                    }
                },

                Audio = new ToastAudio()
                {
                    Src = new Uri("ms-winsoundevent:Notification.IM")
                }
            };

            XmlDocument doc = new XmlDocument();
            doc.LoadXml(content.GetContent());

            var Toast = new ToastNotification(doc);

            ToastNotificationManager.CreateToastNotifier().Show(Toast);
        }
    }
}

还有一个细节:调用button_Click方法时会出错。

0 个答案:

没有答案