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.

dotnet migrate does not overwrite csproj files when running multiple migrations

See original GitHub issue

Steps to reproduce

  • Get an old project.json from somehwere
  • Run dotnet migrate
  • Change the project.json to add a new dependency
  • Run dotnet migrate again

Expected behavior

  • Migration is successful
  • The csproj file has the <PackageReference> that corresponds to the new depedency.

Actual behavior

  • Migration runs and shows it is successful
  • The csproj file is not modified

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-preview3-003930)

Product Information:
 Version:            1.0.0-preview3-003930
 Commit SHA-1 hash:  3be25bbed3

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.11
 OS Platform: Darwin
 RID:         osx.10.11-x64

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
TheRealPiotrPcommented, Nov 1, 2016

@blackdwarf could we go for a warning here? Overwriting on a second migration can be quite destructive as folks are likely to have modified their csproj after migrating. I’d much rather display a summary that says that a PJ was skipped in migration because foo.csproj already exists. This is enough context for a user to delete the csproj if they really want the migration to take place. Thoughts?

0reactions
blackdwarfcommented, Dec 5, 2016

Sure, closing this down.

Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet migrate does not overwrite csproj files when running ...
Steps to reproduce. Get an old project.json from somehwere; Run dotnet migrate; Change the project.json to add a new dependency; Run dotnet ...
Read more >
Upgrading an existing .NET project files to the lean new ...
You have some options when migrating to .NET Core and the .NET Standard. First, and above all, run the .NET Portability Analyzer and...
Read more >
EF Core Error - No project was found. Change the current ...
I was facing the same issue when scaffolding existing database of MySql using this. Command I was executing: dotnet ef dbcontext scaffold " ......
Read more >
Example of migrating to the latest .NET
Learn how to migrate your applications from .NET 5, .NET Core, and .NET Framework to .NET 7.
Read more >
Migration of Solution File after dotnet CLI tools already ...
Visual Studio asks to migrate but fails, because the project files referenced in the solution can no longer be found. If the corresponding...
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