开发者

The type initializer for 'Microsoft.PointOfService.Management.Explorer' threw an exception

开发者 https://www.devze.com 2023-02-25 08:15 出处:网络
Imports Microsoft.PointOfService Public Class Form1 Public Sub New() InitializeComponent() myexplorer = New PosExplorer(Me)
Imports Microsoft.PointOfService

Public Class Form1
   Public Sub New()
      InitializeComponent()
         myexplorer = New PosExplorer(Me)

I get the exception 'The type initializer for 'Microsoft.PointOfService.Management.Explorer' threw an exception' at the above line.

I'm using Microsoft.PointOfService.dll assembly, but I has not installed the POSfor.NET.msi in my client machine.

Is there a way to access PosExplorer with out installing anything extra??, why it doesn't work by just adding the assemblies? If I install it, it is installing everything including SDK/samples which doesn't require开发者_JAVA百科 at production.


There are a bunch of registry keys that are created with you run the PosFor.NET installer which help it locate control assemblies and the configuration XML files. If you don't run the installer you won't have these registry keys and will probably have trouble using the POS libraries.

That said, there's also a problem that arises when using even a properly installed POSfor.NET with .NET 4 that will result in an exception like the one you're seeing. Have you looked at the inner exception there to see what the actual error is?

If you are using .NET 4, and the inner exception there it's a CAS security policy exception you need to add this entry to your app.config file:

But I expect you will still have problems getting stuff to work without a proper installation of the POSfor.NET package.


I found out what the problem of your error.probably you are using POS on .NET 4 and needed the following code.

<configuration>
<runtime>
<NetFx40_LegacySecurityPolicy enabled="true"/>
</runtime>
</configuration>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号