.......................

I have a problem with .Net assemblies that are not detected when I try to load them from a 64-bit process if the user loading the assemblies does not have sufficient access rights.

Downloading the same assemblies from a 32-bit process is not a problem, and if a user who is running a 64-bit process is given change rights, downloading is not a problem.

The dll files are in file sharing (I assume it is NTFS, but not quite sure) and booting from the UNC path.

DLL does not load into normal. Net-program, but used in Python through Python.Net and in Matlab through the usual integration of Matlab.Net. The problem is the same in Python and Matlab, so suppose the problem is on the .Net side.

+4
source share
1 answer

There is a version AppDomain.CurrentDomain.Load()that accepts byte[]containing the contents of a DLL file for download. Using this, you can manually download any .NET assembly that you can access, be it on the local disk, network, compressed, resource, loaded, etc.

In C #, you can use something like this:

public static Assembly LoadAssembly(string filename)
{
    var content = System.IO.File.ReadAllBytes(filename);
    return AppDomain.CurrentDomain.Load(content);
}

Not even trying to translate this into Python.NET or Matlab.

, . , DLL , , . .

+4

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


All Articles