During the past three years I’ve developed this project you are the second person to ever ask for medium trust, so I’ll have to give the same answer as I did the last time.
Piranha CMS have never been validated for medium trust, the reason for this is simple. Usually, at least with all of the shared hosting providers I have ever worked with, medium trust is primarily used form ASP.NET 1.0-3.5. I haven’t come across anyone that actually uses medium trust for .NET 4.0-4.5. If you google a bit you’ll see that even Microsoft considers medium trust to be obsolete, for example:
Is trying to develop for Medium Trust a lost cause?
My suggestion is to switch hosting provider, as this will be much more cost efficient than to spend time investigating what’s causing the error. If you for some reason HAVE to stay within medium trust you’ll have to debug it locally against the source code. If you find any changes that needs to be made you can always send a pull request back to the repo to have them included.
But please note that we do not test for medium trust, so we can not guarantee that future releases will be compatible with medium trust either.
Regards