更新时间:2022-10-18 14:32:42
将项目Target更改为非Client Profile目标.右键单击项目",然后选择属性",您应该会看到Framework版本的列表.使用VS2010时,默认情况下创建的Console项目以.NET Framework 4.0 Client Profile为目标,将其更改为.NET Framework 4.0.
I have tried all the suggestions below but still no joy.
I'm now trying a console application, and let me explain exactly what I'm doing.
I have tried setting the dlls to copy to local always, I have copied the DLL into the same directory, I have tried added reference by project and adding a reference to the DLL's themselves
I don't get this problem with a web application project or a ASP.net project they always work fine, only something that is compiled to an EXE like a console app or windows service.
there must be something I'm missing or I would have got this working by now.
Change the project Target to a non Client Profile target. Right click the Project and select Properties, you should see a list of Framework versions. As you are using VS2010, the Console project you've created by default targets .NET Framework 4.0 Client Profile, change that to .NET Framework 4.0.