Migrate ASP.NET Core Projects – VS2015 to VS2017 and TFS2015 to TFS2017 Issues and Fixes

access_time 4 years ago visibility706 comment 0

Context

Before Visual Studio 2017 was released, I was implementing my ASP.NET Core project using VS2015. TFS2015 is used for Continuous Build and Deployment for my projects.

After migrating to VS2017, there are couple of issues I encountered in my environment:

  • VS2017 has abounded the JSON project file format.
  • Dotcore tools’ versions in Visual Studio Team Service are different in different agents.

This page summarizes the steps you need to do to resolve these issues.

Hosted VS2017 Agent

Based on the following documentation, you need to use Hosted VS2017 agent for VS2017 projects build since the project file format is now different:

https://www.visualstudio.com/en-au/docs/build/steps/build/msbuild 

Team Services and Team Foundation Server 2017: If your team uses Visual Studio 2017 and you want to use our hosted agents, make sure you select as your default queue the Hosted VS2017. See Hosted agents.image

If you don’t do this, the dotnet core CLI will still look for project.json files, which can lead to errors like the following:

Couldn't find 'project.json' in 'C:\a\1\s\src\****’

dotnet core CLI changes

Previously, you can run dotnet core commands using folder path as argument.

dotnet restore $foldername

However, with VS2017, you can specify the actual project file name:

dotnet restore  src\mywebsite.csproj

Otherwise you may meet the following issue:

warn : The folder 'C:\a\1\s\src' does not contain a project to restore.

Further more, you may encounter many related compiling issues as all the packages referenced are not restored successfully.

Program.cs(10,18): error CS0518: Predefined type 'System.Object' is not defined or imported …

info Last modified by Raymond at 3 months ago copyright This page is subject to Site terms.
Like this article?
Share on

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

Want to publish your article on Kontext?

Learn more

Kontext Column

Created for everyone to publish data, programming and cloud related articles.
Follow three steps to create your columns.


Learn more arrow_forward

More from Kontext

local_offer dotnetcore

visibility 1448
thumb_up 0
access_time 4 years ago

When upgrading from .net core 1.0 to 1.1, you may encounter the following error when running dotnet publish command: dotnet.exe : No executable found matching command "dotnet-publish-iis" The resolution is simple: adding the following line into the project.json file. At moment, the latest tool ...

local_offer asp.net core 2

visibility 18198
thumb_up 0
access_time 4 years ago

In traditional asp.net applications, Server.MapPath is commonly used to generate absolute path in the web server. However, this has been removed from ASP.NET Core. So what is the equivalent way of doing it?

local_offer sqlite local_offer entity-framework local_offer dotnetcore

visibility 32463
thumb_up 2
access_time 3 years ago

SQLite is a self-contained and embedded SQL database engine. In .NET Core, Entity Framework Core provides APIs to work with SQLite. This page provides sample code to create a SQLite database using package Microsoft.EntityFrameworkCore.Sqlite . Create a .NET Core 2.x console application in ...

About column

Everything about .NET framework, .NET Core and .NET Standard. 

rss_feed Subscribe RSS