Mika June 8th, 2021 The .NET Productivity team (aka. Roslyn) continues to enhance your developer productivity with the latest tooling updates in Visual Studio 2019. In the last release, we listened to your feedback and have been hard at work improving the .NET developer experience. To try out the latest .NET productivity enhancements download the latest Visual Studio release. Download Visual Studio 2019Tooling improvements The feature that I’m most excited about is Inheritance margin. Inheritance mar...
In the last two posts, I’ve described 14 different code smells related to the async/await keywords. Beside the problem description, I’ve also provided info about code analyzers that can detect and report given issue. Those analyzers come from a few different packages that are not strictly devoted to the asynchronous programming area. They also contain rules from other fields with predefined severity, which might not be appropriate to your needs, or you might not be interested in enforcing them at all. Th...
Which analyzer package should I use and how to configure it to avoid most common problems related to async/await.
Sztuka programowania 1531 dni, 5 godzin, 11 minut temu 70 źrodło rozwiń
How to keep two different types in synchronization using roslyn analyzers.
How to improve developer's experience while working with non-nullable references
Sztuka programowania 1732 dni, 4 godziny, 5 minut temu 66 źrodło rozwiń
How to create immutable types without writing a large amount of boilerplate code.
Sztuka programowania 1741 dni, 4 godziny, 20 minut temu 90 źrodło rozwiń
In this blog post, I’m going to describe how to create a tool for generating code during the build process and how I used it to create auto-synchronizing mapping classes.
This blog post continues the series "Avoid thread synchronization problems with Roslyn" and this part is about the traps related to the usage of synchronization primitives.
How I built a very simple macro system for C# that works right in the code editor
I've decided to create a series of blog posts where I will present what I've recently learned about the traps related to the multithreading in C#. I will also show you my proposition of Roslyn analyzers that can possibly help to avoid those issues right at the stage of writing the code. This part is about choosing a suitable object for locking.
Sztuka programowania 1951 dni, 4 godziny, 54 minuty temu 65 źrodło rozwiń
How to avoid common mocking issues and save a lot of typing with the help of Roslyn.
Over a year ago I wrote a blog post about designing exceptions. I found this article very useful by myself and I used it as a reference a few times during code review. However, it’s almost impossible to expect that, after reading the recommended resource, anybody would start to apply described rules immediately and remember about them all the time.
Sztuka programowania 2000 dni, 5 godzin, 17 minut temu 91 źrodło rozwiń
When we started PlatformX project, we were using full .NET Framework. Then we migrated to .NET Core. Despite many advantages this migration meant a problem with using Roslyn. This problem is called MsBuildWorkspace...
Sztuka programowania 2403 dni, 5 godzin, 55 minut temu 94 źrodło rozwiń
A few weeks ago I posted about negative aspects of applying AutoMapper. As an alternative I suggested typing all mapping code by hand or utilize some kind of generator like T4Scaffoling or something Roslyn based. In the past I experimented with T4Scaffoling but it was quite tedious. It requires preparation of templates in T4 syntax, referencing it to the project and writing some PowerShell code to provide data for templates. There also was an issue with assembly locking. Then I tried to generate code wit...
A while ago 2 of my SpecFlow tests started failing on the build server. At the same time, on a few local machines no problems were observed. I also didn't find any exceptions in the log, so I decided to log into the server and debug a problem there. Quite soon I figured out that the problem is in the algorithm that uses Roslyn to analyse and understand the code...
Sztuka programowania 2683 dni, 2 godziny, 6 minut temu 48 źrodło rozwiń
I can’t be the only person who hates waiting for the code to compile and run… Especially when I want to test only a small part of it! That’s a total waste of time! But good news everyone, I found a way to run a part of my C# code without building the whole project!Ctrl + E, E – the magical shortcut!
My last 2 posts were about problems with using Roslyn. Nonetheless, even if I sometime hate it, I'm still using it so the time has come to show some practical example of using Roslyn. Recently, I've been working on the task that can be summed up as: Take this ugly code and do something with it. i.e. more or less the refactoring task...
Sztuka programowania 2797 dni, 15 godzin, 51 minut temu 173 źrodło rozwiń
In my previous post I wrote about my problem with "empty" projects and Roslyn. The symptom was that in some cases according to Roslyn my C# projects didn't contain any files. For quite a long time, I haven't been able to find a solution. Especially because I couldn't reproduce problem on my local machine. Fortunately, today I noticed exactly the same problem on another computer.
Sztuka programowania 2809 dni, 4 godziny, 35 minut temu 51 źrodło rozwiń
Recently at work I’ve been looking into migrating our projects from VS2013 to VS2017. As part of the process we decided to move from C# 5.0 to C# 7.0. It turned out that after the switch some of our projects won’t build anymore. I spent some time investigating the issue and found the outcome interesting so let me share my story with you.
Sztuka programowania 2809 dni, 4 godziny, 35 minut temu 65 źrodło rozwiń
The more I work with Roslyn the more I appreciate the possibilities it gives and the more I hate it. And I hate it for the same thing as many other projects I worked with in the past. What is it? Well, I like when a system fails fast, fails loudly and fails in the clear way. Unfortunately, Roslyn can do something completely different what sometimes makes working with it the pain in ass. I'll give you some examples.
Sztuka programowania 2821 dni, 3 godziny, 57 minut temu 89 źrodło rozwiń