名称空间中不存在类型或命名空间名称"Exchange"

Tas*_*sto 3 c# asp.net

当我运行我的ASP.net应用程序时,我收到此错误:

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 
Run Code Online (Sandbox Code Playgroud)

编译器错误消息:CS0234:命名空间"Microsoft"中不存在类型或命名空间名称"Exchange"(您是否缺少程序集引用?)

来源错误:

   Line 06:  using System.Web.UI.WebControls;
   Line 07:  using System.Data.OleDb;
   Line 08:  using Microsoft.Exchange.WebServices.Data; // error
   Line 09:  using System.Net;
   Line 10:  using System.Data.SqlClient;
Run Code Online (Sandbox Code Playgroud)

小智 7

确保您的Target Framework版本在您的解决方案的所有项目中都匹配.我个人遇到过.NET Framework 4 Client Profile的问题.一旦我将其切换到.NET Framework 4,它就可以工作了.


ear*_*ess 1

您可能缺少对 microsoft.exchange.webservices.dll 程序集的引用。至少 ASP.NET 在尝试编译代码时无法找到该程序集。