Purpose of RazorGeneral.xaml rule file
See original GitHub issueThe .NET Project System team is producing a new Project Properties UI. It generates its property model from XAML rule files.
For ASP.NET Web Applications, a “Razor Properties” rule file is injecting properties at the top of this UI:
The values are coming from https://github.com/dotnet/sdk/blob/main/src/RazorSdk/Targets/Rules/RazorGeneral.xaml
Are these properties useful to the user?
If these properties are not useful to the user, let’s work to remove this rule file from the Project Properties UI altogether.
If they are useful, let’s tweak the experience:
- Order the page lower down in the UI
- Add descriptions to the properties
- Add
HelpUrl
values is appropriate, so that the user can easily navigate to more information about these properties - Potentially change them from
StringProperty
toEnumProperty
so that a drop-down list of valid values is provided, rather than an open text box.
cc: @captainsafia
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Adding Xaml Rules - microsoft/VSProjectSystem
In CPS, the role of XAML rules is to describe to CPS what and how properties, items, and metadata from msbuild matter. There...
Read more >XAML overview - WPF .NET
XAML is a declarative markup language. As applied to the .NET programming model, XAML simplifies creating a UI for a .NET app.
Read more >Part 1. Getting Started with XAML - Xamarin
In a Xamarin.Forms application, XAML is mostly used to define the visual contents of a page and works together with a code-behind file....
Read more >XAML - Quick Guide
XAML Quick Guide - XAML stands for Extensible Application Markup Language. It’s a simple and declarative language based on XML.
Read more >Extensible Application Markup Language
Extensible Application Markup Language is a declarative XML-based language developed by Microsoft for initializing structured values and objects.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Given removing it is not an option, here are the other options:
Context
here fromProject
toBrowseObject
, which will remove it from the UI without breaking the ability to access it from code, orVisible="False"
, as occurs inRazorGenerateWithTargetPath
andRazorComponentWithTargetPath
.You’ll notice that the
RazorExtension
rule has visible properties, but does not appear in the UI. This is because it hasFile
context type (here).The simplest fix to the original problem is just to manually hide the properties, which I’ve done in https://github.com/dotnet/sdk/pull/16623. That PR should address the core problem here.
I’ll leave it to others to decide whether there’s a desire to tidy up the slight inconsistency across these rules.
Yes, this enables us to introspect on the project system at tooling time to extract information: https://github.com/dotnet/aspnetcore-tooling/blob/5b6dd93b4657f9f9c5fa884a0d1911e7c431ab32/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/ProjectSystem/DefaultRazorProjectHost.cs#L65-L71