问题
I have built a simple transport agent (using .NET 4.0) for exchange 2010 and I'm trying to install it using the exchange management shell, but I run across this error:
Could not load file or assembly 'file:///C:\Program Files\Microsoft\Exchange Server\V14\Public\MySimpleAgent.
dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot
be loaded.
+ CategoryInfo : InvalidArgument: (:) [Install-TransportAgent], BadImageFormatException
+ FullyQualifiedErrorId : 3A033BB9,Microsoft.Exchange.Management.AgentTasks.InstallTransportAgent
I really only found one good public discussion of this issue, but the solutions suggested by some have not helped my situation.
I have:
- Made sure that my project references both
Microsoft.Exchange.Data.Transport
andMicrosoft.Exchange.Data.Common
- Deployed my assembly(ies) to
\Program Files\Microsoft\Exchange Server\V14\Public
Any other suggestions?
回答1:
I chased my tail for two days trying to figure this one out. The problem ended up being that the version of the Microsoft.Exchange.Data.Common and Microsoft.Exchange.Data.Transport dlls referenced in my project did not match the version of the dll's in the "public" folder on the hub transport servers. After updating my referenced dll's to the correct version the problem went away.
回答2:
I had the same problem a few days. My colleague installed the .NEt Framework 4.0 (without rebooting the server) and the problem was still there. After I read a lot of forum entries and tips and tricks I found the problem on my Exchange Server 2010. I only had to restart the IIS. After the restart I could install my transport agent without problems.
回答3:
Try to compile in 64 bit, it did the job for me!
回答4:
I had to compile as x64 and .NET 3.5 for the install to work (used VS2013)
Also doing iisreset helped because I did initially get the error even with .NET 3.5. Because w3wp had a hold on the file from me trying to repeatedly install it.
.NET 3.5 was required by the two references
Microsoft.Exchange.Data.Common
Microsoft.Exchange.Data.Transport
.NET 4.0 didn't work for me and I initially tried using .NET 2.0 following MS documentaion
来源:https://stackoverflow.com/questions/6229687/exchange-server-transport-agent-wont-load-built-by-a-newer-runtime