runtime: Inconsistent `ParamName` for `ArgumentException`s
This small piece of code:
using System;
using System.Net;
public class Program
{
public static void Main()
{
var client = new WebClient();
try
{
client.Encoding = null;
}
catch (ArgumentException e)
{
Console.WriteLine(e.ParamName);
}
try
{
client.BaseAddress = "invalid address";
}
catch (ArgumentException e)
{
Console.WriteLine(e.ParamName);
}
}
}
prints the following output:
Encoding
value
The expected output is either:
value
value
or
Encoding
BaseAddress
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 18 (15 by maintainers)
@buyaa-n Given that the analyzer is enabled in the repo, I think yes we can close. Any enhancements of the analyzer will get reflected here when it’s updated.
@louis-z the data flow analysis could help with this scenario is interprocedural analysis
If you want to work on it here are some suggestions:
With that being said as the issue mentioned here is fixed and the remaining question is related to roslyn-analyzer we could close this issue, what you think @Youssef1313