Quantcast

Jump to content

» «
Photo

Community Script Hook V .NET

V Released
1,205 replies to this topic
kagikn
  • kagikn

    Ghillie

  • Members
  • Joined: 05 Jun 2014
  • Japan

#1201

Posted 18 October 2017 - 10:53 PM

 

 

 

 

[20:35:52] [ERROR] Failed to create script domain ':
System.InvalidCastException: Could not cast transparent proxy to type "GTA.ScriptDomain".
    in GTA.ScriptDomain.Load (String path)
 
Whats problem?
 

public static ScriptDomain Load(string path){	if (!Path.IsPathRooted(path))	{		path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), path);	}	// Create AppDomain	var setup = new AppDomainSetup();	setup.ApplicationBase = path;	setup.ShadowCopyFiles = "true";	setup.ShadowCopyDirectories = path;	var appdomain = AppDomain.CreateDomain("ScriptDomain_" + (path.GetHashCode() * Environment.TickCount).ToString("X"), null, setup, new System.Security.PermissionSet(System.Security.Permissions.PermissionState.Unrestricted));	appdomain.InitializeLifetimeService();    Log("[DEBUG]", "Path ", path);    ScriptDomain scriptdomain = null;	try	{		scriptdomain = (ScriptDomain)(appdomain.CreateInstanceFromAndUnwrap(typeof(ScriptDomain).Assembly.Location, typeof(ScriptDomain).FullName));	}	catch (Exception ex)	{		Log("[ERROR]", "Failed to create script domain':", Environment.NewLine, ex.ToString());		AppDomain.Unload(appdomain);		return null;	}	Log("[INFO]", "Loading scripts from '", path, "' ...");	if (Directory.Exists(path))	{		var filenameScripts = new List<string>();		var filenameAssemblies = new List<string>();		try		{			filenameScripts.AddRange(Directory.GetFiles(path, "*.vb", SearchOption.AllDirectories));			filenameScripts.AddRange(Directory.GetFiles(path, "*.cs", SearchOption.AllDirectories));			filenameAssemblies.AddRange(Directory.GetFiles(path, "*.dll", SearchOption.AllDirectories));		}		catch (Exception ex)		{			Log("[ERROR]", "Failed to reload scripts:", Environment.NewLine, ex.ToString());			AppDomain.Unload(appdomain);			return null;		}		for (int i = 0; i < filenameAssemblies.Count; i++)		{			var filename = filenameAssemblies[i];			var assemblyName = AssemblyName.GetAssemblyName(filename);			try			{				if (AssemblyName.GetAssemblyName(filename).Name.StartsWith("ScriptHookVDotNet", StringComparison.OrdinalIgnoreCase))				{					Log("[WARNING]", "Removing assembly file '", Path.GetFileName(filename), "'.");					filenameAssemblies.RemoveAt(i--);					try					{						File.Delete(filename);					}					catch (Exception ex)					{						Log("[ERROR]", "Failed to delete assembly file:", Environment.NewLine, ex.ToString());					}				}			}			catch (Exception ex)			{				Log("[ERROR]", "Failed to load assembly file '", Path.GetFileName(filename), "':", Environment.NewLine, ex.ToString());			}		}		foreach (string filename in filenameScripts)		{			scriptdomain.LoadScript(filename);		}		foreach (string filename in filenameAssemblies)		{			scriptdomain.LoadAssembly(filename);		}	}	else	{		Log("[ERROR]", "Failed to reload scripts because the directory is missing.");	}	return scriptdomain;}
Make sure you use the latest v3 build. That works for me, and that would work for you, too. Some old builds don't work due to a wrong root namespace.
 
Its lasted version
No, it's not (if you modified nothing). The code you posted is different from this (the latest build). https://github.com/c...ptDomain.cs#L87
Here's the download link for the latest build. https://ci.appveyor..../1390/artifacts

 

 

Im using last version, really last. Im download default source and execute. 

 

Okay, but I found one thing. If the dll name is ScriptHookVDotNet.dll, the dll won't be loaded. If you renamed the dll ScriptHookVDotNet.dll, revert it.


hellohihey
  • hellohihey

    Player Hater

  • New Members
  • Joined: 26 Dec 2017
  • Austria

#1202

Posted 26 December 2017 - 07:10 PM

Hi!

I juust installed everything I need for the "Single Player Apartment Mod" and during the GTA 5 loading screen I get the following erroer-message and GTA 5 stops loading. When I click "OK" it continue to load and I can play the game but without the features of the mod, of course.  Does anyone know how to fix that?

 

---------------------------
Community Script Hook V .NET
---------------------------
FATAL: Unable to load 'C:\Program Files (x86)\Grand Theft Auto V\ScriptHookVDotNet2.dll' due to the following exception:
 
System.IO.FileLoadException: Die Datei oder Assembly "file:///C:\Program Files (x86)\Grand Theft Auto V\ScriptHookVDotNet2.dll" oder eine Abhängigkeit davon wurde nicht gefunden. Der Vorgang wird nicht unterstützt. (Ausnahme von HRESULT: 0x80131515)
 
Dateiname: "file:///C:\Program Files (x86)\Grand Theft Auto V\ScriptHookVDotNet2.dll" ---> System.NotSupportedException: Es wurde versucht, eine Assembly von einer Netzwerkadresse zu laden, was in früheren Versionen von .NET Framework zum Ausführen der Assembly als Sandkastenassembly geführt hätte. In dieser Version von .NET Framework wird die CAS-Richtlinie standardmäßig nicht aktiviert, dieser Ladevorgang kann daher gefährlich sein. Wenn Sie nicht beabsichtigen, durch diesen Ladevorgang eine Sandkastenassembly zu erstellen, aktivieren Sie den loadFromRemoteSources-Schalter. Weitere Informationen finden Sie unter "http://go.microsoft....LinkId=155569".
 
   bei System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
 
   bei System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
 
   bei System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
 
   bei System.Reflection.Assembly.LoadFrom(String assemblyFile)
 
   bei ManagedInit()
 
 
 
 
---------------------------
OK   
---------------------------
 
Thanks .-)

stef538
  • stef538

    It's just me, going 88 MPH.

  • Members
  • Joined: 06 Oct 2012
  • Netherlands

#1203

Posted 21 January 2018 - 03:49 PM

Hey guys, probably a dumb question but I've been out of modding since late 2015.

Is it possible to load textures/images from your resource file from inside your script like it's possible with the GTA IV Scripthook? or do we still need to extract all the textures/images before we can access them?


Mini_Purple
  • Mini_Purple

    Player Hater

  • New Members
  • Joined: 17 Feb 2018
  • None

#1204

Posted 17 February 2018 - 05:04 AM Edited by Mini_Purple, 17 February 2018 - 05:05 AM.

i've been having issues loading every mod that is made for DotNet, this is the log that i get if i just launch the game without manually creating a scripts folder: 

[22:50:19] [DEBUG] Created script domain 'ScriptDomain_57C54688' with v2.10.5. 
[22:50:19] [DEBUG] Loading scripts from 'E:\#SteamGames\steamapps\common\Grand Theft Auto V\scripts' into script domain 'ScriptDomain_57C54688' ... 
[22:50:19] [ERROR] Failed to reload scripts because the directory is missing. 

So i manually created a scripts folder and installed a few mods and this is what i got: 

[22:58:48] [DEBUG] Created script domain 'ScriptDomain_9D65D0F0' with v2.10.5. 
[22:58:48] [DEBUG] Loading scripts from 'E:\#SteamGames\steamapps\common\Grand Theft Auto V\scripts' into script domain 'ScriptDomain_9D65D0F0' ... 
[22:58:48] [INFO] Loading assembly 'Advanced Bodyguards.dll' ... 
[22:58:48] [ERROR] Failed to load assembly 'Advanced Bodyguards.dll': 
System.IO.FileNotFoundException: Could not load file or assembly 'file:///E:\#SteamGames\steamapps\common\Grand Theft Auto V\scripts\Advanced Bodyguards.dll' or one of its dependencies. The system cannot find the file specified. 
File name: 'file:///E:\#SteamGames\steamapps\common\Grand Theft Auto V\scripts\Advanced Bodyguards.dll' 
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 GTA.ScriptDomain.LoadAssembly(String filename)

WRN: Assembly binding logging is turned OFF. 
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. 
Note: There is some performance penalty associated with assembly bind failure logging. 
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

[22:58:48] [INFO] Loading assembly 'CrysisNanosuit.net.dll' ... 
[22:58:48] [ERROR] Failed to load assembly 'CrysisNanosuit.net.dll': 
System.IO.FileNotFoundException: Could not load file or assembly 'file:///E:\#SteamGames\steamapps\common\Grand Theft Auto V\scripts\CrysisNanosuit.net.dll' or one of its dependencies. The system cannot find the file specified. 
File name: 'file:///E:\#SteamGames\steamapps\common\Grand Theft Auto V\scripts\CrysisNanosuit.net.dll' 
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 GTA.ScriptDomain.LoadAssembly(String filename)

WRN: Assembly binding logging is turned OFF. 
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. 
Note: There is some performance penalty associated with assembly bind failure logging. 
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

[22:58:48] [INFO] Loading assembly 'NativeUI.dll' ... 
[22:58:48] [ERROR] Failed to load assembly 'NativeUI.dll': 
System.IO.FileNotFoundException: Could not load file or assembly 'file:///E:\#SteamGames\steamapps\common\Grand Theft Auto V\scripts\NativeUI.dll' or one of its dependencies. The system cannot find the file specified. 
File name: 'file:///E:\#SteamGames\steamapps\common\Grand Theft Auto V\scripts\NativeUI.dll' 
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 GTA.ScriptDomain.LoadAssembly(String filename)

WRN: Assembly binding logging is turned OFF. 
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. 
Note: There is some performance penalty associated with assembly bind failure logging. 
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

[22:58:48] [INFO] Loading assembly 'NIBMods.net.dll' ... 
[22:58:48] [ERROR] Failed to load assembly 'NIBMods.net.dll': 
System.IO.FileNotFoundException: Could not load file or assembly 'file:///E:\#SteamGames\steamapps\common\Grand Theft Auto V\scripts\NIBMods.net.dll' or one of its dependencies. The system cannot find the file specified. 
File name: 'file:///E:\#SteamGames\steamapps\common\Grand Theft Auto V\scripts\NIBMods.net.dll' 
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 GTA.ScriptDomain.LoadAssembly(String filename)

WRN: Assembly binding logging is turned OFF. 
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. 
Note: There is some performance penalty associated with assembly bind failure logging. 
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. 

I tried this with net framework 4.6.2, with and without the ASP.NET, running as admin, with net framework 4.7.1, and finally with only scripthookv, asi loader, scripthookvdotnet and the scripts in the scripts folder and still no progress there. i have both version 12.0.30501 and 12.0.40660 x86 and x64 Visual C++ redist 2013, and Visual C++ redist 2015 version 14.0.24215 x86 and x64 
What should i do to get the scripts to load? 
Thanks in advance.


S.O.SHELP
  • S.O.SHELP

    Amateur Modder

  • New Members
  • Joined: 4 weeks ago
  • United-States

#1205

Posted 4 weeks ago Edited by S.O.SHELP, 4 weeks ago.

This is my ScriptHookVDotNet.log
 
[03:00:51] [DEBUG] Created script domain 'ScriptDomain_3781DE5C' with v2.10.5.
[03:00:51] [DEBUG] Loading scripts from 'C:\Program Files (x86)\Steam\steamapps\common\Grand Theft Auto V\scripts' into script domain 'ScriptDomain_3781DE5C' ...
[03:00:51] [ERROR] Failed to reload scripts because the directory is missing.
 
 
I need help I have been trying to work this for three days and I have done everything. Down Below is what I have installed and have been trying to install
 
NIBMods.net.dll
ScriptHookVDotNet.asi 
ScriptHookVDotNet.dll
 TFlash.net.dll
4468af-CW The Flash Characters Pack.rar

Google61
  • Google61

    Player Hater

  • Members
  • Joined: 07 Oct 2016
  • Russia

#1206

Posted A week ago Edited by Google61, 2 days ago.

[deleted]





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users