Unable to resolve service for type ‘Swashbuckle.AspNetCore.Swagger.ISwaggerProvider’

Recently, one of my team member faced this error while implementing swagger in asp.net core. Environment Details: Visual Studio 2019 ASP.NET Core 3.1 Swashbuckle.AspNetCore 5.6.3 Error: Unable to resolve service for type ‘Swashbuckle.AspNetCore.Swagger.ISwaggerProvider’ while attempting to Invoke middleware ‘Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware Issue was with swagger generator. Swagger generator was not call or registered in container services of startup file. Below code: (startup.cs file) add services.AddSwaggerGen(); Additionally, You … Continue reading Unable to resolve service for type ‘Swashbuckle.AspNetCore.Swagger.ISwaggerProvider’

How to Compare Two Databases, find differences and update using Visual Studio

In this article, we are going to learn how to compare two databases using SQL Server Database Project (Template) available in Visual Studio. I will cover the following points: Introduction of SQL Server Database Project. Connect two databases: source and target. Compare and identify differences among the two databases. Update or generate script to update the target database.  In the last article, we learned how … Continue reading How to Compare Two Databases, find differences and update using Visual Studio

Deployment of ASP.NET Core 5.0 Application in Windows Server IIS

Introduction Still several banks, corporate companies, enterprise businesses prefer to use Windows Server. Besides this, those organizations choose server-based application for their businesses due to various reasons. This article will describe a method with necessary steps to deploy ASP.NET Core Application in Windows Server IIS from scratch. In this article, we will learn to create application in ASP.NET Core, publish it and deploy it in … Continue reading Deployment of ASP.NET Core 5.0 Application in Windows Server IIS

When to use .NET Framework and .NET Core

Introduction This write up will describe differences and when to use .NET Framework and .NET Core shortly. This will help reader to understand and use it in proper situation. What is .NET Core? It is open source cross platform to develop application which runs on Windows, Linux, and Mac OS. Latest Version 3.0. This is the much-improved version of .NET core as of now. .NET … Continue reading When to use .NET Framework and .NET Core

Assets file project.assets.json not found. Run a NuGet package restore to generate this file

Actual Error: Assets file project.assets.json not found. Run a NuGet package restore to generate this file. ‘..\sdk\3.1.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets’ The error occurs because the dotnet cli does not create the all of the required files initially. To fix this error from Tools > NuGet Package Manager > Package Manager Console simply run: Doing dotnet restore adds the required files. In case when ‘dotnet restore’ not works, following … Continue reading Assets file project.assets.json not found. Run a NuGet package restore to generate this file

Add-Migration : The term ‘Add-Migration’ is not recognized

Details error: Solution Simply, install Microsoft.EntityFrameworkCore.Tools package from nuget: Install-Package Microsoft.EntityFrameworkCore.Tools -Version 3.1.6 You can also use this link to install the latest version: Nuget package link Tips: Install latest stable version. Sometimes, the error persists because of cache, so restart can solve the issue without doing anything. Continue reading Add-Migration : The term ‘Add-Migration’ is not recognized

Create a Database View using Entity Framework (EF) Code First Approach

How to create a database view using Entity Framework Code first approach? User case scenario: There are several cases that the aplications may need to display the data by combiniting two or more tables, sometimes even more than 7-8 tables. In such scenario, using entity framework may results in slow performance beacause we need to process by selecting data from a table then running loop … Continue reading Create a Database View using Entity Framework (EF) Code First Approach

How to Create SQL Server Database Project With Visual Studio

In this article, we are going to learn about SQL Server Database Project (Template) available in Visual Studio. I will cover the following points, Introduction of SQL Server Database Project. Create New SQL Server Database Project. Import database schema from an existing database, a .sql script file or a Data-tier application (.bacpac) the Project. Publish to create new Database in SQL server. The database plays … Continue reading How to Create SQL Server Database Project With Visual Studio

Change the Domain URL or Redirect URL based on Country or IP

There can be some requirements that redirect the page or may be block the access of some section or some part of website based on country. There can be some situation that you may need to change some contents based on country. Requirement: 1. To find the country when website is opened or find the country from IP address. Solution: This requirement can be catered … Continue reading Change the Domain URL or Redirect URL based on Country or IP