Posts

Showing posts with the label .NET Core

Debugging information and visual studio

Image
Without debugging information there is no debugging. By default debugging information is included when you build your project with the Debug configuration. Configuring debug information When you create a new project with .NET , Visual Studio provides two default build configurations in your project. Debug and Release . A solution build configration defines which projects are built and deployed for which target platform ( x86 , x64 or Any CPU ) although the platform can be overwritten by the project build configuration. The solution file ( .sln ) holds the values you configured. A project build configuration can define anything you can configure in the project file ( .csproj ). But they are mainly used to configure the target platform, if the output should include debugging information and if the complier should optimize the code. When debugging information is included the default ( Portable for .NET Core and Pdb-only for .NET ) is that a seperate symbol file is beeing create...

Components of Tasks & Threading in .NET

Image
I recommend understanding the basics of async and await before you read this article. This is a good introduction from Stephen Cleary. As you might know simply using async and await doesn't mean your code is executed on different threads. To achieve this you must use Task.Run , TaskFactory.StartNew or the Task Parallel Library . This is an introduction in the different components at play when you want to schedule tasks on different threads. TaskFactory The TaskFactory is a simple container where you can configure options for the creation and continuation of Tasks. Furthermore you can specify an canncelation Token which will be used by all Tasks created through this factory. And lastly you can define your own TaskScheduler. It's your choise if you want to use a TaskFactory to start a new task or if you want to start a task directly trough Task.Run. MSDN TaskFactory TaskScheduler The TaskScheduler is responsible to run the next task on the correct ...