Image Analysis in ASP.NET Core 5.0 using Azure Cognitive Service

Background Azure’s computer vision services give wide range of options to do image analysis. These AI services enable to discover the content and analyze images and videos in real time. Using computer vision which is a part of azure cognitive services, we can do image processing to label content with objects, moderate content, identify objects in image, extract text, generate details descriptions of the image, … Continue reading Image Analysis in ASP.NET Core 5.0 using Azure Cognitive Service

Upload Single or Multiple Files in ASP.NET Core Razor Pages with Insights

In this article, I will explain some file upload insights and show how to upload single or multiples in app.net razor pages application. I will cover following points: File Upload approaches: Buffering and Streaming File upload security concerns File Upload Storage options Upload Single File in asp.net core razor pages   Upload Multiple files Storing files in physical storage and database Source Code >> GitHub … Continue reading Upload Single or Multiple Files in ASP.NET Core Razor Pages with Insights

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

ASP.NET Error: The entry ‘DefaultConnection’ has already been added. (C:\..\web.config line ..)

Recently, we were facing this error while deploying the asp.net solution into server (IIS) as a separate application (Sub Domain) in a main web application. Scenario I created a website ( say site mymainsite ) in window server IIS under a port and then added an another application ( plugin ) under a root-site ( mymainsite ) as shown: After deploying the solution, when I … Continue reading ASP.NET Error: The entry ‘DefaultConnection’ has already been added. (C:\..\web.config line ..)

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

Failed to register URL “http://localhost:XXXX/” for site “..” application “/”. Error description: The process cannot access the file because it is being used by another process. (0x80070020)

Error: Failed to register URL “http://localhost:XXXX/” for site “SITE NAME” application “/”. Error description: The process cannot access the file because it is being used by another process. (0x80070020) **XXXX = port number Reason for this error: This error happens to me because I was using same solution for different project. I copied the solution and created another one in different location. I have done … Continue reading Failed to register URL “http://localhost:XXXX/” for site “..” application “/”. Error description: The process cannot access the file because it is being used by another process. (0x80070020)

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

Passing Data from Controller Action Method to View in ASP.NET Core

We can pass the Data from Controller to View in 2 ways. 1. ViewData Example for Single value data Action Controller Code To show it in the View, we can write @ViewData[“Key”] View Code Controller Action Code Then, in View we need to set the value of ViewData[“ListItems”] as the collection of integer list. View Code 2. ViewBag  ViewBag is easier and simple way. It … Continue reading Passing Data from Controller Action Method to View in ASP.NET Core