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

  • Question

  • I get this error when trying to set the POSExplorer varible.  Is there a fix for this? It seems like the sample code I have works fine in the program it came from but when I try to implement it into my application it throws this error.

    public

    {

    InitializeComponent();

    myExplorer =

    create_order_sg() new PosExplorer(this);
    Tuesday, May 25, 2010 1:58 PM

Answers

  • Never mind I found out what the problem was.  I'm using POS on .NET 4 and needed the following code.

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

     

    • Marked as answer by 1tufgt Tuesday, May 25, 2010 3:03 PM
    Tuesday, May 25, 2010 3:02 PM

All replies

  • Where's the error?
    Tuesday, May 25, 2010 2:42 PM
  • Never mind I found out what the problem was.  I'm using POS on .NET 4 and needed the following code.

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

     

    • Marked as answer by 1tufgt Tuesday, May 25, 2010 3:03 PM
    Tuesday, May 25, 2010 3:02 PM
  • Never mind I found out what the problem was.  I'm using POS on .NET 4 and needed the following code.

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

     

    I'm having this same issue however, I don't know where to enter the XML configuration code above.

    Can someone please tell me. Thanks.

    Monday, April 18, 2011 6:44 PM
  • Okay I figured it out.

    In case anyone has the same issue, you just right click on your project name. Then click Add New Item. And finally select Application Config, and within that XML file you just paste the code above.

    I've tested it and it works great.

     

    Thanks.

    Monday, April 18, 2011 7:25 PM
  • hi,

    it works ! but when i use a dynamic type ! it doesn't work i need to remove it to use the dynamic type !

    another solution please !!


    ramzi
    Tuesday, April 19, 2011 4:57 PM
  • Can you paste the exact exception message and stack trace plus the code you're using? That way it's easier to provide support.

    WPF & .NET Tutorials
    Thursday, April 21, 2011 1:41 PM