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

TrackException is bleeding a console or trace value into test output #1113

Closed
RickStrahl opened this issue Apr 14, 2019 · 2 comments
Closed

Comments

@RickStrahl
Copy link

Repro Steps

When calling AppInsights.TrackException() a single numeric value bleeds out into the the output console when testing and also during debug sessions. This is likely a debug value, but still it's not cool to see this value bleed through in debugging and test sessions since it has no context.

Actual Behavior

image

I'm demonstrating with the Console.WriteLine() calls to wrapper the test output around the call to TracException. I also see this in the debug window and I've been wondering in the past where this errant value in my debug output was coming from and it turns out it's AInsights.

Expected Behavior

No bleeding of output. This odd value shows up in trace output while debugging.

Version Info

SDK Version :
.NET Version : 4.6.2
How Application was onboarded with SDK(VisualStudio/StatusMonitor/Azure Extension) :
OS : Windows 10 (latest stable)
Hosting Info (IIS/Azure WebApps/ etc) : Desktop app

@pharring
Copy link
Member

I don't think this is coming from the SDK. Can you create a self-contained repro? I tried the obvious thing below and I didn't see any rogue values. I'm using the latest SDK built from the develop branch.

using System;
using System.Collections.Generic;
using Microsoft.ApplicationInsights;
using Microsoft.ApplicationInsights.Extensibility;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            var config = new TelemetryConfiguration("<your instrumentation key>");
            var client = new TelemetryClient(config);
            try
            {
                throw new Exception("oops");
            }
            catch (Exception ex)
            {
                Console.WriteLine("1");

                client.TrackException(ex, new Dictionary<string, string>
                {
                    ["exmsg"] = ex.Message,
                    ["exsource"] = ex.Source,
                    ["extrace"] = ex.StackTrace
                });

                Console.WriteLine("2");
            }
            finally
            {
                config.Dispose();
            }
        }
    }
}

@RickStrahl
Copy link
Author

Ugh - thank you. After a bunch of digging I found that indeed the bleed is coming from of my own old library components.

Apologies for the false alarm.

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

2 participants