WPF Type initialization Exception in C#

后端 未结 8 2368
长发绾君心
长发绾君心 2020-12-17 19:44

I have someone else\'s WPF-based .NET 3.5 app that I\'m attempting to update to .NET 4.5. The code ran fine under .NET 3.5, and I\'m running Visual Studio 2013 Express on Wi

8条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-17 20:04

    Late to the party, but found this reason in my case. I had added a key-value pair with appSettings in app.config as in

    
        
    
    

    before . Upon digging in the internet, I came to know that, had to be at the top of the root, soon after and rest of the orders are irrelevant. Moving appSettings below helped me fix this issue.

提交回复
热议问题