Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The type or namespace name 'Exchange' does not exist in the namespace

Tags:

c#

asp.net

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;
like image 200
Tassisto Avatar asked Dec 28 '22 23:12

Tassisto


2 Answers

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.

like image 122
Tim Dostin Avatar answered Dec 30 '22 13:12

Tim Dostin


You are probably missing a reference to microsoft.exchange.webservices.dll assembly. At least the ASP.NET cannot find that assembly when it tries to compile the code.

like image 21
earlNameless Avatar answered Dec 30 '22 12:12

earlNameless