C# tricks – Debugging Complex Classes with the [DebuggerDisplay] Attribute

Debugging complex trees of objects can be difficult even with great debugging tools. In order to make it easier on yourself, consider adding the DebuggerDisplay attribute to those difficult-to-debug classes. DebuggerDisplay allows you to provide a view of your object in the Visual Studio debugger windows that have exactly the data you need to see in order to fix your problems.
vslive.com/Blogs/News-and-Tips/2024/10/Debugging-Complex-Classes-with-the-DebuggerDisplay-Attribute.aspx

How to debug Angular component test Dependency Injection chain

When running ng test (Angular component testing) and you get this type of error:

[Service1 -> Service2 -> Service3]: NullInjectorError: No provider for Service3!

And you dont really understand which component, service or directive that is starting this DI chain. Here is a way to debug and hopefully find the source of the problem:

In Edge/Chrome: when in karma runner page, open devtools (f12), on source tab, select both “Pause on uncaught/caught exceptions”

Reload the test, step into a few times, you should be able to get the call stack as in picture above. Here we can deduce that DI chain starts with a component html template, which uses a translate directive in markup, which calls DictionaryService which calls UserAppDataQueryService which calls AuthenticationService.

Tip: run all spec files below a certain folder like this:

ng test --include "src/app/myarea/**/*.spec.ts" --browsers=Edge

Tip2: run a single spec file:

ng test --include "src/app/myarea/**/mytest.component.spec.ts" --browsers=Edge

 

First Official OpenAI Library for .NET Goes Beta — Visual Studio Magazine

Although it seems Microsoft and OpenAI have been deeply intertwined partners for a long time, they are only now getting around to releasing an official OpenAI library for .NET developers, joining existing community libraries.

The first beta of the effort is an OpenAI NuGet package supporting .NET 6 and .NET Standard 2.0, now at version 2.0.0-beta.2 and listing some 868,000 downloads.

visualstudiomagazine.com/Articles/2024/06/07/openai-net.aspx

Angular and Wiz Are Better Together

You may know Angular as the web framework from Google, but Google actually has another web framework: Wiz. Both Angular and Wiz are used by thousands of engineers and thousands of apps inside of Google. Wiz is an internal framework that is used by some of the most popular Google products such as SearchPhotosPayments and many others. Over the last year we’ve been exploring ways for Angular to benefit from the performance of Wiz and Wiz to benefit from the developer experience of Angular.

Welcome to Pathways – Your first step toward developing for Apple platforms

Welcome to Pathways Your first step toward developing for Apple platforms. Pathways are simple and easy-to-navigate collections of the videos, documentation, and resources you’ll need to start building great apps and games. They’re the perfect place to begin your Apple developer journey — all you need is a Mac and an idea.
developer.apple.com/pathways/

.NET Managing Dependencies in Your Codebase: Top Tools and Best Practices

As software projects get more complex, managing dependencies becomes an increasingly critical task for developers. Dependencies, the external packages or libraries that your project relies on, can significantly impact your application’s security, maintainability and compatibility. This is particularly true in the .NET ecosystem, where projects often rely on a vast array of NuGet packages.
vslive.com/Blogs/News-and-Tips/2024/03/Managing-Dependencies.aspx?oly_enc_id=5912A0582689D0Y

CSS Selectors: A Visual Guide & Reference | fffuel

CSS Selectors: A Visual Guide ✨ Here’s a visual guide to the most popular CSS selectors. CSS selectors are patterns used in CSS to select and style HTML elements on a page, allowing us to dictate how styles apply to specific HTML elements. Along with traditional CSS selectors, we also have pseudo-classes and pseudo-elements. Great resource even for seasoned css selector wizards!
fffuel.co/css-selectors/