C# – The type or namespace name ‘Exchange’ does not exist in the namespace

asp.netc

When I run my ASP.net app I get this error:

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. 

Compiler Error Message: CS0234: The type or namespace name 'Exchange' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

Source Error:

   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;

Best Answer

Make sure your Target Framework versions match in all projects of your solution. I personally have had issues with .NET Framework 4 Client Profile. Once I switched it to .NET Framework 4, it worked.

Related Topic