How to stop Visual Studio console trace output

Jim Thomas 41 Reputation points
2021-01-06T19:44:36.683+00:00

I have a small console solution with four C# projects using Visual Studio 2019. When it runs it should print 5 lines to the console. But I get hundreds, if not thousands, of trace statements, in both debug and release mode. I have pasted the first couple dozen below but they go on and on. Been using VS2019 for years, and previous versions, but have never seen this trace output before.

I do notice that when I bring up the Project Properties the 'Define TRACE constant' is set. I did not set it. Furthermore when I look at the .csproj file it does NOT have a TRACE constant defined either. Is this bug generating all that trace output and if so how do I get that checkbox for 'Define TRACE constant' to be off? Unchecking it does not work and making sure it is not in the .csproj file obviously does not turn it off either.

I have deleted my bin folder completely, cleaned the project and rebuilt but the trace remains. I have also tried setting the DEBUG constant which seems to have some effect on turning off the TRACE constant but, regardless, all the trace output persists. Curiously I have another VS2019 installed on a different computer and running the exact same project does NOT show all that trace output! That other computer has 'Define TRACE constant' set so maybe I'm barking up the wrong tree here and this is some global setting associated with Visual Studio itself and not the project.


Tracing enabled @ Wed Jan 6 19:20:28 2021 GMT
--- Invoked apphost [version: 3.1.5, commit hash: 65cd7897774a464b5991c1962f7a0d476bb63101] main = {
E:\ESC_VS\CDEstatus\bin\Debug\netcoreapp3.1\StatusCheck.exe
}
Redirecting errors to custom writer.
The managed DLL bound to this executable is: 'StatusCheck.dll'
Using global installation location [C:\Program Files\dotnet] as runtime location.
Reading fx resolver directory=[C:\Program Files\dotnet\host\fxr]
Considering fxr version=[2.1.4]...
Considering fxr version=[3.1.4]...
Considering fxr version=[3.1.5]...
Detected latest fxr version=[C:\Program Files\dotnet\host\fxr\3.1.5]...
Resolved fxr [C:\Program Files\dotnet\host\fxr\3.1.5\hostfxr.dll]...
Loaded library from C:\Program Files\dotnet\host\fxr\3.1.5\hostfxr.dll
Invoking fx resolver [C:\Program Files\dotnet\host\fxr\3.1.5\hostfxr.dll] v2
Host path: [E:\ESC_VS\CDEstatus\bin\Debug\netcoreapp3.1\StatusCheck.exe]
Dotnet path: [C:\Program Files\dotnet]
App path: [E:\ESC_VS\CDEstatus\bin\Debug\netcoreapp3.1\StatusCheck.dll]
Tracing enabled @ Wed Jan 6 19:20:28 2021 GMT
--- Invoked hostfxr_main_startupinfo [commit hash: 65cd7897774a464b5991c1962f7a0d476bb63101]
Checking if CoreCLR path exists=[C:\Program Files\dotnet\coreclr.dll]
--- Executing in a native executable mode...
Using dotnet root path [C:\Program Files\dotnet]
App runtimeconfig.json from [E:\ESC_VS\CDEstatus\bin\Debug\netcoreapp3.1\StatusCheck.dll]
Runtime config is cfg=E:\ESC_VS\CDEstatus\bin\Debug\netcoreapp3.1\StatusCheck.runtimeconfig.json dev=E:\ESC_VS\CDEstat

Developer technologies Visual Studio Debugging
0 comments No comments
{count} votes

Accepted answer
  1. Dylan Zhu-MSFT 6,426 Reputation points
    2021-01-07T03:11:04.903+00:00

    Hi JimThomas,

    There seem to be a third-party tool installed on your machine. Is the StatusCheck.exe your output file?

    Please go to Control Panel > Add/Remove programs, then check and uninstall the associated program.

    Best Regards, Dylan

    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our * *documentation* to enable e-mail notifications if you want to receive the related email notification for this thread.**


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.