Using Codebase to load an assembly

Based on this question, I tried using <codebase> to search for an external assembly. Now, when I run the program, an error message appears stating that the private assembly is outside the application. How can I fix this problem? One of the suggestions I saw said to sign the meeting. I did this, but then my program could not find the assembly. When I unsigned it, I get an error outside the appbase . How to download an assembly that is in a different location using <codebase> and not install it in the GAC? (The study also did not work, and it seems that it should still be present in the application folder) My configuration file:

 <?xml version="1.0" encoding="utf-8" ?> <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="NGameHost" culture="neutral" /> <codeBase version="1.0.0.0" href="C:/Program Files/NetworkGame3/api/NGameHost.exe"/> </dependentAssembly> </assemblyBinding> </runtime> </configuration> 
+4
source share
1 answer

If the assembly is a private assembler, then the configuration of the code base should be the path to the application directory.

(from MSDN )

+7
source

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


All Articles