Code Coverage by Clover.NET

AllowPartialTrustedCode Attribute

View: New views
2 Messages — Rating Filter:   Alert me  

AllowPartialTrustedCode Attribute

by cubaman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello:
Recently, while using nlog 1.0 in a hosting provider, i found a security exception saying assembly is not marked with AllowPartialTrustedCode attribute. Many hosting providers run web app on medium trust as  per Microsoft recomendations, so it would be helpfull for other people if the assembly is already compiled with it.
Best regards and thanks for this great library!

Re: AllowPartialTrustedCode Attribute

by CalebVanDyke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think that there is more to this issue. I compiled the source with the AllowPartialTrustedCode attribute and nlog still didn't work.

It seems that nlog uses extensive use of reflection and interop and these features are problematic on websites that use medium trust. The use of reflection and interop code I believe is forbidden in medium trust environments.

I haven't gone too deep in the source, but it looks like there will have to be a fair bit of work to change nlog look work fully in medium trust environments.

Caleb