Rhino 8: I get into trouble with the script editor for c# in grasshopper

I always get this error when I change content and compile it in the editor.

Hi @eirannejad , could you help to check on this?

Error info:

  1. Error building code | System.ArgumentException: The value cannot be an empty string. (Parameter ‘path’)
    at System.ArgumentException.ThrowNullOrEmptyException(String argument, String paramName)
    at System.IO.Strategies.FileStreamHelpers.ValidateArguments(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
    at Roslyn.Utilities.StandardFileSystem.OpenFile(String filePath, FileMode mode, FileAccess access, FileShare share)
    at Roslyn.Utilities.CommonCompilerFileSystemExtensions.OpenFileWithNormalizedException(ICommonCompilerFileSystem fileSystem, String filePath, FileMode fileMode, FileAccess fileAccess, FileShare fileShare)
    at Rhino.Runtime.Code.Execution.Roslyn.CompileRequest1.BuildMetaRefs()+MoveNext() at System.Collections.Generic.LargeArrayBuilder1.AddRange(IEnumerable1 items) at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable1 source)
    at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable1 items) at Microsoft.CodeAnalysis.Compilation.ValidateReferences[T](IEnumerable1 references)
    at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.Create(String assemblyName, CSharpCompilationOptions options, IEnumerable1 syntaxTrees, IEnumerable1 references, CSharpCompilation previousSubmission, Type returnType, Type hostObjectType, Boolean isSubmission)
    at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.Create(String assemblyName, IEnumerable1 syntaxTrees, IEnumerable1 references, CSharpCompilationOptions options)
    at Rhino.Runtime.Code.Execution.Roslyn.CSharpCompiler.CreateCSharpCompilation(CSharpCompileRequest cr)
    at Rhino.Runtime.Code.Execution.Roslyn.CSharpCompiler.TryCompile(CSharpCompileRequest cr, MemoryStream& assemblyData, DiagnosticSet& diagnostics)
    at Rhino.Runtime.Code.Languages.Roslyn.Core.RoslynCode1.TryCompile(BuildContext context, CompileSource source, Assembly& assembly, IEnumerable1& diagnostics)
    at Rhino.Runtime.Code.Languages.Roslyn.Core.RoslynCode`1.Compile(BuildContext context)
    at Rhino.Runtime.Code.Code.Build(BuildContext context)
    at Rhino.Runtime.Code.Code.TryBuild(BuildContext context, DiagnosticSet& diagnostics)

Change the default “null” to 1:

Remove the “y” parameter:

I just found out the way to fix that I can get things normal when I unchecked the highlighted box as shown below in grasshopper developer settings.

Hmm very odd! I’ll investigate so see if I can replicate this

Confirmed. When the memory load option is active in Grasshopper Developer Options, the compile breaks. I’ll fix this.

RH-78555 Roslyn does not compile when Memory Load is enabled in GrasshopperDeveloperOptions


@eirannejad we could disable memory load for core GHAs if that helps make things work.

1 Like

@stevebaer I did fix this issue but it would be nice to know that the loaded core GHAs would have a path in Assembly.Location instead of empty

The only way to do that would be to properly load those GHA files instead of using the memory load feature.

I think we should just load all core GHAs as non-memory load assemblies.

1 Like

Didn’t do anything for me, scripting component still spitting out errors you showed

I think they are working on the issue. Maybe we will see the update in the next rc.

Had the same, this fixed it! Thanks!

Using version Rhino 8, 8.1.23325.13001

1 Like