This site uses cookies to deliver our services. By using this site, you acknowledge that you have read and understand our Cookie and Privacy policy. Your use of Kontext website is subject to this policy. Allow Cookies and Dismiss

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

381 views 0 comments last modified about 2 years ago Raymond

.NET ASP.NET dotnet core asp.net core 2

In this page

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 …

Related pages

ASP.NET Core 2 with Bootstrap 4 Bundler Minifier Issue: Expected semicolon or closing curly-brace found '-'

561 views   1 comments last modified about 5 months ago

Background When upgrading Bootstrap to v4.0.0 release, the bundler and minifier doesn’t work properly due to CSS variable is commonly used: :root{--blue:#007bff; About 26 errors will show up in the Error List with the following message: ...

View detail

Tuples in C# (4.x, 7.0, 7.1)

86 views   0 comments last modified about 4 months ago

What is a tuple? Tuple is an ordered sequence, fixed-size, immutable and of heterogeneous objects. Tuple has been existing in other languages such as F#, Python, Perl and etc. for a long time. It was first introduced into C# from C# 4.0 and has been evolving over time. Since C# 7.1, tuple...

View detail

Invoke Hadoop WebHDFS APIs in .NET Core

139 views   0 comments last modified about 4 months ago

Background Apache doesn't provide native official .NET APIs for Hadoop HDFS. The HTTP REST API supports the complete FileSystem / ...

View detail

Logging configuration in .NET core

258 views   0 comments last modified about 9 months ago

.NET core introduces a logging API that works with a number of logging frameworks. The built-in providers are configurable and extensible to support different level loggings.

View detail

Sending Emails in .NET Core Applications

1199 views   0 comments last modified about 9 months ago

Sending emails are common in applications. For example, when user registers, we need to send account activation emails. This post summarize the approaches we can use to send emails in .NET Core 1.x and 2.x.

View detail

Retrieve Http client request metadata like IP address and languages in asp.net core

805 views   0 comments last modified about 9 months ago

IP Address In ASP.NET Core, Request.UserHostAddress has been removed though that attribute exists in the traditional ASP.NET applications. We can use HttpContext.Connection to retrieve the remove client IP address: var ipAddress = HttpContext.Connecti...

View detail

Add comment

Please login first to add comments.  Log in New user?  Register

Comments (0)

No comments yet.