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

System.Diagnostics.DiagnosticSource Causing Error Evaluating the function timedout #2161

Closed
panuoksala opened this issue Jan 26, 2021 · 22 comments
Assignees
Labels

Comments

@panuoksala
Copy link

Description
When I upgrade the package System.Diagnostics.DiagnosticSource from 4.7.1 to 5.0.0, I get the error saying:

Evaluating the function 'System.Diagnostics.TraceInternal.Listeners.get' timedout and needed to be aborted in a unsafe way. This may have corrupted the target process.

Configuration
.Net Framework 4.8
Windows 10
x64

As @fcorbeil said:
This issue prevents me from doing the following updates :
Microsoft.Extensions.Logging.3.1.10 -> Microsoft.Extensions.Logging.5.0.0
Microsoft.ApplicationInsights.Web.2.15.0 -> Microsoft.ApplicationInsights.Web.2.16.0
Microsoft.ApplicationInsights.WindowsServer.2.15.0 -> Microsoft.ApplicationInsights.WindowsServer.2.16.0
Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.2.15.0 -> Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.2.16.0
Microsoft.ApplicationInsights.TraceListener.2.15.0 -> Microsoft.ApplicationInsights.TraceListener.2.16.0
Microsoft.ApplicationInsights.PerfCounterCollector.2.15.0 -> Microsoft.ApplicationInsights.PerfCounterCollector.2.16.0
Microsoft.ApplicationInsights.DependencyCollector.2.15.0 -> Microsoft.ApplicationInsights.DependencyCollector.2.16.0
Microsoft.ApplicationInsights.2.15.0 -> Microsoft.ApplicationInsights.2.16.0
System.Diagnostics.DiagnosticSource.4.7.1 -> System.Diagnostics.DiagnosticSource.5.0.0

Describe the bug

Unable to debug application. Visual Studio raises error System.Diagnostics.DiagnosticSource Causing Error Evaluating the function timedout.

Work around

Enable "Use Managed Compatibility Mode" from Visual Studio to debug application.

This issue is created from original issue dotnet/runtime#44503 that contains all the details

@tiaan-lg
Copy link

Note that
System.Diagnostics.DiagnosticSource 5.0.1 still has the same issue

@Zapnologica
Copy link

Any news on a fix for this issue?

@fcorbeil
Copy link

fcorbeil commented Mar 4, 2021

This issue prevents me from doing the following updates :

Microsoft.Extensions.Logging.3.1.10 -> Microsoft.Extensions.Logging.5.0.0
Microsoft.ApplicationInsights.Web.2.15.0 -> Microsoft.ApplicationInsights.Web.2.17.0
Microsoft.ApplicationInsights.WindowsServer.2.15.0 -> Microsoft.ApplicationInsights.WindowsServer.2.17.0
Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.2.15.0 -> Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.2.17.0
Microsoft.ApplicationInsights.TraceListener.2.15.0 -> Microsoft.ApplicationInsights.TraceListener.2.17.0
Microsoft.ApplicationInsights.PerfCounterCollector.2.15.0 -> Microsoft.ApplicationInsights.PerfCounterCollector.2.17.0
Microsoft.ApplicationInsights.DependencyCollector.2.15.0 -> Microsoft.ApplicationInsights.DependencyCollector.2.17.0
Microsoft.ApplicationInsights.2.15.0 -> Microsoft.ApplicationInsights.2.17.0
System.Diagnostics.DiagnosticSource.4.7.1 -> System.Diagnostics.DiagnosticSource.5.0.1

@gavinbarron
Copy link

I'm not sure if this is helpful or not but I'll give you this as an additional datapoint:
I just ran into this same behavior with Microsoft.ApplicationInsights.TraceListener @ 2.15.0 after adding Microsoft.Configuration.ConfigurationBuilders.Azure @ 2.0.0

I managed to downgrade my Microsoft.ApplicationInsights suite of dependencies and avoid this issues, but I had to go all the way down to 2.2.0. Removing Microsoft.ApplicationInsights.TraceListener entirely allows me to run the rest of the ApplicationInsights packages at 2.17.0

The work-around of enabling "Use Managed Compatibility Mode" causes some projects that use netstandard2.0 in my solution to be unable to be debugged.
This is a huge blocker for my team at present.

I have a minimal reproduction available at 2.2.0, 2.3.0 and 2.15.0 that I can put in a repo if you need a sample for this

@cijothomas
Copy link
Contributor

I have a minimal reproduction available at 2.2.0, 2.3.0 and 2.15.0 that I can put in a repo if you need a sample for this

@gavinbarron Really appreciate it if you can share the minimal repro!

@gavinbarron
Copy link

I have a minimal reproduction available at 2.2.0, 2.3.0 and 2.15.0 that I can put in a repo if you need a sample for this

@gavinbarron Really appreciate it if you can share the minimal repro!

Done: https://github.com/gavinbarron/app-inisghts-issue-reproduction

To make it easier I made branches of various version combinations and the behavior I saw, it's all outlined in the ReadMe on the repo for you.
Hope this helps

@memblin-taurus
Copy link

Any update on this issues? This has been going on for months since Nov 2020 why still no fix?

@argelj289
Copy link

Yeah, also experiencing this issue. Is there any updates on this issue? their provided fix on the other ticket is to remove the tracing listener which is not a real fix. can somebody who manages this take a look on this please?

@argelj289
Copy link

I have a minimal reproduction available at 2.2.0, 2.3.0 and 2.15.0 that I can put in a repo if you need a sample for this

@gavinbarron Really appreciate it if you can share the minimal repro!

Done: https://github.com/gavinbarron/app-inisghts-issue-reproduction

To make it easier I made branches of various version combinations and the behavior I saw, it's all outlined in the ReadMe on the repo for you.
Hope this helps

on this part:

feature/app-insights-2.15.0-no-trace: Removed Microsoft.ApplicationInsights.TraceListener and upgraded System.Diagnostics.DiagnosticSource to 5.0.1 and Visual Studio is able to launch a debugging session.

somebody said it will not call the app insights anymore when removing that part from the config

is it confirm?

@gavinbarron
Copy link

gavinbarron commented May 24, 2021

I'm not exactly sure what you're asking, but the feature/app-insights-2.15.0-no-trace will log requests, dependencies, etc. to App Insights when the ApplicationInsights.config is set up with an <InstrumentationKey>your iKey here</InstrumentationKey> element.
The thing you're giving up with this configuration is the capturing of any Trace logging, e.g. System.Diagnostics.Trace.WriteLine calls which can be a pretty big thing to give up.

Edit to add, thank you though for helping me spot that branch had the wrong AppInsights version, I've pushed an update for that

@logiclabs
Copy link

We found that disabling IntelliTrace seems to prevent this issue in VS 2019 Enterprise.
Hopefully a proper fix is available soon.

@argelj289
Copy link

argelj289 commented Jun 9, 2021

May I know if version 2.13.x also has this issue? Its dependency of pnpcore.

EDIT:
BTW, I enable the compatibility mode in VS and it seems to degrade the build compilation of the app

@faceoffers28
Copy link

This issue just started happening after I moved my App Service to P1V2. I can no longer use Remote Debugging and this issue pops up when I try to debug locally. Since I can't debug, I am totally stuck!

@argelj289
Copy link

any updates here?

@rhyous
Copy link

rhyous commented Jul 7, 2021

Ah . . . so updating System.Diagnostics.DiagnosticSource from 4.7.1 to 5.0.0 was a bad idea!
I see reports from back from November of last year in 2020.
Why has this been a known issue for over 9 months without a fix?

@haldiggs
Copy link

It's not perfect, but disabling IntelliTrace does let the debugger work again, until this gets fixed

@TimothyMothra
Copy link
Member

TimothyMothra commented Jul 20, 2021

Update

VS team has identified an issue and are working on a fix.

Please follow this other issue (dotnet/runtime#55696) to track progress.

@fowl2
Copy link

fowl2 commented Jul 26, 2021

Slightly better than modifying the Visual Studio setting on each machine is to add the following to affected projects:

        <!-- Enable "Managed Compatibility Mode" to work around debugger incompatibility with Application Insights.
             see https://devblogs.microsoft.com/devops/switching-to-managed-compatibility-mode-in-visual-studio-2013/ 
             and https://github.com/microsoft/ApplicationInsights-dotnet/issues/2161 
            -->
        <DebugEngines>{351668CC-8477-4fbf-BFE3-5F1006E4DB1F}</DebugEngines>

reference: Switching to Managed Compatibility Mode in Visual Studio 2013 | Azure DevOps Blog

@argelj289
Copy link

Any update from the owner of app insights?

@cijothomas
Copy link
Contributor

Any update from the owner of app insights?

#2161 (comment) Please see this comment.

@TimothyMothra
Copy link
Member

Update from the VS team

This issue has been fixed. It will be released with VS 2022, Preview 4. If there is a large need to have it in VS 2019, we can see about back porting the fix. Let us know.

@TimothyMothra
Copy link
Member

Update from the VS team

OK, we have fixed the issue in VS 2019 as well, version 16.11.2. It should be released in the next month or two as our servicing releases come out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests