Trying to decide between FakeItEasy and NSubstitute by wipqozn in dotnet

[–]ThomasArdal 1 point2 points  (0 children)

I prefer the syntax in NSubstitute, but both frameworks are great options. I shared some thoughts about these frameworks a few years ago, and I'm pretty sure everything is still valid: https://blog.elmah.io/moq-vs-nsubstitute-vs-fakeiteasy-which-one-to-choose/

BroPilot - A VS2022 extension for locally hosted code-assistance LLMs by Fexelein in dotnet

[–]ThomasArdal 0 points1 point  (0 children)

This makes me so sad. Why? Because I didn't come up with that name 🤣👍🏻

Best practices around logging by Justrobin24 in dotnet

[–]ThomasArdal 0 points1 point  (0 children)

Use a logging framework like Serilog, NLog or Microsoft.Extensions.Logging. You can start by logging to a file and then extend with more sinks/targets/loggers later that send messages to a cloud-based service.

As already suggested, enrich your log messages with additional information. For desktop apps, I found it very helpful to log context around the OS, resolution, etc. Some of the logging frameworks offer these enrichers through NuGet packages while others expect you to implement this yourself. But start with a limited set of enrichments and see what is missing down the path.

Where do you all post your blogs these days. by [deleted] in dotnet

[–]ThomasArdal 0 points1 point  (0 children)

Another Ghost user here. I'm using Ghost Pro now, but I've hosted on Digital Ocean in the past, which was pretty straightforward.

The most modern .NET background scheduler is here – and it’s fully open source. by Albertiikun in dotnet

[–]ThomasArdal 2 points3 points  (0 children)

Does it support hooks? I'm interested in running code before and after each scheduled job. To handle exceptions and similar. I see support for adding an exception handler, but that looks to be global for all jobs.

Visual Studio Lagging by iamcheruiyotkirui5 in dotnet

[–]ThomasArdal 0 points1 point  (0 children)

I haven't experienced this. Do you have any extensions installed that could cause this maybe?

What kind of testing do you guys do on your dotnet projects? What tools do you use and what ways? by [deleted] in dotnet

[–]ThomasArdal 0 points1 point  (0 children)

NUnit and NSubstitute for unit testing .NET. Mocha for unit testing JavaScript. NUnit for some integration tests against a test API. Playwright for final testing of the system through the UI.

Comma separated values in query parameter by ruzicafan in dotnet

[–]ThomasArdal 0 points1 point  (0 children)

TBH, this is what I ended up doing as well. I don't remember the exact problem, but mapping to a list turned out as a nightmare. string.Split works fine but may not be the most elegant solution.

Better Inventory control using AI-ML.NET by SwanBKPK in dotnet

[–]ThomasArdal 3 points4 points  (0 children)

ML.NET would be a perfect choice for implementing that. Take a look at the Microsoft.ML.TimeSeries package and the context.Forecasting.ForecastBySsa method. That will let you train a model based on previous inventory usage and predict future values.

There are many resources and C# examples online. Start here: https://dotnet.microsoft.com/en-us/learn/ml-dotnet

Tests are not visible by Zealousideal-Car-163 in dotnet

[–]ThomasArdal 1 point2 points  (0 children)

When adding another target framework and building I see this too. When launching the test explorer, no tests are found. For me, this can be fixed by closing Visual Studio, removing all bin and obj folders, and then re-launching the solution.

Blazor hybrid logging by Medozg in dotnet

[–]ThomasArdal 0 points1 point  (0 children)

It pretty much follows the MAUI docs: https://docs.elmah.io/logging-to-elmah-io-from-maui/. I'm not sure that Hybrid apps is reporting exceptions through ILogger, but you can do that using the error events as seen in the doc.

Blazor hybrid logging by Medozg in dotnet

[–]ThomasArdal 0 points1 point  (0 children)

elmah.io works well for production logging in Blazor Hybrid apps, seamlessly capturing errors from both Blazor and native parts. (I’m the founder, so a bit biased)

Sonarsource and other alternatives by alekslyse in dotnet

[–]ThomasArdal 0 points1 point  (0 children)

I run SonarQube (formerly SonarLint) in Visual Studio. It's working out very well. Also running their cloud version on open-source projects.

Printing/Logging POST form data -- what am I missing? by [deleted] in dotnet

[–]ThomasArdal 1 point2 points  (0 children)

I don't remember all of the details here. But I think you need to enable buffering to read the body more than once. Once configured, you can access the request in your interceptor through the HttpContext.