“The invocation of the constructor on type 'TestWPF.MainWindow' that matches the specified binding constraints threw an exception.”- how to fix this?

后端 未结 15 2154
遥遥无期
遥遥无期 2020-12-03 09:51

I\'m working with WPF. When I\'m trying to declare SQLiteConnection in the code, the problem arises-

The invocation of the constructor on type \         


        
相关标签:
15条回答
  • 2020-12-03 10:28

    My problem was about the interface. I fixed it by deleting the Betternet folder that is located at C:\ProgramData.

    Hidden Items/Folders must be shown in order to be able to view the folder.

    0 讨论(0)
  • 2020-12-03 10:31

    The mentioned exeption is quite generic and you can receive it, for instance, when code fails in the constructor. I had a case of an IO exception that showed up with a similar text. Stepping into the code may provide hints to fix this that may not be obvious otherwise.

    0 讨论(0)
  • 2020-12-03 10:33

    In VS2015 I was able to see the specific code causing this problem once I turned on 'Enable Just My Code' in the Debugging Options under Tools -> Options.

    0 讨论(0)
  • 2020-12-03 10:35

    If you click on View Detail... from the exception window you can look at the InnerException. Expand that node and you will see exactly what went wrong.

    0 讨论(0)
  • 2020-12-03 10:36

    In my case it happened in a code-first WPF project. The cause was model changes after restoring a backup, and the error was not being handled appropriately. "The model backing the 'MyDataContext' context has changed since the database was created." Update-Database sorted it out.

    0 讨论(0)
  • 2020-12-03 10:38

    I had the same problem. i could make it work by renaming the name of App1.config to App.config. I tried all other methods but the solution for me was to change the default name (for me it was App1.config) of the config file to App.config. I shared this because someone may get help by this small modification.

    0 讨论(0)
提交回复
热议问题