fernandoescolar / vscode-solution-explorer

This is a Visual Studio Code extension that provides a (.sln) Visual Studio Solution explorer panel..
MIT License
348 stars 73 forks source link

Added support for "PropertyGroup" properties within include/exclude paths #257

Closed panoskj closed 1 year ago

panoskj commented 1 year ago

Using properties in include/exclude paths results in the project being unloadable (loading animation forever). Here is an example that triggers the error:

<PropertyGroup>
    <MpaRoot>ClientApp\</MpaRoot>
</PropertyGroup>
<ItemGroup>
    <!-- Don't publish the MPA source files, but do show them in the project files list -->
    <Content Remove="$(MpaRoot)**" />
    <None Remove="$(MpaRoot)**" />
    <None Include="$(MpaRoot)**" Exclude="$(MpaRoot)node_modules\**" />
</ItemGroup>

While the following works as intended:

<ItemGroup>
    <!-- Don't publish the MPA source files, but do show them in the project files list -->
    <Content Remove="ClientApp\**" />
    <None Remove="ClientApp\**" />
    <None Include="ClientApp\**" Exclude="ClientApp\node_modules\**" />
</ItemGroup>

This PR parses all properties defined in PropertyGroup elements and performs a search and replace. So it adds support for properties like $(TargetFramework) but does not add support for properties defined outside the project file, like $(BaseOutputPath) and $(Configuration). Issue #102 mentions a problem with these properties. Issue #255 could also be affected by this problem, but there is not enough information about it right now.

fernandoescolar commented 1 year ago

Thank you!