mhutch / MonoDevelop.MSBuildEditor

Improved MSBuild editing support
Other
215 stars 26 forks source link

Editor does not work when editing Directory.Build.{props|targets} files directly #185

Closed JakeYallop closed 5 months ago

JakeYallop commented 5 months ago

Might be a duplicate of https://github.com/mhutch/MonoDevelop.MSBuildEditor/issues/94, figured I raise it anyway in case its not.

Hovering over a property In a nested Directory.Build.props file (although the same is true even for my top-level props file): image

Hovering over the same property in a csproj file: gEO2Td0TSr

The above is just an example, other extension features (completions etc.) are all missing when editing a Directory.Build.{props|targets} file directly.

JakeYallop commented 5 months ago

Minor update - a props file nested next to a project works just fine.

Given:

Solution/
  Directory.Build.props
  Project1/
    Directory.Build.props
    Project1.csproj

The props file in "Solution" does not have any editor features enabled. The props file in "Solution/Project1" has the editor enabled.

JakeYallop commented 5 months ago

After trying to create a standalone reproduction in a new project and failing, I realised that was some kind of caching issue, caused by installing the extension to an existing project with some props files already open.

Files that I'd already opened prior to installing the extension did not have extension features enabled, and closing and reopening them in VS did not solve the issues. New props file created after the installing the extension had no issues. In the end, clearing all cached data by deleting the ".vs" folder resolved all the issues I was having.