dotnet / dotnet/msbuild

Switching branch on a solution being migrated to the new project system leaves dirty behind (even after clean)

Open
#2,486 3 comments 1 reaction 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

_From @valeriob on August 28, 2017 9:21_

Hi,
we are migrating many solutions to the new project system, but the tool is not helping us.
We create a branch where we migrate the project formats (not every one is yet on vs 2017).
When we switch back to the master (old prj system), we get an error for every project complaining about :

1) Create a solution with .net framework and old project system (master branch)
2) Create a branch and migrate projects to the new prj format (new branch)
3) Switch back to the master branch, clean and compile

you get many errors depending on the project like :
Your project.json doesn't have a runtimes section. You should add '"runtimes": { "win": { } }' to your project.json and then re-run NuGet restore.
Your project is not referencing the ".NETFramework,Version=v4.6.1" framework. Add a reference to ".NETFramework,Version=v4.6.1" in the "frameworks" section of your project.json, and then re-run NuGet restore.

Looking inside ./obj folder i see 4 files :
projectName.nuget.cache
projectName.nuget.g.props
projectName.nuget.g.targets
project.assets.json

if i manually delete the /obj folder of the project and compile it works.
Thanks

UPDATED:
i must add that this is very annoying on the dev machine, but particularly annoying on the CI server.

_Copied from original issue: dotnet/project-system#2742_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.