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

485 views 0 comments last modified about 2 years ago Raymond

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

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

Set AttachDbFilename as Relative Path in .NET Core

315 views   0 comments last modified about 5 months ago

.NET Framework, you can use |DataDirectory| to configure connection string when connecting to SQL Server database file via attach mode: AttachDbFilename=|DataDirectory|\dbname.mdf In .NET Core, you cannot directly set SQL Server Express connec...

View detail

Instantiate a Service in ConfigureServices Method in .NET Core

45 views   0 comments last modified about 5 months ago

.NET Core is built in with dependency injection. Usually method ConfigureServices in Startup class is used to register services in the container. The signature of the method looks like the following: public void ConfigureServices(IServiceC...

View detail

SQLite in .NET Core with Entity Framework Core

169 views   0 comments last modified about 5 months 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 sample project ...

View detail

Graphics Programming and Image Processing in .NET Core 2.x

135 views   0 comments last modified about 5 months ago

In .NET Core 2.x, Windows Forms or WPF are not implemented since they are based on GDI+ and DirectX respectively in Windows. In .NET Core 3.0, there is plan to add Desktop Packs which includes UWP. WPF and Windows Forms. However, they will still be Windows-only. In .NET Core applications, you may...

View detail

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

1005 views   1 comments last modified about 10 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)

194 views   0 comments last modified about 9 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

Add comment

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

Comments (0)

No comments yet.