Showing posts with label .NET 6. Show all posts
Showing posts with label .NET 6. Show all posts

Saturday, 1 April 2023

Resolve Windows Docker Build "C:\Program Files\dotnet\sdk\6.0.407\Microsoft.Common.CurrentVersion.targets(3262,5): error MSB4018: System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {7Bxxxxxxxxxxxx} failed due to the following error: 80040154 Class not registered (0x80040154 (REGDB_E_CLASSNOTREG))"

 Building .NET 6 project with Resource files is running into build issue as shown below, when building with .NET 6 nanoserver build images.

C:\Program Files\dotnet\sdk\6.0.407\Microsoft.Common.CurrentVersion.targets(3262,5): error MSB4018: The "GenerateResource" task failed unexpectedly. [C:\src\Demo\Demo.csproj]

C:\Program Files\dotnet\sdk\6.0.407\Microsoft.Common.CurrentVersion.targets(3262,5): error MSB4018: System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {7Bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} failed due to the following error: 80040154 Class not registered (0x80040154 (REGDB_E_CLASSNOTREG)). [C:\src\Demo\Demo.csproj]

Saturday, 30 July 2022

Log All Requests in ASP.NET Core API

Logging all incoming requests and the respose returned data in an API are useful way to diagnose any issues and monitor requests to an API. You can easily enable request logging in AP.NET Core 6 APIs, by setting the log level in app settings. Enabling such request reponse data logging will be useful in containerized APIs deployed to Kubernetes or even for APIs deployed to AzureApp Services  to diagnose and monitoring purposes. Let's look at how to enable request logging.

Saturday, 2 July 2022

Enable Swagger UI with an .NET 6 API having Custom Routing

 In .NET APIs using swagger for API documentation is really useful to perform API testing and to describe API. We may need to set custom API routing, specially when w deploy the APIs as contianers to Kubernetes, to enable path based routing using ingress such as Nginx. Let's look at steps of setting up custom routing and getting swagger to work with custom routing using a .NET 6 API.

Popular Posts