AspNetCoreDiagnosticScenarios icon indicating copy to clipboard operation
AspNetCoreDiagnosticScenarios copied to clipboard

This repository has examples of broken patterns in ASP.NET Core applications

Results 34 AspNetCoreDiagnosticScenarios issues
Sort by recently updated
recently updated
newest added

There's a note regarding avoidance of `TaskCreationOptions.LongRunning`: >💡 NOTE:`Task.Factory.StartNew` has an option `TaskCreationOptions.LongRunning` that under the covers creates a new thread and returns a Task that represents the execution. Using...

Hi @davidfowl, Trying to get rid of Task.Result in our code and follow your approach in [AsyncGuidance.md#concurrentdictionarygetoradd](https://github.com/davidfowl/AspNetCoreDiagnosticScenarios/blob/master/AsyncGuidance.md#concurrentdictionarygetoradd) by storing the Task instead of the actual value. In our tests, it...

Hi, maybe this is worth mentioning. Basically, the `FileOptions.Asynchronous` flag should be passed when creating a `FileStream` (e.g. with `File.Create`), otherwise the actual I/O operations are performed synchronously. [More info](https://docs.microsoft.com/en-us/dotnet/api/system.io.filestream?redirectedfrom=MSDN&view=netframework-4.7.2#remarks).

I know that this Repo is dedicated to AspNet core but which TaskCreationOptions should i take for .net versions below 4.6? In .Net 4.5, TaskCreationOptions.RunContinuationsAsynchronously does not exist.

@davidfowl, [Constructors](https://github.com/davidfowl/AspNetCoreDiagnosticScenarios/blob/master/AsyncGuidance.md#constructors) section explains getting around by using static factory pattern. But, what happens when I cannot call this static method to create an instance because the instance is created...

Great repo David. Any best practice about `ConfigureAwai(false)`? When is good to use it and when is not?ù Thanks

In the AsyncGuidance document, there's a section that states that [`async/await` is preferred over directly returning `Task`](https://github.com/davidfowl/AspNetCoreDiagnosticScenarios/blob/master/AsyncGuidance.md#prefer-asyncawait-over-directly-returning-task). In his talk [Correcting Common Async/Await Mistakes in .NET](https://youtu.be/J0mcYVxJEl0), Brandon Minnick advises to...

As discussed on twitter, I'm opening this issue about covering the usage of EF Query Async operations. > Is it wise to say that we should always use Async methods...

There are legacy classes that use events and that need to use new async calls in their handlers. What is the suggested way of running async calls synchronously there?

Arrived to this great repository after watching your great talk on scalability on youtube. The situation here: https://github.com/davidfowl/AspNetCoreDiagnosticScenarios/blob/master/AsyncGuidance.md#avoid-using-taskrun-for-long-running-work-that-blocks-the-thread is relevant for us (we have ~10 such workers which keep synchronizing...