0

I was working on the "TraceSource Class" example provided by Microsoft at https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.tracesource?view=net-6.0

When I create a standard .NET applicaion, the project works fine, however, when I create a .net Core application, the sample does not work! It compiles but crashes at some point.

I was thinking the reason is about how these types of projects treat the config files. Because I think the standrad .NET considered the config files, but .NET Core did not automatically applied the configurations.

I would be thankful if anyone can help me with this issue.

I tried

https://learn.microsoft.com/en-us/dotnet/framework/debug-trace-profile/how-to-create-and-initialize-trace-sources

and

https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.tracesource?view=net-6.0

Altay
  • 9
  • 1
  • In a new ".Net Core "ASP.Net Core Web app" you would get the new `appsettings.json` config file type instead of a classic app.config. In a new "WPF Application" or a "Windows Forms App" project you can open the project properties Window -> go to "Settings at the bottom and "Create or open application settings" – Stefan Wuebbe Nov 07 '22 at 14:23
  • See also https://stackoverflow.com/questions/56847571/equivalent-to-usersettings-applicationsettings-in-wpf-net-5-net-6-or-net-c – Stefan Wuebbe Nov 07 '22 at 14:27
  • And https://stackoverflow.com/questions/59909207/cannot-add-appsettings-json-inside-wpf-project-net-core-3-0 – Stefan Wuebbe Nov 07 '22 at 14:35

0 Answers0