我正在将第三方DLL与我们的软件(在Java平台中)集成在一起。 遵循https://www.youtube.com/watch?v=8OoSK_RWUe4中提到的步骤,并且在运行proxygen.exe时遇到错误。 我尝试搜索决议已有2天,但找不到任何有用的信息。 (http://www.codinghouse.org/calling-net-dll-from-java/#comment-395512) (https://groups.google.com/forum/#!topic/jni4net/43HbWrRvZRA)
下面是堆栈跟踪
D:\jni4net-0.8.8.0-bin\bin>.\proxygen.exe "D:\VBProjects\FirstCsharp\helloworld\helloworld\bin\Debug\helloworld.dll" -wd "C:\workspace\CSharpJavaProject" jni4net.proxygen - Copyright (C) 2009 Pavel Savara - licensed under GPLv3根据您的建议,配置的Path和%JAVA_HOME%\ bin 2个env变量仍然无效。它是EC2 Windows Server 2016实例(64位)Proxygen must be run as trusted assembly! (shared drive could cause the problem)
System.TypeInitializationException: The type initializer for 'net.sf.jni4net.proxygen.model.Repository' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'jni4net.n-0.8.8.0, Version=0.8.8.0, Culture=neutral, PublicKeyToken=134a23405600bab4' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) ---> System.IO.FileLoadException: Could not load file or assembly 'file:///D:\jni4net-0.8.8.0-bin\lib\jni4net.n-0.8.8.0.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information. --- End of inner exception stack trace --- at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark) at System.Reflection.Assembly.LoadFrom(String assemblyFile) at net.sf.jni4net.proxygen.Program.AssemblyResolve(Object sender, ResolveEventArgs args) at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName) --- End of inner exception stack trace --- at net.sf.jni4net.proxygen.model.Repository..cctor() --- End of inner exception stack trace --- at net.sf.jni4net.proxygen.Program.Work(String[] args) at net.sf.jni4net.proxygen.Program.Main(String[] args)
您能帮我解决这些问题吗?