如何在c#中将程序集安全设置为完全受信任?

如何在c#中将程序集安全设置为完全受信任?,c#,wpf,xbap,C#,Wpf,Xbap,我有WPF网页表单。当我尝试为SpeechSynthesizer创建一个实例时,它抛出了一个错误。说, Assembly 'WpfBrowserApplication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is partially trusted, which causes the CLR to make it entirely security transparent regardless of any transpar

我有WPF网页表单。当我尝试为SpeechSynthesizer创建一个实例时,它抛出了一个错误。说,

Assembly 'WpfBrowserApplication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is partially trusted, which causes the CLR to make it entirely security transparent regardless of any transparency annotations in the assembly itself.  In order to access security critical code, this assembly must be fully trusted.
事实上,即使是我也在使用正确的名称空间。i、 例如,使用系统语音合成。无论如何,我不知道为什么会抛出错误

有人能告诉我我错过了什么吗

这是我的密码

 public Page2()
    {
        InitializeComponent();  
        SpeechSynthesizer ss = new SpeechSynthesizer();  
    }

你需要在你的集会上签名。请看以下文章:

摘录:

程序集签名(也称为强名称签名)提供 应用程序或组件其他软件可以使用的唯一标识 识别并明确引用它。强名称由其 简单文本名称、版本号、区域性信息(如果提供), 加上一对公钥/私钥。此信息存储在密钥中 文件这可以是个人信息交换(PFX)文件或 来自当前用户的Windows证书存储的证书。对于 有关详细信息,请参阅

选中此项: