Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
589722e
Fix invalid ms.author value: YARP: config-providers.md (#35886)
wadepickett Aug 13, 2025
a100266
use the bootstrap table-success class to higlight rows (#35927)
timdeschryver Aug 13, 2025
635c07b
Misc minor edits - exception handling, pipe reader, top-level domain …
tdykstra Aug 14, 2025
f5998cb
WN: 10 Prev 7: Microsoft.OpenAPI breaking change (#35942)
wadepickett Aug 14, 2025
1ba120b
Add documentation for .NET 10 API endpoint authentication behavior ch…
Copilot Aug 15, 2025
056b049
Replace InvokeNew[Async] with InvokeConstructor[Async] (#35949)
wenz Aug 15, 2025
ca2296e
Improve app registration guidance (#35953)
guardrex Aug 15, 2025
7cc5281
Fix suggestions on build report (#35951)
guardrex Aug 15, 2025
d06cae2
Add breaking changes to TOC (#35947)
gewarren Aug 15, 2025
c666b61
Update copilot-instructions.md: Handling File Redirection (#35955)
wadepickett Aug 17, 2025
057c854
Update min-web-api.md (#35957)
ccaedin Aug 17, 2025
bf395e8
Surface .dev.localhost TLD Visual Studio option (#35952)
guardrex Aug 18, 2025
47a119a
Simplify and extend breaking changes guidance (#35960)
guardrex Aug 19, 2025
9f9af5f
Fix API cross-link (#35966)
guardrex Aug 19, 2025
5bffbaf
Update component-disposal.md (#35968)
kbaley Aug 20, 2025
f2d8d70
Duende Access Token Management (#35961)
maartenba Aug 20, 2025
905ed8e
Set Freshness ms.update-cycle (#35964)
wadepickett Aug 20, 2025
5b33efc
Update date format (#35969)
guardrex Aug 20, 2025
a8ca27d
Correct comparison to @bind:set (#35973)
georgehemmings Aug 21, 2025
ed59ec4
Revert "Correct comparison to @bind:set (#35973)" (#35977)
guardrex Aug 21, 2025
7b08cff
Update copilot-instructions.md: Expand Links & References rules (#35979)
wadepickett Aug 21, 2025
55d77da
Reorganize APIs documentation and consolidate error handling with imp…
Copilot Aug 22, 2025
d1ed37c
Clarify Razor component requirement (#35987)
guardrex Aug 25, 2025
ad60901
Min API: Add IProblemDetailsService content plus app example (#35982)
wadepickett Aug 25, 2025
0058cfb
Clean up Kestrel overview page: move debugger section, remove obsolet…
Copilot Aug 26, 2025
a85e53d
Update React sample cross-links (#35974)
guardrex Aug 26, 2025
7909b19
Fix missing AspNetCore.Hosting provider built-in metrics doc (#35998)
noahfalk Aug 27, 2025
e9ad321
Fix: update URL and correct text alignment (#35997)
erkalai Aug 27, 2025
50a7003
Add documentation for .localhost Top-Level Domain support in ASP.NET …
Copilot Aug 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 68 additions & 23 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
author: wadepickett
ms.author: wpickett
ms.date: 07-31-2025
ms.date: 08-17-2025
---

# Copilot Instructions for `dotnet/AspNetCore.Docs`
Expand Down Expand Up @@ -31,18 +31,40 @@ When creating a PR for an issue:
- If you cannot verify, state that explicitly in your output.

### Links and References
- Use relative links (for example, `../folder/file.md` or `./file.md`) when referencing files within this repository. Do not use absolute URLs or GitHub web links for internal content.
- For external links, always remove any language or culture segment from the URL path (such as `/en-us/`, `/fr-fr/`, `/en/`, etc.).
- Example (Microsoft Learn):
- Original: `https://learn.microsoft.com/en-us/aspnet/core/blazor/`
- Correct: `https://learn.microsoft.com/aspnet/core/blazor/`
- Example (Wikipedia):
- Original: `https://en.wikipedia.org/wiki/ASP.NET_Core`
- Correct: `https://wikipedia.org/wiki/ASP.NET_Core`
- For Microsoft Learn links, also strip the base domain (`https://learn.microsoft.com/en-us`) so only the path remains.
- Example:
- Original: `https://learn.microsoft.com/en-us/aspnet/core/blazor/`
- Correct: `/aspnet/core/blazor/`
- For cross-references to other articles within the AspNetCore.Docs repository:
- Use the xref syntax: `<xref:target-uid>`
- The "target-uid" of the xref syntax is obtained from the `uid` property value in the YAML front matter of the article's markdown file
- Examples
- For a target article `uid` value of `aspnetcore/mvc/overview`, the xref cross-link is `<xref:aspnetcore/mvc/overview>`
- For a target article `uid` value of `blazor/index`, the xref cross-link is `<xref:blazor/index>`

- For non-markdown files (files that don't have the `.md` file extension) within this repository, such as PowerShell scripts and code files:
- Use relative links with the appropriate file extension
- Example: `../build-tools/build.ps1` or `./sample.json`

- For external links to non-Microsoft sites (MDN, W3C, etc.):
- Use absolute URLs
- Remove any language or culture segment from the URL path (such as `/en-us/`, `/fr-fr/`, `/en/`, etc.)
- Example (MDN):
- Original: `https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event`
- Correct: `https://developer.mozilla.org/docs/Web/API/Element/click_event`

- For links to GitHub repositories:
- Use the full URL path
- Example: `https://github.com/maraf/blazor-wasm-react/blob/main/blazor/Counter.razor`
- Example: `https://github.com/dotnet/blazor-samples/blob/main/10.0/BlazorWebAssemblyReact/blazor/Counter.razor`
- For other Git hosting services or non-Microsoft domains, use the full URL
- Example: `https://gitlab.com/username/repo-name`

- For links to Microsoft Learn content in other repositories:
- Use the relative URL starting with a forward slash
- Don't include the scheme and the host (example: `https://learn.microsoft.com`) and don't include the locale (example: `en-us`)
- Example: For the target Learn website URL `https://learn.microsoft.com/en-us/dotnet/core/introduction`, use the relative URL `/dotnet/core/introduction` for the link destination

- Never use physical .md file paths in published content
- Wrong: `../blazor/index.md` or `/aspnet/core/blazor/index.md`
- Correct: `<xref:blazor/index>`
- Exception: GitHub-only content (such as README files, contributing guidelines, and other repository documentation that isn't published to learn.microsoft.com) should use an absolute URL to the markdown file (`.md` file extension)

## Repository-Specific Guidelines
- Follow the [Microsoft Writing Style Guide](https://learn.microsoft.com/en-us/style-guide/welcome/)
Expand All @@ -54,14 +76,37 @@ When creating a PR for an issue:
- For any new or updated .md file added to the repository, ensure the following frontmatter (metadata) is included:
- Metadata `ai-usage: ai-assisted` if any AI assistance was used
- Place the title metadata first, followed by the remaining metadata lines in alphabetical order. Example: `title`, `author`, `description`, `monikerRange`, `ms.author`, `ms.custom`, `ms.date`, `uid`, `zone_pivot_groups`
- Metadata `ms.date: <today's date>` with a format of MM-DD-YYYY. If the file already has a `ms.date` metadata, update it to today's date if more than 50 characters are changed in the file.
- Metadata `ms.date: <today's date>` with a format of MM/DD/YYYY. If the file already has a `ms.date` metadata, update it to today's date if more than 50 characters are changed in the file.

### Version Targeting Common Range Patterns
- Fixed Range: `>= aspnetcore-7.0 <= aspnetcore-9.0`
- Open Upper Bound: `>= aspnetcore-7.0`
- Open Lower Bound: `<= aspnetcore-9.0`
- Specific Version: `== aspnetcore-9.0`

### Handling File Redirections
- When a Markdown (.md) article file (this does not apply to includes) is deleted in a PR, create a redirection entry.
- Redirections ensure users following existing links aren't left with broken links
- To add a redirection:
1. Update the `.openpublishing.redirection.json` file at the repository root
2. Follow this format for new entries:
```json
{
"source_path": "aspnetcore/path/to/deleted-file.md",
"redirect_url": "/aspnet/core/path/to/target-file",
"redirect_document_id": false
}
```
3. Use relative URLs for redirection to pages in the `learn.microsoft.com` domain
- Example: `/aspnet/core/path/to/target-file`
4. For URLs in a different domain, use absolute URLs including the domain.
- Example: `https://learn.microsoft.com/dotnet/core/introduction`
5. Set `redirect_document_id` to `false` unless specifically instructed otherwise
6. Maintain alphabetical order of the `source_path` entries for better organization
7. Ensure proper JSON formatting with correct commas between entries
- When selecting a redirect target, choose the most relevant existing content that would serve the user's original intent
- If no direct replacement exists, redirect to a parent category page or related topic

### Code Snippets
- For code snippets longer than 6 lines:
1. Create a subfolder named after the document the snippet supports.
Expand Down Expand Up @@ -90,15 +135,15 @@ When creating a PR for an issue:
- Use the following language code and indentation standards for markdown code blocks or the `language` attribute of code snippets:

Content of the snippet | Language code | Indentation in spaces
:---: | :---: | :---:
C# | csharp | 4
HTML | html | 4
CSS | css | 4
JavaScript | javascript | 2 spaces (use 4 spaces for line continuation)
XML | xml | 2
JSON | json | 2
Console | console | 2
Text | - | 2
:--------------------: | :-----------: | :-------------------:
C# | csharp | 4
HTML | html | 4
CSS | css | 4
JavaScript | javascript | 2 spaces (use 4 spaces for line continuation)
XML | xml | 2
JSON | json | 2
Console | console | 2
Text | - | 2

### ASP.NET Core Specific Guidelines
- Use the latest supported version for examples unless otherwise specified
Expand Down
25 changes: 25 additions & 0 deletions .openpublishing.redirection.json
Original file line number Diff line number Diff line change
Expand Up @@ -1628,6 +1628,31 @@
"source_path": "aspnetcore/blazor/state-management.md",
"redirect_url": "/aspnet/core/state-management/",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/fundamentals/includes/apis6.md",
"redirect_url": "/aspnet/core/fundamentals/apis",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/fundamentals/minimal-apis/handle-errors.md",
"redirect_url": "/aspnet/core/fundamentals/error-handling-api",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/fundamentals/minimal-apis/overview.md",
"redirect_url": "/aspnet/core/fundamentals/apis",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/web-api/handle-errors.md",
"redirect_url": "/aspnet/core/fundamentals/error-handling-api",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/fundamentals/handle-errors.md",
"redirect_url": "/aspnet/core/fundamentals/error-handling-api",
"redirect_document_id": false
}
]
}
2 changes: 1 addition & 1 deletion aspnetcore/blazor/components/component-disposal.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ uid: blazor/components/component-disposal

[!INCLUDE[](~/includes/not-latest-version.md)]

This article explains the ASP.NET Core Razor component disposal with with <xref:System.IDisposable> and <xref:System.IAsyncDisposable>.
This article explains the ASP.NET Core Razor component disposal process with <xref:System.IDisposable> and <xref:System.IAsyncDisposable>.

If a component implements <xref:System.IDisposable> or <xref:System.IAsyncDisposable>, the framework calls for resource disposal when the component is removed from the UI. Don't rely on the exact timing of when these methods are executed. For example, <xref:System.IAsyncDisposable> can be triggered before or after an asynchronous <xref:System.Threading.Tasks.Task> awaited in [`OnInitalizedAsync`](xref:blazor/components/lifecycle#component-initialization-oninitializedasync) or [`OnParametersSetAsync`](xref:blazor/components/lifecycle#after-parameters-are-set-onparameterssetasync) is called or completes. Also, object disposal code shouldn't assume that objects created during initialization or other lifecycle methods exist.

Expand Down
2 changes: 1 addition & 1 deletion aspnetcore/blazor/forms/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ app.MapDefaultControllerRoute();
For more information on controller routing and validation failure error responses, see the following resources:

* <xref:mvc/controllers/routing>
* <xref:web-api/handle-errors#validation-failure-error-response>
* <xref:fundamentals/error-handling-api#validation-failure-error-response>

In the `.Client` project, add the `CustomValidation` component shown in the [Validator components](#validator-components) section. Update the namespace to match the app (for example, `namespace BlazorSample.Client`).

Expand Down
5 changes: 1 addition & 4 deletions aspnetcore/blazor/host-and-deploy/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,7 @@ When `WasmBundlerFriendlyBootConfig` is enabled, the produced JS contains `impor

The following sample apps are based on [Rollup](https://rollupjs.org/). Similar concepts apply when using other JS bundlers.

Demonstration sample apps:

* [Blazor WASM in a React application (`maraf/blazor-wasm-react` GitHub repository)](https://github.com/maraf/blazor-wasm-react)
* [.NET on WASM in a React component sample (`maraf/dotnet-wasm-react` GitHub repository)](https://github.com/maraf/dotnet-wasm-react)
Demonstration sample apps for Blazor WebAssembly in a React app (`BlazorWebAssemblyReact`) and .NET on WebAssembly in a React app (`DotNetWebAssemblyReact`) for .NET 10 or later are available in the [Blazor samples GitHub repository (`dotnet/blazor-samples`)](https://github.com/dotnet/blazor-samples).

:::moniker-end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,8 @@ IJSRuntime JS { get; set; }

Create an instance of a JS object using a constructor function and get the <xref:Microsoft.JSInterop.IJSObjectReference>/<xref:Microsoft.JSInterop.IJSInProcessObjectReference> .NET handle for referencing the instance with the following API:

* `InvokeNewAsync` (asynchronous)
* `InvokeNew` (synchronous)
* `InvokeConstructorAsync` (asynchronous)
* `InvokeConstructor` (synchronous)

Examples in this section demonstrate the API calls with the following `TestClass` with a constructor function (`constructor(text)`):

Expand All @@ -479,25 +479,25 @@ window.TestClass = class {
}
```

### Asynchronous `InvokeNewAsync`
### Asynchronous `InvokeConstructorAsync`

Use `InvokeNewAsync(string identifier, object?[]? args)` on <xref:Microsoft.JSInterop.IJSRuntime> and <xref:Microsoft.JSInterop.IJSObjectReference> to invoke the specified JS constructor function asynchronously. The function is invoked with the `new` operator. In the following example, `TestClass` contains a constructor function, and `classRef` is an <xref:Microsoft.JSInterop.IJSObjectReference>.
Use `InvokeConstructorAsync(string identifier, object?[]? args)` on <xref:Microsoft.JSInterop.IJSRuntime> and <xref:Microsoft.JSInterop.IJSObjectReference> to invoke the specified JS constructor function asynchronously. The function is invoked with the `new` operator. In the following example, `TestClass` contains a constructor function, and `classRef` is an <xref:Microsoft.JSInterop.IJSObjectReference>.

```csharp
var classRef = await JSRuntime.InvokeNewAsync("TestClass", "Blazor!");
var classRef = await JSRuntime.InvokeConstructorAsync("TestClass", "Blazor!");
var text = await classRef.GetValueAsync<string>("text");
var textLength = await classRef.InvokeAsync<int>("getTextLength");
```

An overload is available that takes a <xref:System.Threading.CancellationToken> argument or <xref:System.TimeSpan> timeout argument.

### Synchronous `InvokeNew`
### Synchronous `InvokeConstructor`

Use `InvokeNew(string identifier, object?[]? args)` on <xref:Microsoft.JSInterop.IJSInProcessRuntime> and <xref:Microsoft.JSInterop.IJSInProcessObjectReference> to invoke the specified JS constructor function synchronously. The function is invoked with the `new` operator. In the following example, `TestClass` contains a constructor function, and `classRef` is an <xref:Microsoft.JSInterop.IJSInProcessObjectReference>:
Use `InvokeConstructor(string identifier, object?[]? args)` on <xref:Microsoft.JSInterop.IJSInProcessRuntime> and <xref:Microsoft.JSInterop.IJSInProcessObjectReference> to invoke the specified JS constructor function synchronously. The function is invoked with the `new` operator. In the following example, `TestClass` contains a constructor function, and `classRef` is an <xref:Microsoft.JSInterop.IJSInProcessObjectReference>:

```csharp
var inProcRuntime = ((IJSInProcessRuntime)JSRuntime);
var classRef = inProcRuntime.InvokeNew("TestClass", "Blazor!");
var classRef = inProcRuntime.InvokeConstructor("TestClass", "Blazor!");
var text = classRef.GetValue<string>("text");
var textLength = classRef.Invoke<int>("getTextLength");
```
Expand Down Expand Up @@ -630,7 +630,7 @@ In server-side scenarios, JS interop calls can't be issued after Blazor's Signal
* <xref:Microsoft.JSInterop.IJSRuntime.InvokeAsync%2A?displayProperty=nameWithType>
* <xref:Microsoft.JSInterop.JSRuntimeExtensions.InvokeAsync%2A?displayProperty=nameWithType>
* <xref:Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync%2A?displayProperty=nameWithType>
* `InvokeNewAsync`
* `InvokeConstructorAsync`
* `GetValueAsync`
* `SetValueAsync`
* `Dispose`/`DisposeAsync` calls on any <xref:Microsoft.JSInterop.IJSObjectReference>.
Expand Down
2 changes: 1 addition & 1 deletion aspnetcore/blazor/javascript-interoperability/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ JavaScript (JS) interop calls can't be issued after Blazor's SignalR circuit is
* <xref:Microsoft.JSInterop.IJSRuntime.InvokeAsync%2A?displayProperty=nameWithType>
* <xref:Microsoft.JSInterop.JSRuntimeExtensions.InvokeAsync%2A?displayProperty=nameWithType>
* <xref:Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync%2A?displayProperty=nameWithType>
* `InvokeNewAsync`
* `InvokeConstructorAsync`
* `GetValueAsync`
* `SetValueAsync`
* `Dispose`/`DisposeAsync` calls on any <xref:Microsoft.JSInterop.IJSObjectReference>.
Expand Down
8 changes: 7 additions & 1 deletion aspnetcore/blazor/project-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,12 @@ In a Blazor WebAssembly app, the Blazor script content is located in the `wwwroo
<script src="_framework/blazor.webassembly.js"></script>
```

For a Blazor Web App or a Blazor Server app, the project must contain at least one Razor component file (`.razor`) in order to automatically include the Blazor script when the app is published. If the project doesn't contain at least one Razor component, set the `RequiresAspNetWebAssets` MSBuild property `true` in the app's project file to include the Blazor script:

```xml
<RequiresAspNetWebAssets>true</RequiresAspNetWebAssets>
```

## Location of `<head>` and `<body>` content

:::moniker range=">= aspnetcore-8.0"
Expand Down Expand Up @@ -642,7 +648,7 @@ To create an app that can run as either a Blazor Server app or a Blazor WebAssem

* <xref:blazor/tooling>
* <xref:blazor/hosting-models>
* <xref:fundamentals/minimal-apis/overview>
* <xref:fundamentals/apis>
* [Blazor samples GitHub repository (`dotnet/blazor-samples`)](https://github.com/dotnet/blazor-samples) ([how to download](xref:blazor/fundamentals/index#sample-apps))

:::moniker-end
Expand Down
Loading
Loading