Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
18849ca
Initial plan
Copilot Oct 7, 2025
5be4cfc
Replace deprecated :: separator with @ in update suggestions
Copilot Oct 7, 2025
a0aec01
Fix approval tests for @ separator in built-in package messages
Copilot Oct 7, 2025
edec32b
Enable CI builds for 2xx branch
marcpopMSFT Sep 24, 2025
3c1be38
Revert .Replace calls on DisplayName properties
Copilot Oct 10, 2025
992b136
Merge release/10.0.1xx into darc-release/10.0.1xx-e4896d37-2fa9-4f9d-…
dotnet-maestro[bot] Oct 11, 2025
39a202a
Update dependencies from https://github.com/dotnet/dotnet build 286525
dotnet-maestro[bot] Oct 11, 2025
24c3251
Merge branch 'release/10.0.1xx' into darc-release/10.0.1xx-e4896d37-2…
SimonZhao888 Oct 13, 2025
8ac8ba6
[release/10.0.1xx] Source code updates from dotnet/dotnet (#51200)
SimonZhao888 Oct 13, 2025
c4c90d8
[Hot Reload] Do not refresh browser until changes are applied (#51210)
tmat Oct 13, 2025
42ac246
[release/10.0.1xx][HotReload] Allow hot reload refresh script injecti…
github-actions[bot] Oct 13, 2025
d68695b
Add guidance for dotnet/templating dependencies to copilot instructions
Copilot Oct 13, 2025
4b0a7a1
Suppress all nullable warnings for files in source packages when targ…
tmat Oct 13, 2025
2f7f808
Update dependencies from https://github.com/microsoft/testfx build 20…
dotnet-maestro[bot] Oct 14, 2025
9b8d008
Merge release/10.0.1xx into darc-release/10.0.1xx-e47952ab-9edc-4a1d-…
dotnet-maestro[bot] Oct 14, 2025
7e4df22
Update dependencies from https://github.com/dotnet/dotnet build 286841
dotnet-maestro[bot] Oct 14, 2025
e131138
Merge branch 'release/10.0.2xx' into merge/release/10.0.1xx-to-releas…
SimonZhao888 Oct 14, 2025
d031a8f
[dotnet-watch] Remove excess logging that slows down Hot Reload (#51220)
tmat Oct 14, 2025
cf72fd2
Merge branch 'release/10.0.1xx' into darc-release/10.0.1xx-e47952ab-9…
SimonZhao888 Oct 14, 2025
7c61d86
[automated] Merge branch 'release/10.0.1xx' => 'release/10.0.2xx' (#5…
SimonZhao888 Oct 14, 2025
6ddd557
[release/10.0.1xx] Update dependencies from microsoft/testfx (#51229)
SimonZhao888 Oct 14, 2025
98a9839
Merge branch 'release/10.0.1xx' of https://github.com/dotnet/sdk into…
Oct 14, 2025
f9a7f1e
Merge branch 'release/10.0.2xx' into merge/release/10.0.1xx-to-releas…
SimonZhao888 Oct 14, 2025
9adc4bc
[release/10.0.1xx] Source code updates from dotnet/dotnet (#51230)
SimonZhao888 Oct 14, 2025
547c258
[automated] Merge branch 'release/10.0.1xx' => 'release/10.0.2xx' (#5…
SimonZhao888 Oct 14, 2025
eb84f04
Update MSTest to 4.0.1 (#51236)
Youssef1313 Oct 14, 2025
2819cea
Update dependencies from https://github.com/microsoft/testfx build 20…
dotnet-maestro[bot] Oct 15, 2025
e18a4fa
Merge release/10.0.1xx into darc-release/10.0.1xx-47fece1f-af95-4494-…
dotnet-maestro[bot] Oct 15, 2025
8371154
Update dependencies from https://github.com/dotnet/dotnet build 287070
dotnet-maestro[bot] Oct 15, 2025
1f2feef
Merge branch 'release/10.0.2xx' into merge/release/10.0.1xx-to-releas…
SimonZhao888 Oct 15, 2025
c92a32f
[release/10.0.1xx] Source code updates from dotnet/dotnet (#51257)
SimonZhao888 Oct 15, 2025
038f2fa
Merge branch 'release/10.0.1xx' of https://github.com/dotnet/sdk into…
Oct 15, 2025
5cf1d7c
[automated] Merge branch 'release/10.0.1xx' => 'release/10.0.2xx' (#5…
SimonZhao888 Oct 15, 2025
3f7d3c9
[release/10.0.1xx] Update dependencies from microsoft/testfx (#51256)
SimonZhao888 Oct 15, 2025
100cca7
Merge branch 'release/10.0.2xx' into merge/release/10.0.1xx-to-releas…
SimonZhao888 Oct 15, 2025
2ee5539
[release/10.0.1xx] [wasm] Always update SDK pack version from workloa…
github-actions[bot] Oct 15, 2025
527c399
Add support for building tool packages with runtime identifier set wi…
dsplaisted Oct 15, 2025
c8589b6
Don't fall back to .NET Standard package pruning for .NET Framework
dsplaisted Oct 16, 2025
fd3a276
Update dependencies from https://github.com/microsoft/testfx build 20…
dotnet-maestro[bot] Oct 16, 2025
1c80230
[release/10.0.1xx] Update dependencies from microsoft/testfx (#51294)
SimonZhao888 Oct 16, 2025
6f4d94a
[release/10.0.1xx] Source code updates from dotnet/dotnet (#51291)
dotnet-maestro[bot] Oct 16, 2025
0952e91
[automated] Merge branch 'release/10.0.1xx' => 'release/10.0.2xx' (#5…
SimonZhao888 Oct 16, 2025
630c84b
Update tests
dsplaisted Oct 16, 2025
a59f24e
Fix tests
dsplaisted Oct 16, 2025
b0f6af0
Don't fall back to .NET Standard package pruning for .NET Framework (…
dsplaisted Oct 16, 2025
ffb7660
Add support for building tool packages with runtime identifier set wi…
baronfel Oct 16, 2025
4a500fa
Enable CI builds for 2xx branch (#50985)
marcpopMSFT Oct 16, 2025
e62ad52
[automated] Merge branch 'release/10.0.1xx' => 'release/10.0.2xx' (#5…
joeloff Oct 16, 2025
4384670
Backflow from https://github.com/dotnet/dotnet / 79c85d9 build 287426
dotnet-maestro[bot] Oct 17, 2025
62a5a83
Merge release/10.0.1xx into darc-release/10.0.1xx-e9bea922-f8ce-4436-…
dotnet-maestro[bot] Oct 17, 2025
e945600
Update dependencies from https://github.com/dotnet/dotnet build 287426
dotnet-maestro[bot] Oct 17, 2025
f6115a4
Fix dotnet test detection for dlls (#51309)
Youssef1313 Oct 17, 2025
fec417b
Follow-up to dotnet test parsing (#51331)
Youssef1313 Oct 17, 2025
78759c5
Improve progress output, rebuild projects serially (#51227)
tmat Oct 17, 2025
43f8f05
Clean up browser communication protocol (#51226)
tmat Oct 17, 2025
6314a5a
Update version features with dynamic calculations
marcpopMSFT Oct 17, 2025
fef27d6
Update implicit versions for October
marcpopMSFT Oct 17, 2025
05c1dad
Convert Middleware and Agent.Host packages to source packages (#51335)
tmat Oct 17, 2025
61a25c9
Fix `dotnet new` to suggest `@` instead of deprecated `::` separator …
marcpopMSFT Oct 17, 2025
0235c63
Update version features with dynamic calculations (#51340)
marcpopMSFT Oct 17, 2025
b56a9fa
Temporarily revert "Clean up browser communication protocol (#51226)"…
tmat Oct 17, 2025
35d2fb9
Merge branch 'release/10.0.1xx' into darc-release/10.0.1xx-e9bea922-f…
SimonZhao888 Oct 20, 2025
932985b
Merge branch 'release/10.0.2xx' into merge/release/10.0.1xx-to-releas…
SimonZhao888 Oct 20, 2025
ca9ada1
[release/10.0.1xx] Source code updates from dotnet/dotnet (#51324)
SimonZhao888 Oct 20, 2025
b309ffa
Initial plan
Copilot Oct 20, 2025
4e51f56
Cherry-pick PR #50749: Update compatibility message for .NET 10.0 and…
Copilot Oct 20, 2025
2699046
Update .NET MAUI baseline manifests (#51313)
jonathanpeppers Oct 20, 2025
fc38963
Cherry-pick PR #50749 to release/10.0.1xx: Update compatibility messa…
marcpopMSFT Oct 20, 2025
76e9b87
[automated] Merge branch 'release/10.0.1xx' => 'release/10.0.2xx' (#5…
joeloff Oct 20, 2025
4afe99d
Update dependencies from https://github.com/microsoft/testfx build 20…
dotnet-maestro[bot] Oct 21, 2025
79e1882
[release/10.0.1xx] Update dependencies from microsoft/testfx (#51381)
SimonZhao888 Oct 21, 2025
4de98dd
Merge branch 'release/10.0.2xx' into merge/release/10.0.1xx-to-releas…
SimonZhao888 Oct 21, 2025
1ad7560
[automated] Merge branch 'release/10.0.1xx' => 'release/10.0.2xx' (#5…
SimonZhao888 Oct 21, 2025
f43920b
Update --project/--solution descriptions for dotnet test (MTP) (#51371)
Youssef1313 Oct 21, 2025
16e3d8d
[release/10.0.1xx] Package Pruning data fixes for past frameworks (#5…
ericstj Oct 21, 2025
936e872
Merge branch 'release/10.0.2xx' into merge/release/10.0.1xx-to-releas…
SimonZhao888 Oct 22, 2025
155478a
[automated] Merge branch 'release/10.0.1xx' => 'release/10.0.2xx' (#5…
SimonZhao888 Oct 22, 2025
306af36
Enable file-based user-secrets tests (#51180)
jjonescz Oct 22, 2025
2671b1e
Mark SDK bundle as shipping
joeloff Oct 22, 2025
50e1dc6
Update versions .props based on the RC2 build
marcpopMSFT Oct 22, 2025
9e81ef5
Remove no longer necessary Roslyn lexer experimental suppression (#51…
jjonescz Oct 22, 2025
e6bc966
Mark SDK bundle as shipping (#51413)
joeloff Oct 22, 2025
1c37787
Merge branch 'release/10.0.2xx' into marcpopMSFT-implicitversionsOctober
marcpopMSFT Oct 22, 2025
a48f4c1
Update implicit versions for October (#51341)
marcpopMSFT Oct 23, 2025
868814a
Update dependencies from https://github.com/microsoft/testfx build 20…
dotnet-maestro[bot] Oct 23, 2025
94301f7
Merge branch 'release/10.0.2xx' into merge/release/10.0.1xx-to-releas…
SimonZhao888 Oct 23, 2025
1706751
[automated] Merge branch 'release/10.0.1xx' => 'release/10.0.2xx' (#5…
SimonZhao888 Oct 23, 2025
1b2374f
Merge branch 'release/10.0.2xx' into darc-release/10.0.2xx-d92b91d9-5…
SimonZhao888 Oct 23, 2025
c75dfa3
[release/10.0.2xx] Update dependencies from microsoft/testfx (#51426)
SimonZhao888 Oct 23, 2025
3bab9fa
downgrade arcade as well to try to unblock the build.
marcpopMSFT Oct 23, 2025
71bb809
Update dependencies from https://github.com/microsoft/testfx build 20…
dotnet-maestro[bot] Oct 24, 2025
39856f4
[release/10.0.2xx] Fix dotnet run to accept Windows path separators o…
github-actions[bot] Oct 24, 2025
18acad9
Merge branch 'release/10.0.2xx' into darc-release/10.0.2xx-b3a0e477-f…
SimonZhao888 Oct 24, 2025
7ae7ca5
Update arcade up to the eng latest rather than the one from RC2
marcpopMSFT Oct 24, 2025
af53a35
Update dependencies from https://github.com/microsoft/testfx build 20…
dotnet-maestro[bot] Oct 25, 2025
d6b5bd0
Update dependencies from https://github.com/microsoft/testfx build 20…
dotnet-maestro[bot] Oct 26, 2025
3b86353
Exclude PublishDir from default items to prevent recursive artifacts …
Copilot Oct 26, 2025
7e0e382
Merge branch 'release/10.0.2xx' into darc-release/10.0.2xx-b3a0e477-f…
SimonZhao888 Oct 27, 2025
ca56781
[release/10.0.2xx] Update dependencies from microsoft/testfx (#51440)
SimonZhao888 Oct 27, 2025
221e476
Skip the AutoRestartOnRuntimeRudeEdit test for now. It doesn't fail i…
marcpopMSFT Oct 28, 2025
259b808
Update versions .props based on the RC2 build (#51414)
marcpopMSFT Oct 28, 2025
6480928
Update dependencies from https://github.com/microsoft/testfx build 20…
dotnet-maestro[bot] Oct 29, 2025
b6c39b3
[release/10.0.2xx] Update dependencies from microsoft/testfx (#51479)
SimonZhao888 Oct 29, 2025
e4bfbfd
Initial plan
Copilot Oct 28, 2025
3fe9d7b
Fix CA1869 to not report warnings in top-level statements
Copilot Oct 28, 2025
6b5dd5a
Format AvoidSingleUseOfLocalJsonSerializerOptions.cs
Copilot Oct 28, 2025
4503744
Add formatting commit to .git-blame-ignore-revs
Copilot Oct 28, 2025
e74f06b
Address PR feedback: update comment and remove unnecessary files
Copilot Oct 28, 2025
06d61cb
Update dependencies from https://github.com/microsoft/testfx build 20…
dotnet-maestro[bot] Oct 30, 2025
c00e47a
[release/10.0.2xx] Update dependencies from microsoft/testfx (#51490)
DonnaChen888 Oct 30, 2025
33b1ba5
Merge branch 'release/10.0.2xx' into backport/pr-51468-to-release/10.…
SimonZhao888 Oct 31, 2025
74f9b49
Update dependencies from https://github.com/microsoft/testfx build 20…
dotnet-maestro[bot] Oct 31, 2025
3f8e1d6
[release/10.0.2xx] Fix CA1869 false positive in top-level statements …
eiriktsarpalis Oct 31, 2025
23be566
[release/10.0.2xx] Update dependencies from microsoft/testfx (#51503)
DonnaChen888 Oct 31, 2025
aa69755
Update dependencies from https://github.com/microsoft/testfx build 20…
dotnet-maestro[bot] Nov 1, 2025
610c2d3
Update dependencies from https://github.com/microsoft/testfx build 20…
dotnet-maestro[bot] Nov 2, 2025
74299ee
[release/10.0.2xx] Update dependencies from microsoft/testfx (#51517)
SimonZhao888 Nov 3, 2025
c2cfe49
Update dependencies from https://github.com/microsoft/testfx build 20…
dotnet-maestro[bot] Nov 3, 2025
17686e1
[release/10.0.2xx] Update dependencies from microsoft/testfx (#51523)
SimonZhao888 Nov 3, 2025
b07ae40
Update dependencies from https://github.com/microsoft/testfx build 20…
dotnet-maestro[bot] Nov 4, 2025
0d6a76c
[release/10.0.2xx] Update dependencies from microsoft/testfx (#51539)
DonnaChen888 Nov 4, 2025
2a58ddb
[release/10.0.2xx] Manually set source tag to a 10.0.2xx build (#51541)
dkurepa Nov 4, 2025
6565604
[release/10.0.2xx] Remove legacy console template comment from .NET 1…
github-actions[bot] Nov 4, 2025
ebd7dad
Update RulesMissingDocumentation.md (#51543)
jjonescz Nov 4, 2025
e8d545b
Remove analyzer redirecting DLL (#51511)
jjonescz Nov 4, 2025
30287ee
Add source package for file-based programs support (#51373)
RikkiGibson Nov 4, 2025
0d9d681
Accept both projects and solutions in 'dotnet test --project' (MTP) (…
Youssef1313 Nov 5, 2025
01103ed
Remove razor_tooling from format example ci test
nagilson Nov 4, 2025
71017c2
Add IsShipping property to FileBasedPrograms project file (#51581)
RikkiGibson Nov 5, 2025
46ee3d8
Merge branch 'release/10.0.2xx' into backport/pr-51563-to-release/10.…
DonnaChen888 Nov 6, 2025
62949b0
[release/10.0.2xx] Remove razor_tooling from format example ci test (…
nagilson Nov 6, 2025
6fa8d44
Include FileBasedPrograms package project in the solution (#51587)
RikkiGibson Nov 6, 2025
03bac48
Set EnableDefaultEmbeddedResourceItems and EnableDefaultNoneItems to …
Copilot Nov 6, 2025
d2fd7ba
Include EmbeddedResources in Microsoft.DotNet.HotReload.Web.Middlewar…
tmat Nov 7, 2025
8bd3eb7
[release/10.0.2xx] Make S.CL builder DSLs more transferable (#50685) …
baronfel Nov 8, 2025
7ca819d
Ensure that `--nologo` adheres to DOTNET_NOLOGO if present (#51462)
baronfel Nov 8, 2025
9ba2e9f
Revert "Temporarily revert "Clean up browser communication protocol (…
tmat Nov 10, 2025
2f327b1
Reuse ProjectCollection across DTBs (#51620)
tmat Nov 11, 2025
0d115e6
Merge branch 'main' of https://github.com/dotnet/sdk into merge/relea…
Nov 11, 2025
2184797
Update RulesMissingDocumentation.md
Nov 11, 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
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -515,11 +515,11 @@ dotnet_diagnostic.IDE0040.severity = warning
insert_final_newline = false

# Verify settings
[*.{received,verified}.{txt,xml,json}]
[*.{received,verified}.{txt,xml,json,sh,zsh,nu,fish,ps1}]
charset = "utf-8-bom"
end_of_line = lf
indent_size = unset
indent_style = unset
insert_final_newline = false
tab_width = unset
trim_trailing_whitespace = false
trim_trailing_whitespace = false
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,7 @@
*.verified.txt text eol=lf working-tree-encoding=UTF-8
*.verified.xml text eol=lf working-tree-encoding=UTF-8
*.verified.json text eol=lf working-tree-encoding=UTF-8
*.verified.sh text eol=lf working-tree-encoding=UTF-8
*.verified.zsh text eol=lf working-tree-encoding=UTF-8
*.verified.nu text eol=lf working-tree-encoding=UTF-8
*.verified.fish text eol=lf working-tree-encoding=UTF-8
9 changes: 8 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{
"dotnet.testWindow.disableAutoDiscovery": true,
"dotnet.defaultSolution": "sdk.slnx"
"dotnet.testWindow.disableBuildOnRun": true,
"dotnet.defaultSolution": "cli.slnf",
"files.associations": {
"*.slnf": "json",
"*.props": "xml",
"*.targets": "xml",
"*.*proj": "xml"
}
}
15 changes: 15 additions & 0 deletions cli.slnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"solution": {
"path": "sdk.slnx",
"projects": [
"src\\BuiltInTools\\dotnet-watch\\dotnet-watch.csproj",
"src\\Cli\\dotnet\\dotnet.csproj",
"src\\Cli\\Microsoft.DotNet.Cli.Utils\\Microsoft.DotNet.Cli.Utils.csproj",
"test\\dotnet-new.IntegrationTests\\dotnet-new.IntegrationTests.csproj",
"test\\dotnet-watch.Tests\\dotnet-watch.Tests.csproj",
"test\\dotnet.Tests\\dotnet.Tests.csproj",
"test\\Microsoft.DotNet.Cli.Utils.Tests\\Microsoft.DotNet.Cli.Utils.Tests.csproj",
"test\\Microsoft.NET.TestFramework\\Microsoft.NET.TestFramework.csproj"
]
}
}
12 changes: 6 additions & 6 deletions documentation/general/analyzer-redirecting.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ Targeting an SDK (and hence also loading analyzers) with newer major version in

## Overview

- The SDK will contain a VSIX with the analyzer DLLs and an MEF-exported implementation of `IAnalyzerAssemblyRedirector`.
- The SDK will deploy analyzer DLLs and Roslyn will deploy an implementation of `IAnalyzerAssemblyRedirector`
(could be deployed by SDK but we are saving on analyzer loads and Roslyn already has a VSIX with a DLL).
Implementations of this interface are imported by Roslyn and can redirect analyzer DLL loading.

- The SDK's implementation of `IAnalyzerAssemblyRedirector` will redirect any analyzer DLL matching some pattern
to the corresponding DLL deployed via the VSIX.
- That implementation of `IAnalyzerAssemblyRedirector` will redirect any analyzer DLL matching some pattern
to the corresponding DLL deployed with VS.
Details of this process are described below.

- Note that when `IAnalyzerAssemblyRedirector` is involved, Roslyn is free to not use shadow copy loading and instead load the DLLs directly.
Expand All @@ -33,7 +34,7 @@ Targeting an SDK (and hence also loading analyzers) with newer major version in

## Details

The VSIX contains some analyzers, for example:
The VS deployment contains some analyzers, for example:

```
AspNetCoreAnalyzers\analyzers\dotnet\cs\Microsoft.AspNetCore.App.Analyzers.dll
Expand Down Expand Up @@ -69,7 +70,7 @@ C:\Program Files\dotnet\sdk\9.0.100-preview.5.24307.3\Sdks\Microsoft.NET.Sdk\ana
will be redirected to

```
{VSIX}\SDKAnalyzers\Sdks\Microsoft.NET.Sdk\analyzers\Microsoft.CodeAnalysis.NetAnalyzers.dll
{InstallDir}\SDKAnalyzers\Sdks\Microsoft.NET.Sdk\analyzers\Microsoft.CodeAnalysis.NetAnalyzers.dll
```

where `metadata.json` has `"SDKAnalyzers": "9.0.100-dev"`, because
Expand All @@ -83,6 +84,5 @@ Analyzers that cannot be matched will continue to be loaded from the SDK
### Implementation

Analyzer DLLs are contained in transport package `VS.Redist.Common.Net.Core.SDK.RuntimeAnalyzers`.
The redirecting logic lives in "system" VS extension `Microsoft.Net.Sdk.AnalyzerRedirecting`.

[torn-sdk]: https://github.com/dotnet/sdk/issues/42087
3 changes: 3 additions & 0 deletions documentation/general/dotnet-run-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ Additionally, the implicit project file has the following customizations:
in case there is a project or solution in the same directory as the file-based app.
This ensures that items from nested projects and artifacts are not included by the app.

- `EnableDefaultEmbeddedResourceItems` and `EnableDefaultNoneItems` properties are set to `false` if the default SDK (`Microsoft.NET.Sdk`) is being used.
This avoids including files like `./**/*.resx` in simple file-based apps where users usually don't expect that.

## Grow up

When file-based programs reach an inflection point where build customizations in a project file are needed,
Expand Down
1 change: 1 addition & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
<SystemReflectionMetadataLoadContextToolsetPackageVersion>9.0.0</SystemReflectionMetadataLoadContextToolsetPackageVersion>
<SystemReflectionMetadataToolsetPackageVersion>9.0.0</SystemReflectionMetadataToolsetPackageVersion>
<SystemDiagnosticsDiagnosticSourceToolsetPackageVersion>9.0.0</SystemDiagnosticsDiagnosticSourceToolsetPackageVersion>
<SystemTextEncodingCodePagesToolsetPackageVersion>8.0.0</SystemTextEncodingCodePagesToolsetPackageVersion>
<SystemTextJsonToolsetPackageVersion>9.0.0</SystemTextJsonToolsetPackageVersion>
<SystemThreadingTasksExtensionsToolsetPackageVersion>4.5.4</SystemThreadingTasksExtensionsToolsetPackageVersion>
<SystemResourcesExtensionsToolsetPackageVersion>8.0.0</SystemResourcesExtensionsToolsetPackageVersion>
Expand Down
3 changes: 1 addition & 2 deletions sdk.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
</Folder>
<Folder Name="/src/">
<Project Path="src/Microsoft.DotNet.TemplateLocator/Microsoft.DotNet.TemplateLocator.csproj" />
<Project Path="src/Microsoft.Net.Sdk.AnalyzerRedirecting/Microsoft.Net.Sdk.AnalyzerRedirecting.csproj" />
<Project Path="src/Microsoft.Net.Sdk.Compilers.Toolset/Microsoft.Net.Sdk.Compilers.Toolset.csproj" />
<Project Path="src/Microsoft.Win32.Msi/Microsoft.Win32.Msi.csproj" />
<Project Path="src/System.CommandLine.StaticCompletions/System.CommandLine.StaticCompletions.csproj" />
Expand Down Expand Up @@ -66,6 +65,7 @@
<Project Path="src/Cli/Microsoft.DotNet.Cli.CommandLine/Microsoft.DotNet.Cli.CommandLine.csproj" />
<Project Path="src/Cli/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj" />
<Project Path="src/Cli/Microsoft.DotNet.Configurer/Microsoft.DotNet.Configurer.csproj" />
<Project Path="src/Cli/Microsoft.DotNet.FileBasedPrograms/Microsoft.DotNet.FileBasedPrograms.Package.csproj" />
<Project Path="src/Cli/Microsoft.DotNet.InternalAbstractions/Microsoft.DotNet.InternalAbstractions.csproj" />
<Project Path="src/Cli/Microsoft.TemplateEngine.Cli/Microsoft.TemplateEngine.Cli.csproj" />
</Folder>
Expand Down Expand Up @@ -338,7 +338,6 @@
<Project Path="test/Microsoft.NET.Publish.Tests/Microsoft.NET.Publish.Tests.csproj" />
<Project Path="test/Microsoft.NET.Rebuild.Tests/Microsoft.NET.Rebuild.Tests.csproj" />
<Project Path="test/Microsoft.NET.Restore.Tests/Microsoft.NET.Restore.Tests.csproj" />
<Project Path="test/Microsoft.Net.Sdk.AnalyzerRedirecting.Tests/Microsoft.Net.Sdk.AnalyzerRedirecting.Tests.csproj" />
<Project Path="test/Microsoft.NET.Sdk.BlazorWebAssembly.AoT.Tests/Microsoft.NET.Sdk.BlazorWebAssembly.AoT.Tests.csproj" />
<Project Path="test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/Microsoft.NET.Sdk.BlazorWebAssembly.Tests.csproj" />
<Project Path="test/Microsoft.NET.Sdk.Publish.Tasks.Tests/Microsoft.NET.Sdk.Publish.Tasks.Tests.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@
</ItemGroup>

<Import Project="..\Web.Middleware\Microsoft.DotNet.HotReload.Web.Middleware.projitems" Label="Shared" />

<ItemGroup>
<EmbeddedResource Update="@(EmbeddedResource)">
<LogicalName>%(FileName)%(Extension)</LogicalName>
</EmbeddedResource>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ internal abstract class AbstractBrowserRefreshServer(string middlewareAssemblyPa
{
public const string ServerLogComponentName = "BrowserRefreshServer";

private static readonly ReadOnlyMemory<byte> s_reloadMessage = Encoding.UTF8.GetBytes("Reload");
private static readonly ReadOnlyMemory<byte> s_waitMessage = Encoding.UTF8.GetBytes("Wait");
private static readonly ReadOnlyMemory<byte> s_pingMessage = Encoding.UTF8.GetBytes("""{ "type" : "Ping" }""");
private static readonly JsonSerializerOptions s_jsonSerializerOptions = new(JsonSerializerDefaults.Web);

private readonly List<BrowserConnection> _activeConnections = [];
Expand Down Expand Up @@ -233,19 +230,15 @@ public ValueTask SendJsonMessageAsync<TValue>(TValue value, CancellationToken ca
public ValueTask SendReloadMessageAsync(CancellationToken cancellationToken)
{
logger.Log(LogEvents.ReloadingBrowser);
return SendAsync(s_reloadMessage, cancellationToken);
return SendAsync(JsonReloadRequest.Message, cancellationToken);
}

public ValueTask SendWaitMessageAsync(CancellationToken cancellationToken)
{
logger.Log(LogEvents.SendingWaitMessage);
return SendAsync(s_waitMessage, cancellationToken);
return SendAsync(JsonWaitRequest.Message, cancellationToken);
}

// obsolete: to be removed
public ValueTask SendPingMessageAsync(CancellationToken cancellationToken)
=> SendAsync(s_pingMessage, cancellationToken);

private ValueTask SendAsync(ReadOnlyMemory<byte> messageBytes, CancellationToken cancellationToken)
=> SendAndReceiveAsync(request: _ => messageBytes, response: null, cancellationToken);

Expand Down Expand Up @@ -293,13 +286,13 @@ public async ValueTask SendAndReceiveAsync<TRequest>(
public ValueTask RefreshBrowserAsync(CancellationToken cancellationToken)
{
logger.Log(LogEvents.RefreshingBrowser);
return SendJsonMessageAsync(new AspNetCoreHotReloadApplied(), cancellationToken);
return SendAsync(JsonRefreshBrowserRequest.Message, cancellationToken);
}

public ValueTask ReportCompilationErrorsInBrowserAsync(ImmutableArray<string> compilationErrors, CancellationToken cancellationToken)
{
logger.Log(LogEvents.UpdatingDiagnostics);
return SendJsonMessageAsync(new HotReloadDiagnostics { Diagnostics = compilationErrors }, cancellationToken);
return SendJsonMessageAsync(new JsonReportDiagnosticsRequest { Diagnostics = compilationErrors }, cancellationToken);
}

public async ValueTask UpdateStaticAssetsAsync(IEnumerable<string> relativeUrls, CancellationToken cancellationToken)
Expand All @@ -308,24 +301,37 @@ public async ValueTask UpdateStaticAssetsAsync(IEnumerable<string> relativeUrls,
foreach (var relativeUrl in relativeUrls)
{
logger.Log(LogEvents.SendingStaticAssetUpdateRequest, relativeUrl);
var message = JsonSerializer.SerializeToUtf8Bytes(new UpdateStaticFileMessage { Path = relativeUrl }, s_jsonSerializerOptions);
var message = JsonSerializer.SerializeToUtf8Bytes(new JasonUpdateStaticFileRequest { Path = relativeUrl }, s_jsonSerializerOptions);
await SendAsync(message, cancellationToken);
}
}

private readonly struct AspNetCoreHotReloadApplied
private readonly struct JsonWaitRequest
{
public string Type => "Wait";
public static readonly ReadOnlyMemory<byte> Message = JsonSerializer.SerializeToUtf8Bytes(new JsonWaitRequest(), s_jsonSerializerOptions);
}

private readonly struct JsonReloadRequest
{
public string Type => "Reload";
public static readonly ReadOnlyMemory<byte> Message = JsonSerializer.SerializeToUtf8Bytes(new JsonReloadRequest(), s_jsonSerializerOptions);
}

private readonly struct JsonRefreshBrowserRequest
{
public string Type => "AspNetCoreHotReloadApplied";
public string Type => "RefreshBrowser";
public static readonly ReadOnlyMemory<byte> Message = JsonSerializer.SerializeToUtf8Bytes(new JsonRefreshBrowserRequest(), s_jsonSerializerOptions);
}

private readonly struct HotReloadDiagnostics
private readonly struct JsonReportDiagnosticsRequest
{
public string Type => "HotReloadDiagnosticsv1";
public string Type => "ReportDiagnostics";

public IEnumerable<string> Diagnostics { get; init; }
}

private readonly struct UpdateStaticFileMessage
private readonly struct JasonUpdateStaticFileRequest
{
public string Type => "UpdateStaticFile";
public string Path { get; init; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public override async Task<ApplyStatus> ApplyManagedCodeUpdatesAsync(ImmutableAr
var anyFailure = false;

await browserRefreshServer.SendAndReceiveAsync(
request: sharedSecret => new JsonApplyHotReloadDeltasRequest
request: sharedSecret => new JsonApplyManagedCodeUpdatesRequest
{
SharedSecret = sharedSecret,
UpdateId = batchId,
Expand Down Expand Up @@ -178,9 +178,9 @@ private static bool ReceiveUpdateResponseAsync(ReadOnlySpan<byte> value, ILogger
public override Task InitialUpdatesAppliedAsync(CancellationToken cancellationToken)
=> Task.CompletedTask;

private readonly struct JsonApplyHotReloadDeltasRequest
private readonly struct JsonApplyManagedCodeUpdatesRequest
{
public string Type => "BlazorHotReloadDeltav3";
public string Type => "ApplyManagedCodeUpdates";
public string? SharedSecret { get; init; }

public int UpdateId { get; init; }
Expand Down Expand Up @@ -211,7 +211,7 @@ private readonly struct JsonLogEntry

private readonly struct JsonGetApplyUpdateCapabilitiesRequest
{
public string Type => "BlazorRequestApplyUpdateCapabilities2";
public string Type => "GetApplyUpdateCapabilities";
}
}
}
4 changes: 2 additions & 2 deletions src/BuiltInTools/Web.Middleware/BrowserScriptMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public async Task InvokeAsync(HttpContext context)
// for backwards compat only
internal static ReadOnlyMemory<byte> GetBlazorHotReloadJS()
{
var jsFileName = "Microsoft.AspNetCore.Watch.BrowserRefresh.BlazorHotReload.js";
var jsFileName = "BlazorHotReload.js";
using var stream = new MemoryStream();
var manifestStream = typeof(BrowserScriptMiddleware).Assembly.GetManifestResourceStream(jsFileName)!;
manifestStream.CopyTo(stream);
Expand All @@ -66,7 +66,7 @@ internal static ReadOnlyMemory<byte> GetBrowserRefreshJS()

internal static ReadOnlyMemory<byte> GetWebSocketClientJavaScript(string hostString, string serverKey)
{
var jsFileName = "Microsoft.AspNetCore.Watch.BrowserRefresh.WebSocketScriptInjection.js";
var jsFileName = "WebSocketScriptInjection.js";
using var reader = new StreamReader(typeof(BrowserScriptMiddleware).Assembly.GetManifestResourceStream(jsFileName)!);
var script = reader.ReadToEnd()
.Replace("{{hostString}}", hostString)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,19 @@
<ItemGroup>
<Using Remove="@(Using)" />
</ItemGroup>

<PropertyGroup>
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);_AddJSFilesToSourcePackage</TargetsForTfmSpecificContentInPackage>
</PropertyGroup>

<!--
Add .js files as embedded resources in the source package.
-->
<Target Name="_AddJSFilesToSourcePackage">
<ItemGroup>
<!-- Must be in 'cs' directory since NuGet filters the files based on consuming project language -->
<_File Include="$(MSBuildProjectDirectory)\**\*.js" TargetDir="contentFiles/cs/$(TargetFramework)" BuildAction="EmbeddedResource" />
<TfmSpecificPackageFile Include="@(_File)" PackagePath="%(_File.TargetDir)/%(_File.RecursiveDir)%(_File.FileName)%(_File.Extension)"/>
</ItemGroup>
</Target>
</Project>
Loading
Loading