Android Plugin not working
doomed2020 opened this issue · 3 comments
Hi,
I have tried to compile c-sharp server using Visual Studio 2017 (.Net framework 4.6.2), for some reason visual studio does not allow me to compile using any other .Net framework. But I get an error when launching the tutserver.exe .
Another error pops up when I try to add the Android Plugin. The Plugins List is empty and get an error when i try to click "Reload all".
************** Exception Text **************
System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Users\Doom\Downloads\C-Sharp-R.A.T-Server-master\C-Sharp-R.A.T-Server-master\TutServer\bin\Debug\scripts\AndroidExtension.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
File name: 'file:///C:\Users\Doom\Downloads\C-Sharp-R.A.T-Server-master\C-Sharp-R.A.T-Server-master\TutServer\bin\Debug\scripts\AndroidExtension.dll' ---> 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.
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.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 TutServer.Form1.ScriptHost.LoadDllFiles() in C:\Users\Doom\Downloads\C-Sharp-R.A.T-Server-master\C-Sharp-R.A.T-Server-master\TutServer\Form1.cs:line 594
at TutServer.Form1.button38_Click(Object sender, EventArgs e) in C:\Users\Doom\Downloads\C-Sharp-R.A.T-Server-master\C-Sharp-R.A.T-Server-master\TutServer\Form1.cs:line 5385
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Please make a working Release Build to avoid such compilation error.
Thanks
Hi a quick google search for the problem, because I never saw this problem before, gave the following result: Quick Fix
The problem is caused, because the DLL is from the Web (github) and windows doesn't trust it.
The long term fix would be to edit the App.conifg file to allow the loading of unsafe DLLs.
By unsafe I mean DLL from the Web. I will definitely add the XML to the project as I don't see any downside to loading DLLs from the Web by default, I just have other things going on with the server, so i can't push the fix right now.
Let me know if this fixes your problem!
Advanced Hacking 101
I'm happy that solved the problem, as I said I will fix this, so you don't have to unblock the DLL's after the fix is pushed.
Thank you for pointing out this issue!