Closed eugene-vv closed 2 years ago
It is a bug. let me have a look at it
Until the problem is fixed you can use this workaround.
//css_pre
- precompilation. I regret now that I did not remove the obsolete //css_pre
but have no choice ane will need to fix it.
Precompilation is achieved via //css_pc <precompiler_script>
.pcs.cs
file
using System;
using System.Collections;
using System.Collections.Generic;
public class Sample_Precompiler // precompiler class name must end with 'Precompiler'
{
public static bool Compile(ref string scriptCode, string scriptFile, bool isPrimaryScript, Hashtable context)
{
Console.WriteLine(scriptFile);
return false;
}
}
script.cs
file
//css_pc pc.cs
using System;
public class script
{
public static void Main(string[] args)
{
Console.WriteLine("Main script");
}
}
//css_include <script file>
.Thanks for quick answer. I will implement workaround in my code.
Fixed in v4.4.2.0
Hello Oleg, I unzipped manually cs-script.win.4.4.0.0 version. And for test purpose (pre/post scripts execution) created example main2.cs:
//css_pre pre2($this); using System; public class Main2 { public static void Main(string[] args) { Console.WriteLine("Main2 script"); } }
And pre2.cs:using System; public class Pre2 { public static void Main(string[] args) { Console.WriteLine("Pre2"); } }
both in one folder. running cscs main2.cs returns OverflowException: Am I doing something wrong?