Skip to content
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

C# language version issue #652

Closed
intrasight opened this issue Jan 6, 2022 · 4 comments
Closed

C# language version issue #652

intrasight opened this issue Jan 6, 2022 · 4 comments

Comments

@intrasight
Copy link

I am getting an error when I try to use a "using" statement without braces. I know this is a c# language feature.
I am using dotnet-script v1.3.1. Is there a command to tell me the compiler version?

@seesharper
Copy link
Collaborator

Is it a runtime error or only in Vs Code.?

@intrasight
Copy link
Author

Compile error

@intrasight
Copy link
Author

Statement

using var jsonDoc = JsonDocument.Parse(responseBody2);

Getting

error CS1002: ; expected
error CS0103: The name "jsonDoc" does not exist in the current context

On that line

@intrasight
Copy link
Author

It was a Roslyn issue. See https://stackoverflow.com/questions/70610365/why-am-i-getting-an-error-with-this-using-statement-without-brackets-net-6

placing curly braces around my script made the compiler happy.

@filipw filipw closed this as completed Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants