dotnet migrate does not overwrite csproj files when running multiple migrations
See original GitHub issueSteps 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:
- Created 7 years ago
- Comments:7 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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?
Sure, closing this down.