Hello,
You should not use the dotnet 4.0 for a projet with Exchange 2013/2010/2007 component (specialy for the powershell addons not working with .net 4).
As you can see below the supported version are not including version higher than 3.5 on Exchange 2007
| .NET Framework |
Exchange 2013 SP1 or later |
Exchange 2010 SP3 |
Exchange 2007 SP3 |
|
.NET Framework 2.0 SP1
|
|
|
X
|
|
.NET Framework 3.0
|
|
|
X
|
|
.NET Framework 3.5
|
|
X2
|
X1
|
|
.NET Framework 3.5 SP1
|
|
X
|
X
|
|
.NET Framework 4.0
|
|
X2,3
|
|
|
.NET Framework 4.5
|
X
|
X2,3
|
|
|
.NET Framework 4.5.1
|
X
|
|
|
|
.NET Framework 4.5.2
|
X
|
|
|
Source : https://technet.microsoft.com/en-us/library/ff728623%28v=exchg.150%29.aspx
You could code your application in a different way for doing this in .NET 4.0 using remote powershell and import the remote PSSession (same procedure used for remote powershell on exchange online).
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://exchangeserverfqdn.local/powershell/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Create a class that connect to the exchange server and invoke a remote pssession it should be working and adapt the cmdlet to the correct exchange version (should work for EX7/10/13 and higher version).
Have fun :)
-
Proposed as answer by
Mounir LABAIED MSEXCHANGER
23 hours 10 minutes ago
-
Edited by
Mounir LABAIED MSEXCHANGER
23 hours 8 minutes ago