1.
在項目上點右鍵-->屬性-->應用程序-->目標框架-->修改為.NET Framework 4。
而我原來的設置是.NET Framework 4 Client Profile。問題就出在這里。
以下是MSDN給出的提示:
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.
不過也因為如此,當在 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%不一致。