Reference one RoslynPad script from another

Viewed 746

What I'd like to do is reference one script from another.

One way to make this happen might be using assemblies. RoslynPad allows compiling a script into an assembly. Here is what I have tried so far.

Script A, which is compiled to SOME_PATH\thing.dll

    class Thing
    {
        public string Name { get; set; }
    }

Script B

    #r "SOME_PATH\thing.dll"

    using static Program;

    var t = new Thing();
    t.Name = "TEST";
    t.Name.Dump();

This gives the error "The type or namespace 'Thing' could not be found..." so I tried the following.

    #r "SOME_PATH\thing.dll"

    var t = new Program.Thing();
    t.Name = "TEST";
    t.Name.Dump();

This gave the following error "The type name 'Thing' does not exist in the type 'Program'".

Is there a way to "Compile and Save assembly" and then reference it from another script? Or, is there a more direct way to cross reference between scripts?

1 Answers
Related