Locked NetFx40_LegacySecurityPolicy enabled

  • Thursday, October 13, 2011 3:48 PM
     
     

    I am working on my windows app(c#.net,VS2010,.net 4.0).

    I don't understand the meaning of Bellow shown lines. But I added when my receipt printer was not working(Using OPOS/POSfor.net).

    <runtime>

        <NetFx40_LegacySecurityPolicy enabled="true"/>

      </runtime>

    Everything was fine as my receipt printer started working after that. But, when I started to work on my payment processing module I started facing problems.

    The payment processing person gave me one dll file. and I am adding that into my add reference section.Now when I do credit card sale I am getting this error. 

    Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

    Now I google this error and found that I need to remove previously added lines which made my receipt printer to work.

    So now what should I do because If I remove these line then my printer will not work and if I keep these lines my Payment Processing will not work.

    While google I found that there is something related with CAS Policy.(Don't know much about it).


    victorphilips

All Replies

  • Thursday, October 13, 2011 4:53 PM
    Answerer
     
     

    POS for .NET requires .NET 2.0 to be in the image. POS for .NET hasn't been upgraded to support .NET 4.0 standalone. The legacy security policy line should be added. You can search this forum for past references.

    Do you have .NET 2.0 installed?

    -Sean


    www.sjjmicro.com / www.seanliming.com / www.annabooks.com, Book Author - ProGuide to WES 7, XP Embedded Advanced, WEPOS / POS for .NET Step-by-Step
  • Thursday, October 13, 2011 5:23 PM
     
     

    Thanks for the reply Sean,

    I have .net framework 2.0 SP2 already installed on to my computer. 

    I was working on Point of Sale app on VS2008 and .net framework 3.5 SP1. Recently I upgraded my app for VS2010 and .net framework 4.0. After upgrade my receipt printer was not working so I added 

    <runtime>

        <NetFx40_LegacySecurityPolicy enabled="true"/>

      </runtime>

    in to my app.config. now i don't have any problem with printer.

    Recently I found my payment processing module is not working and when I remove these lines it works fine.

    So what should i do to make both things to work.

    FYI: for my payment processing I am adding one given dll into add reference section. I am calling its methods to process credit card. 



    victorphilips
  • Thursday, October 13, 2011 6:58 PM
    Answerer
     
     

    Without knowing more about the application and DLL, it sounds like a compatibility issue or security policy conflict.

    Maybe someone else in the forum has ran into this.

    -Sean


    www.sjjmicro.com / www.seanliming.com / www.annabooks.com, Book Author - ProGuide to WES 7, XP Embedded Advanced, WEPOS / POS for .NET Step-by-Step