This question follows on from Assembly does not allow partially trusted callers when using a custom resolver
Thanks to the solution in that question I am now able to call into a C# Library on a network share from a local console application (with no changes to CasPol)
I now need to take the next step which is calling the C# Library from another mixed C++/CLI DLL that is in the same folder on the network as the C# Library. The C++/CLI DLL will be called by the local console application.
I'm using the same custom handler in question above (ie. with evidence) that works when calling into a C# library fromn a local console application.
When calling into the C++/CLI library from the local Console application I get the following exception:
Could not load file or assembly 'MyCplusplusCLILib, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)
If I fully trust the network location it works correctly however I do not understand why I need to grant this trust when according to changes in 3.5 SP1 the Intranet should no longer require FullTrust to be applied to it (all libraries are compiled for .NET 3.5 in the Visual Studio options)
The cases where you don't get FullTrust are listed at the bottom of this blog post:
Sounds like your case is number 5. Copying the .exe to the same network directory would be a workaround.
I faced an issue with DLL permissions. DLL files downloaded from internet get blocked in windows due to security/trust issue. They needed to be manually unblocked before any part of code can use these dependency.
To unblock:
Go to properties & click the "unblock" button and the problem may be solved.
User contributions licensed under CC BY-SA 3.0