Skip to content

Merge main into live #11251

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

Merged
merged 3 commits into from
Apr 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 5 additions & 7 deletions xml/System.Globalization/CultureInfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1279,21 +1279,19 @@ You might choose to override some of the values associated with the current cult
<format type="text/markdown"><![CDATA[

## Remarks
In the .NET Framework 4 and previous versions, by default, the UI culture of all threads is set to the Windows system culture. For applications whose current UI culture differs from the default system culture, this behavior is often undesirable. In the .NET Framework 4.5, the <xref:System.Globalization.CultureInfo.DefaultThreadCurrentUICulture%2A> property lets you define the default UI culture of all threads in an application domain.
In the .NET Framework 4 and previous versions, by default, the UI culture of all threads is set to the Windows system culture. For applications whose current UI culture differs from the default system culture, this behavior is often undesirable. In .NET Framework 4.5+, the <xref:System.Globalization.CultureInfo.DefaultThreadCurrentUICulture%2A> property lets you define the default UI culture of all threads in an application domain.

> [!IMPORTANT]
> If you have not explicitly set the UI culture of any existing threads executing in an application domain, setting the <xref:System.Globalization.CultureInfo.DefaultThreadCurrentUICulture%2A> property also changes the culture of these threads. However, if these threads execute in another application domain, their culture is defined by the <xref:System.Globalization.CultureInfo.DefaultThreadCurrentUICulture%2A> property in that application domain or, if no default value is defined, by the default system culture. Because of this, we recommend that you always explicitly set the culture of your main application thread and do not rely on the <xref:System.Globalization.CultureInfo.DefaultThreadCurrentUICulture%2A> property to define the culture of the main application thread.

Unless it is set explicitly, the value of the <xref:System.Globalization.CultureInfo.DefaultThreadCurrentUICulture%2A> property is `null`, and the current culture of all threads in an application domain that have not been assigned an explicit culture is defined by the default Windows system culture.

For more information about cultures, threads, and application domains, see the "Culture and threads" and "Culture and application domains" sections in the <xref:System.Globalization.CultureInfo> reference page.


For more information about cultures, threads, and application domains, see the "Culture and threads" and "Culture and application domains" sections of <xref:System.Globalization.CultureInfo>.

## Examples
The following example illustrates the default behavior of the .NET Framework in defining the current culture of a new thread. It uses English and Russian language resources. The following text file named GreetingStrings.txt contains the English language resources:
The following example illustrates the default behavior of .NET in defining the current culture of a new thread. It uses English and Russian language resources. The following text file named GreetingStrings.txt contains the English language resources:

```
```txt
greeting =Hello again!
newGreeting=Hello!
```
Expand All @@ -1306,7 +1304,7 @@ resgen greetingstrings.txt

The following text file named GreetingStrings.ru-RU.txt contains the Russian language resources:

```
```txt
greeting=Еще раз привет!
newGreeting=Привет!
```
Expand Down
35 changes: 12 additions & 23 deletions xml/System.IO.MemoryMappedFiles/MemoryMappedFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -896,38 +896,27 @@
## Remarks
Use this method to create a memory-mapped file that is not persisted (that is, not associated with a file on disk), which you can use to share data between processes.



## Examples
The following example is composed of three separate processes (console applications) that write `Boolean` values to a memory-mapped file. The following sequence of actions occur:

1. Process A creates the memory-mapped file and writes a value to it.

2. Process B opens the memory-mapped file and writes a value to it.

3. Process C opens the memory-mapped file and writes a value to it.

4. Process A reads and displays the values from the memory-mapped file.

5. After Process A is finished with the memory-mapped file, the file is immediately reclaimed by garbage collection.
1. Process A creates the memory-mapped file and writes a value to it.
2. Process B opens the memory-mapped file and writes a value to it.
3. Process C opens the memory-mapped file and writes a value to it.
4. Process A reads and displays the values from the memory-mapped file.
5. After Process A is finished with the memory-mapped file, the file is immediately reclaimed by garbage collection.

To run this example, do the following:

1. Compile the applications and open three Command windows.

2. In the first Command window, run Process A.

3. In the second Command window, run Process B.

4. Return to Process A and press ENTER.

5. In the third Command window, run Process C.

6. Return to Process A and press ENTER.
1. Compile the applications and open three Command windows.
2. In the first Command window, run Process A.
3. In the second Command window, run Process B.
4. Return to Process A and press ENTER.
5. In the third Command window, run Process C.
6. Return to Process A and press ENTER.

The output of Process A is as follows:

```
```txt
Start Process B and press ENTER to continue.
Start Process C and press ENTER to continue.
Process A says: True
Expand Down
28 changes: 0 additions & 28 deletions xml/System.IO/BufferedStream.xml
Original file line number Diff line number Diff line change
Expand Up @@ -743,34 +743,6 @@ Flushing the stream will not flush its underlying encoder unless you explicitly

Attempting to manipulate a stream after it has been closed might throw an <xref:System.ObjectDisposedException>.

## Examples
This code example is part of a larger example provided for the <xref:System.IO.BufferedStream> class.

```vb
' When bufStream is closed, netStream is in turn
' closed, which in turn shuts down the connection
' and closes clientSocket.
Console.WriteLine(vbCrLf & "Shutting down the connection.")
bufStream.Close()
```

```csharp
// When bufStream is closed, netStream is in turn
// closed, which in turn shuts down the connection
// and closes clientSocket.
Console.WriteLine("\nShutting down the connection.");
bufStream.Close();
```

```cpp
// When bufStream is closed, netStream is in turn closed,
// which in turn shuts down the connection and closes
// clientSocket.
Console::WriteLine( "\nShutting down connection." );
bufStream->Close();

```

]]></format>
</remarks>
<exception cref="T:System.IO.IOException">An error occurred while trying to close the stream.</exception>
Expand Down
52 changes: 24 additions & 28 deletions xml/System.IO/Directory.xml
Original file line number Diff line number Diff line change
Expand Up @@ -983,12 +983,13 @@ An I/O error occurred.</exception>
<format type="text/markdown"><![CDATA[

## Remarks
`searchPattern` can be a combination of literal and wildcard characters, but it doesn't support regular expressions. The following wildcard specifiers are permitted in `searchPattern`.

`searchPattern` can be a combination of literal and wildcard characters, but it doesn't support regular expressions. The following wildcard specifiers are permitted in `searchPattern`.

|Wildcard specifier|Matches|
|------------------------|-------------|
|\* (asterisk)|Zero or more characters in that position.|
|? (question mark)|Exactly one character in that position.|
| Wildcard specifier | Matches |
|--------------------|-------------------------------------------|
| \* (asterisk) | Zero or more characters in that position. |
| ? (question mark) | Exactly one character in that position. |

Characters other than the wildcard are literal characters. For example, the `searchPattern` string "\*t" searches for all names in `path` ending with the letter "t". The `searchPattern` string "s\*" searches for all names in `path` beginning with the letter "s".

Expand All @@ -1009,8 +1010,6 @@ An I/O error occurred.</exception>
<paramref name="searchPattern" /> does not contain a valid pattern.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="path" /> or <paramref name="searchPattern" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="searchOption" /> is not a valid <see cref="T:System.IO.SearchOption" /> value.</exception>
<exception cref="T:System.IO.DirectoryNotFoundException">
<paramref name="path" /> is invalid, such as referring to an unmapped drive.</exception>
<exception cref="T:System.IO.IOException">
Expand Down Expand Up @@ -1397,8 +1396,6 @@ The returned collection is not cached. Each call to the <xref:System.Collections
-or-

<paramref name="searchPattern" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="enumerationOptions" /> is not a valid <see cref="T:System.IO.EnumerationOptions" /> value.</exception>
<exception cref="T:System.IO.DirectoryNotFoundException">
<paramref name="path" /> is invalid, such as referring to an unmapped drive.</exception>
<exception cref="T:System.IO.IOException">
Expand Down Expand Up @@ -1740,12 +1737,13 @@ The returned collection is not cached. Each call to the <xref:System.Collections
<format type="text/markdown"><![CDATA[

## Remarks
`searchPattern` can be a combination of literal and wildcard characters, but it doesn't support regular expressions. The following wildcard specifiers are permitted in `searchPattern`.

`searchPattern` can be a combination of literal and wildcard characters, but it doesn't support regular expressions. The following wildcard specifiers are permitted in `searchPattern`.

|Wildcard specifier|Matches|
|------------------------|-------------|
|\* (asterisk)|Zero or more characters in that position.|
|? (question mark)|Exactly one character in that position.|
| Wildcard specifier | Matches |
|--------------------|-------------------------------------------|
| \* (asterisk) | Zero or more characters in that position. |
| ? (question mark) | Exactly one character in that position. |

Characters other than the wildcard are literal characters. For example, the `searchPattern` string "\*t" searches for all names in `path` ending with the letter "t". The `searchPattern` string "s\*" searches for all names in `path` beginning with the letter "s".

Expand Down Expand Up @@ -1778,8 +1776,6 @@ The returned collection is not cached. Each call to the <xref:System.Collections
-or-

<paramref name="searchPattern" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="enumerationOptions" /> is not a valid <see cref="T:System.IO.EnumerationOptions" /> value.</exception>
<exception cref="T:System.IO.DirectoryNotFoundException">
<paramref name="path" /> is invalid, such as referring to an unmapped drive.</exception>
<exception cref="T:System.IO.IOException">
Expand Down Expand Up @@ -2634,10 +2630,10 @@ The returned collection is not cached. Each call to the <xref:System.Collections

`searchPattern` can be a combination of literal and wildcard characters, but it doesn't support regular expressions. The following wildcard specifiers are permitted in `searchPattern`.

|Wildcard specifier|Matches|
|------------------------|-------------|
|\* (asterisk)|Zero or more characters in that position.|
|? (question mark)|Exactly one character in that position.|
| Wildcard specifier | Matches |
|--------------------|-------------------------------------------|
| \* (asterisk) | Zero or more characters in that position. |
| ? (question mark) | Exactly one character in that position. |

Characters other than the wildcard are literal characters. For example, the `searchPattern` string "\*t" searches for all names in `path` ending with the letter "t". The `searchPattern` string "s\*" searches for all names in `path` beginning with the letter "s".

Expand Down Expand Up @@ -3125,10 +3121,10 @@ The returned collection is not cached. Each call to the <xref:System.Collections

`searchPattern` can be a combination of literal and wildcard characters, but it doesn't support regular expressions. The following wildcard specifiers are permitted in `searchPattern`.

|Wildcard specifier|Matches|
|------------------------|-------------|
|\* (asterisk)|Zero or more characters in that position.|
|? (question mark)|Exactly one character in that position.|
| Wildcard specifier | Matches |
|--------------------|-------------------------------------------|
| \* (asterisk) | Zero or more characters in that position. |
| ? (question mark) | Exactly one character in that position. |

Characters other than the wildcard are literal characters. For example, the `searchPattern` string "\*t" searches for all names in `path` ending with the letter "t". The `searchPattern` string "s\*" searches for all names in `path` beginning with the letter "s".

Expand Down Expand Up @@ -3536,10 +3532,10 @@ The returned collection is not cached. Each call to the <xref:System.Collections

`searchPattern` can be a combination of literal and wildcard characters, but it doesn't support regular expressions. The following wildcard specifiers are permitted in `searchPattern`.

|Wildcard specifier|Matches|
|------------------------|-------------|
|\* (asterisk)|Zero or more characters in that position.|
|? (question mark)|Exactly one character in that position.|
| Wildcard specifier | Matches |
|--------------------|-------------------------------------------|
| \* (asterisk) | Zero or more characters in that position. |
| ? (question mark) | Exactly one character in that position. |

Characters other than the wildcard are literal characters. For example, the `searchPattern` string "\*t" searches for all names in `path` ending with the letter "t". The `searchPattern` string "s\*" searches for all names in `path` beginning with the letter "s".

Expand Down
2 changes: 1 addition & 1 deletion xml/System.IO/FileInfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@

This example produces output similar to the following.

```
```txt
Hello
And
Welcome
Expand Down
2 changes: 1 addition & 1 deletion xml/System.IO/Path.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2209,7 +2209,7 @@ Console.WriteLine(result);

This example produces output similar to the following.

```
```txt
C:\Users\UserName\AppData\Local\Temp\
```

Expand Down
4 changes: 2 additions & 2 deletions xml/System.Web.Caching/SqlCacheDependency.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@

The database name passed to the `database` parameter must be defined in the application's Web.config file. For example, the following Web.config file defines a database named pubs for <xref:System.Web.Caching.SqlCacheDependency> change notifications.

```
```xml
<configuration>
<connectionStrings>
<add name="Pubs" connectionString="Data Source=(local); Initial Catalog=pubs; Integrated Security=true"; providerName="System.Data.SqlClient" />
Expand Down Expand Up @@ -247,7 +247,7 @@
## Remarks
The following markup shows a typical output-cache dependency directive.

```
```xml
<%@ OutputCache Duration="3600" SqlDependency="Northwind:Employees" VaryByParam="none" %>
```

Expand Down
4 changes: 2 additions & 2 deletions xml/System.Web.Compilation/RouteUrlExpressionBuilder.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
## Examples
The following example shows how to create markup that generates a hyperlink with a URL that is formatted for a route. The route is defined by using `http://www.contoso.com/search/{searchterm}` as the URL pattern.

```
```xml
<asp:HyperLink ID="HyperLink1" runat="server"
NavigateUrl="<%$ RouteUrl:searchterm=Bicycles %>">
Search for Bicycles
Expand All @@ -47,7 +47,7 @@

If the URL parameters provided to the `RouteUrl` expression are not sufficient to uniquely identify a route, you must include the route name. For example, if a Web application has two routes with `searchterm` as the sole URL parameter, the routes would have to be defined by using route names, and the hyperlink markup would resemble the following example:

```
```xml
<asp:HyperLink ID="HyperLink1" runat="server"
NavigateUrl="<%$ RouteUrl:searchterm=Bicycles,
routename=BasicSearchRoute %>">
Expand Down
2 changes: 1 addition & 1 deletion xml/System.Web.Compilation/RouteValueExpressionBuilder.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
## Examples
The following example shows how to use markup to display the value of the URL parameter `searchterm`. The route is defined by using `http://www.contoso.com/search/{searchterm}` as the URL pattern.

```
```xml
<asp:Label ID="Label1" runat="server"
text="<%$ RouteValue:searchterm %>">
</asp:Label>
Expand Down
2 changes: 1 addition & 1 deletion xml/System.Web.Configuration/AuthorizationSection.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
> [!NOTE]
> If you use the `credentials` section, be sure to follow the guidelines explained at [ASP.NET Authentication](https://learn.microsoft.com/previous-versions/aspnet/eeyk640h(v=vs.100)). For scalability and better security capability, it is recommended that you use an external database to store the users' credentials. For more information about building secure ASP.NET applications, see [Securing Your ASP.NET Application](https://learn.microsoft.com/archive/msdn-magazine/2012/january/asp-net-security-securing-your-asp-net-applications) and [Building Secure ASP.NET Applications: Authentication, Authorization, and Secure Communication](https://learn.microsoft.com/previous-versions/msp-n-p/ff649357(v=pandp.10)).

```
```xml
<authorization>
<allow users="userName" roles="admin" verbs="post" />
<deny users="*" verbs="post"/>
Expand Down
2 changes: 1 addition & 1 deletion xml/System.Web.Configuration/ClientTarget.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

The following code example shows how to declaratively specify values for several properties of the <xref:System.Web.Configuration.ClientTarget> class.

```
```xml
<clientTarget>
<add alias=
"uplevel"
Expand Down
2 changes: 1 addition & 1 deletion xml/System.Web.Configuration/ClientTargetCollection.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

The following example shows an excerpt from the configuration file.

```
```xml
<clientTarget>
<add alias=
"uplevel"
Expand Down
2 changes: 1 addition & 1 deletion xml/System.Web.Configuration/ClientTargetSection.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

The following code example shows how to declaratively specify values for several properties of the <xref:System.Web.Configuration.ClientTarget> class.

```
```xml
<clientTarget>
<add alias=
"uplevel" userAgent="Mozilla/5.0 (compatible;MSIE 6.0;Windows NT 5.1)"/>
Expand Down
12 changes: 5 additions & 7 deletions xml/System.Web.Configuration/HttpCapabilitiesBase.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2349,7 +2349,7 @@
## Remarks
Intended for internal use only. Some browsers require a meta-tag similar to the following for the browser to render properly.

```
```html
<META NAME="NAME" CONTENT="VALUE">
```

Expand Down Expand Up @@ -2421,14 +2421,12 @@
## Remarks
If `true`, server-control adapters insert the following tag into the HTML `<head>` element of a Web page:

```
```html
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT=""; CHARSET="">
```

In this example, `CONTENT` is the value returned by the <xref:System.Web.Configuration.HttpCapabilitiesBase.PreferredRenderingMime%2A> property, and `charset` is the character encoding used.



## Examples
The following code example shows how to determine whether the browser requires an HTML `<meta>` element for which the `content-type` attribute is specified.

Expand Down Expand Up @@ -2724,7 +2722,7 @@
## Remarks
HTTP is a stateless protocol, and `VIEWSTATE` is one mechanism used to persist client changes across multiple requests. Each control on a Web page contains a <xref:System.Web.UI.Control.ViewState%2A> property, which represents the accumulation of any changes made by the client. In a Web Forms page, these changes are encoded in postback data as the `value` of an HTML `<input>` element with a `type` attribute of `hidden`. For example:

```
```html
<input type="hidden" name="__VIEWSTATE" value="t0PH_u56?cDxleHQ7P=" />
```

Expand Down Expand Up @@ -3147,7 +3145,7 @@
## Remarks
The `cache-control` value for the `http-equiv` attribute of HTML `<meta>` elements allows control over client caching of downloaded content, which includes Web pages. The following HTML fragment shows an example:

```
```html
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"/>
```

Expand All @@ -3157,7 +3155,7 @@

The <xref:System.Web.Configuration.HttpCapabilitiesBase.SupportsCacheControlMetaTag%2A> property also applies to the equivalent HTTP header form:

```
```txt
CACHE-CONTROL: NO-CACHE
```

Expand Down
2 changes: 1 addition & 1 deletion xml/System.Web.Configuration/HttpHandlerAction.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

The following configuration excerpt shows how to specify values declaratively for the `httpHandlers` section.

```
```xml
<httpHandlers>
<add path="Calculator.custom"
type="Samples.Aspnet.SystemWebConfiguration.Calculator, CalculatorHandler"
Expand Down
2 changes: 1 addition & 1 deletion xml/System.Web.Configuration/HttpHandlersSection.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

The following configuration excerpt shows how to specify values declaratively for the `httpHandlers` section.

```
```xml
<httpHandlers>
<add path="Calculator.custom"
type="Samples.Aspnet.SystemWebConfiguration.Calculator, CalculatorHandler"
Expand Down
Loading