oleg-shilo / cs-script

C# scripting platform
http://www.cs-script.net
MIT License
1.57k stars 234 forks source link

Precompiler functionality broken #366

Open rconde01 opened 2 months ago

rconde01 commented 2 months ago

Using 4.8.12.0 test.cs

//css_precompiler Precompiler.cs;

using System;

class Program {
    static void Main(){
        System.Console.WriteLine("Hello");
    }
}

Precompiler.cs

public class Precompiler
{
    public static bool Compile(ref string code, string scriptFile, bool isPrimaryScript, Hashtable context)
    { 
        return false; //false as the code has not been modified
    }
}

running:

cscs test.cs

gives:

Error: Specified file could not be compiled.

Cannot load precompiler D:\third_party_bug_reports\cs-script\precompiler_broken\Precompiler.cs: Object reference not set to an instance of an object.
oleg-shilo commented 2 months ago

Txs for reporting. Will have a look.

oleg-shilo commented 2 months ago

Found it. A silly mistake. Easy to fix. The fix update will be ready in a day or two.

oleg-shilo commented 2 months ago

Done. The fix is merged (684516c).

Will do the release asap

oleg-shilo commented 2 months ago

Released: https://github.com/oleg-shilo/cs-script/releases/tag/v4.8.15

You can update your installation via dotnet tool: dotnet tool install --global cs-script.cli --version 4.8.15

Publishing on Chocolatey and WinGet will take a little longer (a day or two)