question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to migrate multi-project solution to Asp.net Core 1.1

See original GitHub issue

Migration tool does not seem to support multiple project solutions well.

ReciPiBook.Api Message src\ReciPiBook.Api\ReciPiBook.Api.xproj: Failed to migrate XProj project ReciPiBook.Api. ‘dotnet migrate -s -p “C:\Users\xxx\Documents\Visual Studio 2015\Projects\ReciPiBook2017\ReciPiBookCore\src\ReciPiBook.Api” -x “C:\Users\xxx\Documents\Visual Studio 2015\Projects\ReciPiBook2017\ReciPiBookCore\src\ReciPiBook.Api\ReciPiBook.Api.xproj”’ exited with error code 1. src\ReciPiBook.Api\ReciPiBook.Api.xproj: Could not find file ‘C:\Users\xxx\Documents\Visual Studio 2015\Projects\ReciPiBook2017\ReciPiBookCore\src\ReciPiBook.Services\project.json’. Migration failed. src\ReciPiBook.Api\ReciPiBook.Api.xproj: Backing up C:\Users\xxx\Documents\Visual Studio 2015\Projects\ReciPiBook2017\ReciPiBookCore\src\ReciPiBook.Api\ReciPiBook.Api.xproj to C:\Users\xxx\Documents\Visual Studio 2015\Projects\ReciPiBook2017\ReciPiBookCore\Backup\src\ReciPiBook.Api\ReciPiBook.Api.xproj. src\ReciPiBook.Api\project.json: Backing up C:\Users\xxx\Documents\Visual Studio 2015\Projects\ReciPiBook2017\ReciPiBookCore\src\ReciPiBook.Api\project.json to C:\Users\xxx\Documents\Visual Studio 2015\Projects\ReciPiBook2017\ReciPiBookCore\Backup\src\ReciPiBook.Api\project.json.

Steps to reproduce

Clone https://github.com/napalm684/ReciPiBookCore Open in vs2017rc or run migration command

Expected behavior

Migration tools succeed or provide feedback on why it failed/steps to correct.

Actual behavior

Failures without clear reason (see errors above)/unable to even recreate the projects manually nuget packages will install in the projects (ie: Microsoft.AspNetCore.Mvc in the ReciPiBook.Api project) but are not recognized by the compiler.

Environment data

dotnet --info output:

C:\Users\xxx>dotnet --info .NET Command Line Tools (1.0.0-preview3-004056)

Product Information: Version: 1.0.0-preview3-004056 Commit SHA-1 hash: ccc4968bc3

Runtime Environment: OS Name: Windows OS Version: 10.0.14393 OS Platform: Windows RID: win10-x64

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:7
  • Comments:28 (7 by maintainers)

github_iconTop GitHub Comments

9reactions
k7hpncommented, Nov 18, 2016

I got my project working in VS2017RC (finally). Here’s the process I followed:

  1. Followed steps 1 and 2 of the ASP.NET Core 1.1 upgrade instructions on the blog (install SDK 1.1 and edit the Web project.json). I also installed the “Visual Studio 2015 Tools (Preview 2)” from the .NET Core downloads page page - I’m not sure which order I did these in or if it matters.
  2. Load the solution in VS2015.
  3. Instead of using the UI NuGet updater (step 3 in the blog post) I just ran Update-Package in the package console.
  4. Debug the project to verify everything works, then exit VS2015.
  5. Edit the global.json file and set the SDK version to 1.0.0-preview3-004056 (this is the version that dotnet --info says I have installed).
  6. dotnet migrate and then dotnet restore.
  7. Remove all project.json and *.xproj files from the project tree.
  8. Open the solution in VS2017RC.

It even runs on the Mac preview of VS2017RC but none of the dotnet ef commands work, they still expect a project.json file.

8reactions
alinapopacommented, Nov 17, 2016

I have seen the same issue when migrating a solution to VS 2017 RC: in the solution there are projects A and B, B depends on A. Project A is migrated successfully and its project.json is moved, then when it tries to convert project B, it looks for project A’s project.json, but it’s not there since it was already moved. There are three issues:

  • failure to migrate when there are projects in solution than depend on one another
  • does not provide clear message why migration did not succeed: the error message is “dotnet migrate exited with error code 1.” There is a message about not finding a project.json file, but it appears as a separate warning
  • after failure to migrate, the solution is left in an inconsistent state from where is hard to go back to VS 2015

Repro: https://github.com/lucabol/FollowTheGuru , open in VS 2017 RC

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to add migration in the multi-project solution?
Try to use this in root folder: dotnet ef --startup-project src\MyApi.WebApi\ migrations add MyMigration --project src\MyApi.Infrastructure.
Read more >
Migrate from ASP.NET Core 1.x to 2.0
This article outlines the prerequisites and most common steps for migrating an ASP.NET Core 1.x project to ASP.NET Core 2.0.
Read more >
Sharing appsettings.json configuration files between ...
In this post I show how you can extract common settings to a shared JSON file and how to configure your projects to...
Read more >
Creating Solutions in ASP.NET MVC
This guide will demonstrate how to upgrade a single project solution into a multi-project solution. This guide focuses on .NET Framework solutions and...
Read more >
Unable to resolve error when try dotnet restore multi project ...
i`ve got simular problem. Solve that by manually swap project order in solution file. Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Some.Lib", ".
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found