System.Transactions.Diagnostics.DiagnosticTrace throwing TypeInitializationException

十年热恋 提交于 2019-11-29 15:42:18
David Sacks

The comment about seeing the link below should fix the problem. App's .exe file missing .NET TargetFramework, but only on clean builds

Basically: Delete C:\Users\YOURNAME\AppData\Local\Temp\.NETFramework,Version=v4.0.AssemblyAttributes.cpp

(From comments above)

I had capitalization problems in my app.config file. Example: "connectionstrings" should be "connectionStrings". That seemed to solve the problem for me.

Hope this helped others.

Just Clear App.Config file and rebuild your project

App.Config should be like

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup> 
</configuration>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!