Sitelet https://github.com/Microsoft/ApplicationInsights-dotnet-logging/pull/143
Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Fix NRE in DiagnosticSourceListener when property values are null - #143

Merged
Sergey Kanzhelev (SergeyKanzhelev) merged 2 commits into
microsoft:developfrom
pharring:develop
Jan 16, 2018
Merged

Sergey Kanzhelev (SergeyKanzhelev) merged 2 commits into
microsoft:developfrom
pharring:develop

Conversation

@pharring

@pharring Paul Harrington (pharring) commented Jan 15, 2018 •

Copy link
Copy Markdown
Contributor

The DiagnosticSourceListener tests project got removed with the last round of project shuffling (#135)
This puts it back.

Also fix a bug (NRE) when property values are null and add a test to cover that case.

@pharring Paul Harrington (pharring) changed the title Put back DiagnosticSourceListener tests Fix NRE in DiagnosticSourceListener when property values are null Jan 15, 2018
@SergeyKanzhelev
Sergey Kanzhelev (SergeyKanzhelev) merged commit 969e71a into microsoft:develop Jan 16, 2018
@SergeyKanzhelev

Copy link
Copy Markdown
Contributor

Paul Harrington (@pharring) build failed with the error. Can you please fix?

3 error(s), 10 warning(s)

Build - 3 error(s), 10 warning(s)
src\DiagnosticSourceListener\DiagnosticSourceListenerSubscription.cs(61):src\DiagnosticSourceListener\DiagnosticSourceListenerSubscription.cs(61,0): Error CA1305: Microsoft.Globalization : Because the behavior of 'Convert.ToString(object)' could vary based on the current user's locale settings, replace this call in 'DiagnosticSourceListenerSubscription.OnNext(KeyValuePair<string, object>)' with a call to 'Convert.ToString(object, IFormatProvider)'. If the result of 'Convert.ToString(object, IFormatProvider)' will be displayed to the user, specify System.Globalization.CultureInfo.CurrentCulture as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify System.Globalization.CultureInfo.InvariantCulture.
src\DiagnosticSourceListener\DiagnosticSourceListenerSubscription.cs(61):src\DiagnosticSourceListener\DiagnosticSourceListenerSubscription.cs(61,0): Error CA1305: Microsoft.Globalization : Because the behavior of 'Convert.ToString(object)' could vary based on the current user's locale settings, replace this call in 'DiagnosticSourceListenerSubscription.OnNext(KeyValuePair<string, object>)' with a call to 'Convert.ToString(object, IFormatProvider)'. If the result of 'Convert.ToString(object, IFormatProvider)' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'.
Process 'msbuild.exe' exited with code '1'.

@pharring

Copy link
Copy Markdown
Contributor Author

Sergey Kanzhelev (@SergeyKanzhelev) ugh! Sorry about that - I should have done a Release build.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants