Skip to content

DynamicDependentFile capability broken in VS 15.5 #261

Closed

Description

Activity

  1. aienabled commented on Jan 17, 2018

    @aienabled
    Author
  2. jviau commented on Jan 26, 2018

    @jviau
    Member

    The xaml content type CPS is receiving from .netcore for .xaml files is missing the necessary metadata for this to work.

    I updated the issue in dotnet/project-system pointing to the incorrect file.

  3. aienabled commented on Jan 26, 2018

    @aienabled
    Author

    Please re-read my first post. I'm pointing on a particular CPS feature which is broken to me since VS 15.5 update.
    Responded there in more details dotnet/project-system#3155 (comment)

  4. jviau commented on Jan 26, 2018

    @jviau
    Member

    Is your project system based off of the .netcore system or do you import Microsoft.Common.props or targets? If so, it is possible that your project system is using their .xaml content type now and not yours.

    I say this, because when I add the appropriate metadata to the file I mentioned in the other issue, it properly nests.

  5. aienabled commented on Jan 26, 2018

    @aienabled
    Author

    Jacob Viau (@jviau), thank you!
    My project system is using Microsoft.NET.Sdk (you refer to it as the .netcore system if I understand correctly).
    I didn't try the dynamic dependent file wireup on other file types and made the wrong assumption that the DynamicDependentFile capability broken with the last VS update.

    I've tried removing my .XAML content type definition now (completely with my ProjectItemsSchema.xaml) and it works without it so it should be using the content type definition from the .netcore project system. However, I've noticed that I still need to include my custom Page.xaml rule in the CustomProject.targets:

    <PropertyPageSchema Include="$(MSBuildThisFileDirectory)Rules\Page.xaml">
    	<Context>File;BrowseObject</Context>
    </PropertyPageSchema>		

    otherwise the XAML files are not visible in the project using my custom project system. I'm confused, isn't it should be using this XAML rule https://github.com/dotnet/project-system/blob/master/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/Page.xaml (and ProjectItemsSchema.xaml nearby) and my XAML rule should not be required? (UPD: it seems I've found the answer - the only place explicitly including Page.xaml is Microsoft.Managed.DesignTime.targets which is even more confusing!)

    Another curiosity is why the issue revealed only now when the .netcore project system added support for XAML Page about half a year ago https://github.com/dotnet/project-system/blob/master/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Rules/ProjectItemsSchema.xaml

    Is there any way to override the content type definition? I would prefer to use my custom definition from my ProjectItemsSchema.xaml at least until it's properly implemented in the .netcore project system.

  6. jviau commented on Jan 26, 2018

    @jviau
    Member

    For overriding their content type you can try playing the order they are appear in MSBuild evaluation. I can't remember off the top of my head if we default to the first or last appearance of a content type, so try both ways. Have yours appear before theirs, then after. If that doesn't work the only other way I can think of is to copy their file, edit it, add an msbuild item to remove their file from evaluation, and include yours.

  7. jviau commented on Jan 26, 2018

    @jviau
    Member

    As for why it just started breaking, it depends on if you had UWP installed. The rule from the SDK was broken and not shipping for a while by accident, but it was missed because UWP workload also brings in a xaml rules for the .xaml "Page" item type, so that was masking the mistake for a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions