System.Data Assembly Not found

只谈情不闲聊 提交于 2019-12-04 05:36:30

Add this to app.config..

  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
  </startup>

If you need old versions of dlls to be loaded in a windows service you must add this. For web services iis automatically takes care of it, but not for windows service.

Make sure your project is set to .Net Framework 4. If that doesn't do it, set it to full profile (not just Client)

If you select the referenced assembly in the solution explorer, verify that the runtime version is correct (see image below). You can remove the reference and re-add it to fix it if necessary.

Also, if you are using an app.config, make sure it is targeting the correct runtime version.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!