-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Pass command line empty string arguments to C# console application. #1062
Comments
Interesting! What version(s) of Framework/Core/Mono have you tried this in? Curious that this has not broken a lot of applications out there that parse their commandlines. |
@sujayvsarma
|
Is this a bug, or is there a plan to improve it? |
333fred
added a commit
to dotnet/roslyn-analyzers
that referenced
this issue
Sep 26, 2024
* Add an analyzer for Debug.Assert As @jaredpar found in dotnet/roslyn#75163, interpolated strings in `Debug.Assert` can consume a surprising amount of memory. On modern .NET, this is fine; `Debug.Assert` has an interpolated string handler that will avoid the allocations if the assert isn't triggered. However, on our framework tests, this can be very bad and OOM our tests. So, this analyzer looks for cases where interpolated strings are passed to `Debug.Assert`, and recommends moving over to `RoslynDebug.Assert` instead, which is an interpolated string handler on all platforms. Note that I only did C# support, as there's no equivalent handler API for VB. * Make sure RoslynDebug is available in one test. * Trailing whitespace * Run pack. * Remove VB * Pack again * Use batch fixall provider * Avoid passing empty string as command line argument See microsoft/dotnet#1062 * Don't warn for constant strings. * Apply suggestions from code review Co-authored-by: Jared Parsons <[email protected]> --------- Co-authored-by: Sam Harwell <[email protected]> Co-authored-by: Jared Parsons <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wrote simple console application.
I need to pass empty string arguments to C# console application.
But some shell, some framework can not.
Why difference is it?
The test results
.Net Framework depends on shell.
.Net core is ignore empty string alway.
PowerShell is ignore empty string alway.
Mono is only bash.
Windows
Mac
Linux
The text was updated successfully, but these errors were encountered: