Hi
I'm migrating an Exchange 2010 Transport Agent written in C# using .NET 3.5 to Exchange 2013.
As described by Microsoft, I've modified the following config files:
C:\Program Files\Microsoft\Exchange Server\V15\Bin\
EdgeTransport.exe.config
MSExchangeFrontEndTransport.exe.config
MSExchangeTransport.exe.config
...and added the following to enable .NET3.5 support:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
..
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" />
<supportedRuntime version="v3.5" />
</startup>
..
I can now take our binaries (.NET3.5) and can manually install the transport agent using PowerShell, and it seems to work.
The problem I have is with the installer using PowerShell - when it attempts to add the Exchange 2013 Power Shell:
_RsConfig.AddPSSnapIn("Microsoft.Exchange.Management.PowerShell.e2010",
out snapInException);
(Note even on Ex2013, the PowerShell add-in is named as E2010!!)
I get the following exception:
"Cannot load Windows PowerShell snap-in Microsoft.Exchange.Management.PowerShell.e2010 because of the following error:
"Could not load file or assembly:
C:\Program Files\Microsoft\Exchange Server\V15\bin\Microsoft.Exchange.PowerShell.Configuration.dll
or one of its dependencies.
This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded."
(This error disappears if the test app is written using .NET4).
It would seem that although Exchange 2013 can support transport agents written in versions of .NET prior to version 4, the Exchange Management PS Snap-in DOES NOT support being called from previous versions of .NET prior to .NET4.
Does anyone have any comments, other than rebuilding the complete project using VS2010 and .NET 4?