Closed srivatsn closed 7 years ago
From @abpiskunov on January 30, 2017 17:29
@lifengl
The file nesting is implemented in the web tools extension. So moving to the web tools repo.
this is either something new in CPS or again same issue with circular nestings , which CPS needs to handle. Circular nesting issue was moved to U1 in CPS. We need to create a separate bug and reference original github issue form core project system
Missed this thread. DependentUpon should not contain a path, it should contains only the file name inside the same folder.
Also, not sure whether using DependentUpon as an attribute works well at this point.
@lifengl Is there a more reliable way to use DependentUpon (e.g., as a child node of Compile)?
The correct syntax is:
<Compile Update="Views\Shared\Partials\CardViewModel.cs" DependentUpon="_Card.cshtml" />
DependentUpon was interpreted in that folder, and relative/full path is not supported. Only a file name can be used here.
Some of our logic might remove the rest, and uses the only file name part (which is incorrect, you can change to randomFolder_card.cshtml but see the same behavior), but some are not . For the project you provide, the defined behavior is that CardViewModel.cs should not be nested under _Card.cshtml.
I can confirm that the file nesting works reliably after switching to the <Compile />
node provided above. I'm hoping that IntelliSense will eventually be provided, so that people know a full path isn't supported for DependentUpon
.
Glad to hear you got it working
From @scottaddie on January 29, 2017 3:32
Here are the steps to reproduce in VS 2017 RC3 (15.0.26127.0 D15REL):
Copied from original issue: dotnet/roslyn-project-system#1366