“ Microsoft.PointOfService.Management.Explorer”的类型初始值设定项引发了异常 [英] The type initializer for 'Microsoft.PointOfService.Management.Explorer' threw an exception
问题描述
我正在创建一个将在本地计算机上运行的Web应用程序。我正在尝试在打印按钮上编写代码。
I am creating a web application which will run on a local machine. I am trying to write code on the print button.
初始化新的 PosExplorer()
时,出现错误:
While initializing new PosExplorer()
I get the error:
Microsoft.PointOfService.Management.Explorer的类型初始值设定项引发了异常。。
The type initializer for 'Microsoft.PointOfService.Management.Explorer' threw an exception.".
在内部异常中: 该方法明确使用了.NET Framework已淘汰的CAS策略。为了出于兼容性原因启用CAS策略,请使用NetFx40_LegacySecurityPolicy配置开关。
In the inner exception: "This method explicitly uses CAS policy, which has been obsoleted by the .NET Framework. In order to enable CAS policy for compatibility reasons, please use the NetFx40_LegacySecurityPolicy configuration switch."
我已经为.net 1.12安装了Microsoft POS。尝试在 web.config
和 devenv中使用
文件,但没有一个解决了我的问题。 NetFx40_LegacySecurityPolicy enabled = true
.exe.config
I have installed microsoft POS for .net 1.12 and have also tried using NetFx40_LegacySecurityPolicy enabled="true"
in the web.config
as well as devenv.exe.config
file, but none of them resolved my issue.
我正在使用vs 2010。
I am using vs 2010.
任何
推荐答案
通过添加
<runtime>
<NetFx40_LegacySecurityPolicy enabled="true"/>
进入路径
C:\Program Files\Common Files\microsoft共享\DevServer\10.0\WebDev.WebServer40.exe
in to the path C:\Program Files\Common Files\microsoft shared\DevServer\10.0\WebDev.WebServer40.exe
并重新启动开发环境。
谢谢
And restart the development environment. Thanks
这篇关于“ Microsoft.PointOfService.Management.Explorer”的类型初始值设定项引发了异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!