\n | if (_scriptTypes.TryGetValue(key, out Tuple<string, Type> scriptType)) | \n
\n | { | \n
\n | Log.Message(Log.Level.Warning, \"The script name \", type.FullName, \" already exists and was loaded from \", Path.GetFileName(scriptType.Item1), \". Ignoring occurrence loaded from \", Path.GetFileName(filename), \".\"); | \n
\n | continue; // Skip types that were already added previously are ignored | \n
\n | } | \n
Some of the differences between placing .cs or .vb files and placing .dll files are like this;
\nScript devs wouldn't be able to have their scripts achieve what they want to as a single .cs or .vb file when they want to do something advanced, but providing scripts as built .dll files can have more options to do.
","upvoteCount":0,"url":"https://GitHub.com/scripthookvdotnet/scripthookvdotnet/discussions/1471#discussioncomment-10039179"}}}-
if one makes the source code of his script public (eg. public repo), is there any benefit of making it a .dll file? |
Beta Was this translation helpful? Give feedback.
-
yes, there are. If some script authors don't provide built binaries of their scripts, you'll need a program to build them from their solutions before you can use them in SHVDN. Note that SHVDN's compiler feature doesn't allow script authors to configure what assemblies their scripts should have references to, so you can't specify libraries such as LemonUI to add references when you put your scripts as .cs files. Script devs might want to configure more than what SHVDN's compiler provides, such as attribute injection of like, |
Beta Was this translation helpful? Give feedback.
Well, when there are multiple assemblies that has the same name and version (not the API version!), SHVDN skips some of them but how SHVDN skips such ones is not defined as a public documentation. Script format doesn't matter, can happen with any of
.cs
,.vb
, and.dll
files.scripthookvdotnet/source/core/ScriptDomain.cs
Lines 506 to 510 in fd3eca5