.NET

1548 readers
6 users here now

Getting started

Useful resources

IDEs and code editors

Tools

Rules

Related communities

Wikipedia pages

founded 2 years ago
MODERATORS
1
2
3
4
 
 

Extract to Component refactoring and the new Roslyn-based C# tokenizer are now available

This new tokenizer is not on by default until .NET 10 but is available in both Visual Studio (17.13) and Visual Studio Code for .NET 9.

To enable the C# tokenizer today, check the Use the C# tokenizer for Razor files in the IDE option under Tools > Options > Preview Features and add <Features>use-roslyn-tokenizer;$(Features)</Features> to a property group in your .csproj or directory.props file

This new lexer does currently come with some breaking changes, particularly around preprocessor directives

5
6
7
8
 
 

Whether you are using Expecto, MSTest, NUnit, TUnit, or xUnit.net, you can now leverage the new testing platform to run your tests.

In this post, we’ll highlight the test frameworks that have embraced Microsoft.Testing.Platform, share their unique characteristics, and provide resources for getting started.

9
10
11
12
13
 
 

Channels

14
6
submitted 1 week ago by Kissaki to c/dotnet
 
 

This year, we are introducing updates in the HTTP space, new HttpClientFactory APIs, .NET Framework compatibility improvements, and more.

15
 
 

This post only applies if you’re using ASP.NET Core on .NET Framework.

ASP.NET Core users on .NET Framework should update to the latest ASP.NET Core 2.3 release to stay in support. This update enables ASP.NET Core 2.2 users to update to a supported version by doing a NuGet package upgrade instead of a downgrade. ASP.NET Core 2.1 users updating to ASP.NET Core 2.3 should experience no change in behavior as the packages contain the exact same code. ASP.NET Core 2.2 users may need to remove any dependencies on ASP.NET Core 2.2 specific changes. Any future servicing fixes for ASP.NET Core on .NET Framework will be based on ASP.NET Core 2.3.

Microsoft making changes for something five years out of support (the 2.2 version).

lol at every instance of ASP.NET becoming a link here

16
17
18
19
20
21
 
 

I'm a bit confused whether I'm doing this right because every resource I google for has a different way of setting it up.

Some of them initialize the dbContext right in the test class, some do in the WebAppFactory's ConfigureServices (or is it ConfigureTestServices?).

Some do it in the IAsyncLifetime's InitializeAsync, some do it as a dependency injection and other examples just put it as a member variable in the factory.

I don't wanna code dump my project here and ask for someone to solve it but I am not sure anymore what to do. My current attempt is using an sqlite database and it is breaking when I try to run all the tests at the same time due to this.

Makes sense since they are all using the same db in this case so I tried following a guide and just letting them use the :memory: one but that one, for some reason, doesn't seem to initialize the database at all and tests fail because the database doesn't have any tables.

I also added a CollectionDefinition with an ICollectionFixture for each individual test class (one per controller so far) thinking this might cause each test to have its own separate database (or factory?) but that didn't really do anything.

I'm hoping someone experienced can probably immediately recognize what am I missing, or at the very least give me a solid resource that I could read to figure this out, but any help is appreciated.

22
23
24
25
view more: next ›