dotnet / dotnet/project-system

Moving a project on disk breaks IntelliSense, etc due to caching of targets

Open
#1,538 10 comments 0 reactions 1 assignee Claimed by @drewnoakes View on GitHub
Triage-Investigate
Dominant language
C#
Stars
1k
Forks
415
PR merge metrics
No merged PRs in 30d

Description

1. Clone https://github.com/Ponant/ResxBugVS2017RC
2. Open project
3. Notice that Dependencies node has errors and get Intellisense errors

I debugged this and this is caused by the caching of the NuGet props, which results in the wrong paths being used for $(ProjectAssetsFile), for example, from a design-time build:
```
17>Target "ResolvePackageDependenciesForBuild" skipped, due to false condition; ('$(ResolvePackageDependenciesForBuild)' == 'true' and Exists('$(ProjectAssetsFile)')) was evaluated as ('true' == 'true' and Exists('U:\Calculus\Visual Studio 2017\Projects\ResBugWebAppCore11\ResBugWebAppCore11\obj\project.assets.json')).
```

This is despite this project being on my D:\. NuGet restore will re-generate the props/targets to point to the correct paths but Visual Studio will not pick up the new values until you restart it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.