Migrating ASP.NET CORE PROJECT.JSON TO CS.PROJ USING VISUAL STUDIO 2017 STEP BY STEP

Hello, folks today I am going to migrate one of my projects called Know Your Mentor which was built in ASP.NET Core Project.json. As now Microsoft has moved towards old csproj extension which is Visual Studio .NET C# Project file extension.

You can read more about csproj structure in below-mentioned URL:

This article will be purely on migrating the application and not about project insights. so Let’s get started step by step.

Step 1: Open Visual Studio 2017
Step 2: Keep a back of your Source code. If anything goes wrong you will still have the original source code.

I am following Migrating .NET Core projects to the .csproj format article to step by step migrate my application. Let’s to migrate the same.

I hope before moving ahead ensure that you have followed above step because now the actual story starts.

Open Your Project

1

You will get a dialog box prompting the project is either not supported and Visual Studio will automatically make changes, Accept the message and Click Okay.

2

So Visual Studio has migrated Project.json to CsProj easily. Let’s now actually compile the application which is the most important part because until and unless it doesn’t successfully compile it’s of no use.

2

Before compiling let me check where all my dependencies which were present in Project.json was gone? Answer is in csProj

Let’s check CsProj file now and the dependencies which were present in Project.json before.

4

3

Now let’s compile the project first.

Compile

We can clearly see the project has been successfully compiled. Let’s try and run the application.

Let’s run our application now

3

And here comes error

error

Compile

In order to resolve this issue, I googled an tried deleting obj and bin files. But after doing the same the website didn’t start. So I just restarted the application and ran Visual Studio with admin rights and then ran the application. It simply worked.

Success

Success2
We have successfully migrated our project.json to csproj. I have heard lots of people facing lot’s of the issue while migrating depending upon the application and dependencies it might have made migration a humongous task.

I hope this article would be helpful to migrate your application to csproj known as MSBuild as well. If you want to start learning ASP.NET CORE you can start from here.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: