0

I migrated an project from VS2008 to VS2019 and now I'm getting this error:

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. Please see http://go.microsoft.com/fwlink/?LinkID=155570 for more information.

I cannot open any form designer, I checked the documentation but I really didn't understant, what I have to do?

I tried to create a new form, when I try to add an DevExpress component get the same error: enter image description here

Daniel A. White
  • 187,200
  • 47
  • 362
  • 445
  • Does this answer your question? [CAS Policy error in ASP.NET web Application](https://stackoverflow.com/questions/15804383/cas-policy-error-in-asp-net-web-application) – Ally Jan 31 '20 at 12:34
  • 1
    You'd have to edit devenv.exe.config, that is *not* a great idea. Leaving the framework target at 3.5 or editing the offending code is the better way. – Hans Passant Jan 31 '20 at 12:37
  • This is not ASP.NET web Application, it is a Windows Form app, where is this devenv.exe.config file? I just kept framework target 3.5 but didn't work. – Fernando Donizeti Ito Jan 31 '20 at 12:46
  • Located in C:\Program Files (x86)\Microsoft Visual Studio\2019\xxxx\Common7\IDE, where xxxx is the edition name (like Community). – Hans Passant Jan 31 '20 at 14:16
  • Found it, but now when I set between runtime, my VS doesn't open, if I delete it, VS opens again – Fernando Donizeti Ito Jan 31 '20 at 14:27
  • VS worked now, I inserted this policy in the bottom of the runtime, however my problem still remains, cannot open Forms Designer... – Fernando Donizeti Ito Jan 31 '20 at 14:31
  • 1
    @FernandoDonizetiIto have you tried upgrading your version of the dev express libraries? – Daniel A. White Jan 31 '20 at 14:45
  • @DanielA.White I Installed the latest version of DevExpress, what else I need to do in my solution? How can I upgrade the dev express library? Or will it be automatically upgraded? – Fernando Donizeti Ito Feb 04 '20 at 11:56

1 Answers1

1

The issue was the DevExpress components, I didn't know, but there's an option to upgrade their version, Extensions > DevExpress > Project Converter, after that the forms designers opened again.