-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a basic HOW TO on adding a new property page #7140
Add a basic HOW TO on adding a new property page #7140
Conversation
Stub out a new Markdown file that will describe how to add a new property page, and link to it from the README.md.
Fill out the steps for defining a new property page.
<None Update="MyPropertyPage.xaml"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For SDK-style, this style is preferred:
<None Update="MyPropertyPage.xaml"> | |
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |
</None> | |
<None Update="MyPropertyPage.xaml" CopyToOutputDirectory="PreserveNewest" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it's better supported in SDK-style projects, but it's hard to call it preferred. If you update the property of a file through the Properties window (e.g. set "Copy to Output Directory" to "Copy if newer") we won't use the attribute style, even for SDK-style projects.
The only place it's really common right now is PackageReference
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, a few years back, I migrated a bunch of projects from csproj-style to SDK-style. And, at that time, I found documentation on the format with a decent migration guide. Right now, I just spent some time searching, and literally everything I found from the past is no longer there. No idea where it went, but the internet has lost information as it does over time. However, I can find remnants of why I said this is 'preferred':
- https://stackoverflow.com/a/54272143/294804
- Allow CopyToOutputDirectory to have a custom destination path msbuild#2795
- https://stackoverflow.com/a/58600845/294804
I can find answers, posts, questions, issues, etc. showing it being used as an attribute versus a node. But, I honestly cannot find the source of behind it. I would not take the actions of VS to be an 'absolute' on the format. But, I do know there had been information on what should be used as attributes versus nodes. I just can't find it anymore. 😭
Move the "How-To Guides" into the "Customising Project Properties" section, and move that section ahead of "Architecture" as it is likely the more relevant for most readers.
Co-authored-by: Drew Noakes <git@drewnoakes.com>
… into 210421-HowToDefineAPropertyPage
Rearrange text so all project file manipulation happens in subsequent steps.
Adds documentation going through the basic steps of creating a new property page. Much of this is covered in the existing property-specification.md file, but I felt the need for something a bit more guided.
I plan to fill out the second option (embedding the XAML file) in a subsequent change; I started writing that section and then realized I didn't actually know enough of the details. :-)
I also plan to write similar HOW TOs for adding a launch profile, extending an existing property page or launch profile, localization, and other common operations.
Microsoft Reviewers: Open in CodeFlow