-
Notifications
You must be signed in to change notification settings - Fork 174
csx parsing problems #720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@atifaziz Want to take a look at this? 😃 |
Had a quick look and proposed a fix in PR #724 for the "
I do believe this is not allowed in a script so not sure anything can be done about it. While not officially documented, see dotnet/roslyn#28588 where it says:
|
I try to transform my LINQPad queries to dotnet-script. In LINQPad 1, 2 work without problems. |
@i-mark LINQPad doesn't use C# scripting like this tool so it's not bound to the same restrictions. LINQPad turns your query/script into a whole C# program, somewhat like what I emulate in LINQPadless. |
Ok, thx. I run it with c# scripting and this code throw (1,11): error CS1002 var options = ScriptOptions.Default
.AddReferences(typeof(Console).Assembly)
.AddImports("System")
.AddImports("System.IO");
//var statement = "using (var ms = new System.IO.MemoryStream()) {};";
var statement = "using var ms = new System.IO.MemoryStream();";
await CSharpScript.RunAsync(statement); |
I found a few problems with csx parsing:
Produce error:
Could not find file '/Users/mark/Code/CSharpLab/ScriptHelper.csx"'.
Although it works:
Produce errors:
error CS0103: The name 'connection' does not exist in the current context
error CS1002: ; expected
Although it works:
The text was updated successfully, but these errors were encountered: