I came across your problem on this forum. I have faced this issue before and there are multiple ways to fix this issue.
1.Try to change the framework if it is 3.5. I changed mine to 4 or above my issue got fixed.
2.I Copied the folder to the drive local to my guest OS and it fixed the issue for me.
3.You can add below lines to your
<trust level="Full" />
It fixed the issue
4.You can go to go to your dll properties and then just press the Unblock button:It will fix the issue.
5. If you are running the command line app and experiencing the issue then: right click on the project >go to settings > go to security > and uncheck the "Enable ClickOnce Security Settings option it will solve the issue.
6.You can give your library that you are trying to call the very strong name.
Then just add assembly:AllowPartiallyTrustedCallers to your library that you want to call.
After that create the code group to set the permissions to your library.