Failed to provide minimum permission requests when calling the C # library from the C ++ / CLI library from the local console application.

This question follows from the assembly does not allow partially trusted subscribers when using a custom converter

Thanks to the solution in this matter, I can now call the C # library to the network resource from the local console application (no change in CasPol)

Now I need to take the next step, which calls the C # library from another mixed C ++ / CLI library located in the same folder on the network as the C # library. The C ++ / CLI DLL is invoked by the local console application.

I use the same custom handler discussed above (i.e. with evidence), which works when called to the C # library from the local console application.

When calling the C ++ / CLI library from the local console application, the following exception appears:

Failed to load file or assembly 'MyCplusplusCLILib, Version = 0.0.0.0, Culture = neutral, PublicKeyToken = null or one of its dependencies. Failed to provide minimum permission requests. (Exception from HRESULT: 0x80131417)

If I completely trust the network location, it works correctly, but I don’t understand why I need to provide this trust when, in accordance with the 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 settings Visual Studio)

+4
source share
1 answer

In cases where you do not receive FullTrust, at the bottom of this blog post :

  • Assemblies downloaded from the share subdirectory where .exe was run from
  • Assemblies loaded from shared resources other than where the main .exe was launched
  • Any assembly downloaded to the machine with the LegacyMyComputer registry setting set to 1
  • Any assembly uploaded to the CLR host, including assemblies uploaded to Internet Explorer as controls.
  • Any assembly downloaded from stocks by an application that was launched from the "real" MyComputer zone.

It looks like your case is number 5. Copying .exe to the same network directory will be a workaround.

+6
source

Source: https://habr.com/ru/post/1396308/


All Articles