解決如下:
我的項目是應用程序,是在app.config 文件里面根節點加入:
<runtime>
<NetFx40_LegacySecurityPolicy enabled="true"/>
</runtime>便可以順利解決