question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Purpose of RazorGeneral.xaml rule file

See original GitHub issue

The .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:

image

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 to EnumProperty so that a drop-down list of valid values is provided, rather than an open text box.

cc: @captainsafia

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
drewnoakescommented, Mar 30, 2021

Given removing it is not an option, here are the other options:

  1. Change the Context here from Project to BrowseObject, which will remove it from the UI without breaking the ability to access it from code, or
  2. Set all properties to have Visible="False", as occurs in RazorGenerateWithTargetPath and RazorComponentWithTargetPath.

You’ll notice that the RazorExtension rule has visible properties, but does not appear in the UI. This is because it has File 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found