1.框架
在項目上點右鍵-->屬性-->應用程序-->目標框架-->修改成.NET Framework 4。.net
而我原來的設置是.NET Framework 4 Client Profile。問題就出在這裏。get
如下是MSDN給出的提示:io
If you are targeting the .NET Framework 4 Client Profile, you cannot reference an assembly that is not in the .NET Framework 4 Client Profile. Instead you must target the .NET Framework 4.file
不過也由於如此,當在 Visual Studio 2010 創建新項目時,若是發現 [添加引用] 中沒有列出本來應該列出的組件或者引用的其餘程序集,在代碼中的調用一直提示找不到名字空間時,能夠先檢查是不是項目的 target framework 設成了 .NET 4.0 Client Profile (例如 System.Web.dll 就不在 .NET 4.0 Client Profile 套件中),如果改爲.NET Framework 4就OK了。引用
2.程序
檢查Dll.net版本與當前項目是否一致,90%不一致。項目