Rebex Mail with .NET 4.5.2 'System.TypeInitializationException'

0 votes
asked Mar 23, 2015 by parker (180 points)

I have my project working in .NET 4.0 and when I upgraded to .NET 4.5.2 the Rebex Mail is causing the following error.

A first chance exception of type 'System.TypeInitializationException' occurred in my.app

If I remove reference to the Rebex controls, it works.

Has anyone else had any luck with .NET 4.5.2 OR do you know what I can do to fix this?

Applies to: Rebex Secure Mail

1 Answer

+1 vote
answered Mar 23, 2015 by parker (180 points)

I got it figured out. The problem was on my side, the Rebex DLL's were not being copied to the output directory. Changed copy to local and it works. Not sure how it got changed, but all is good.

commented Mar 25, 2015 by Tomas Knopp (58,890 points)
edited Mar 25, 2015 by Tomas Knopp
Thanks for letting us know that the issue is resolved.

For other users - the .NET4.5.x Framework is supported by Rebex components, just use the assemblies from the 'net-4.0' folder of your Rebex component installation.
commented Mar 25, 2015 by parker (180 points)
The other problem I came across: I needed to add the Rebex.Common.dll
commented Mar 25, 2015 by Tomas Knopp (58,890 points)
So is everything working for you now?
commented Mar 25, 2015 by parker (180 points)
Yes, it is working great.

I just wanted to update my answer to include what I had to do differently for .NET 4 VS .NET 4.5.2
...