зеркало из https://github.com/dotnet/aspnetcore.git
Merge branch 'release/5.0-rc2' into master
This commit is contained in:
Коммит
2b6cd9f606
|
@ -51,6 +51,8 @@ variables:
|
|||
/p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines)
|
||||
/p:DotNetArtifactsCategory=$(_DotNetArtifactsCategory)
|
||||
# Do not log most Windows steps in official builds; this is the slowest job. Site extensions step always logs.
|
||||
- name: WindowsArm64LogArgs
|
||||
value: -ExcludeCIBinaryLog
|
||||
- name: Windows64LogArgs
|
||||
value: -ExcludeCIBinaryLog
|
||||
- name: Windows86LogArgs
|
||||
|
@ -59,12 +61,16 @@ variables:
|
|||
value: -ExcludeCIBinaryLog
|
||||
- name: WindowsInstallersLogArgs
|
||||
value: -ExcludeCIBinaryLog
|
||||
- name: WindowsArm64InstallersLogArgs
|
||||
value: -ExcludeCIBinaryLog
|
||||
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
- name: _BuildArgs
|
||||
value: '/p:SkipTestBuild=true'
|
||||
- name: _PublishArgs
|
||||
value: ''
|
||||
# Write binary logs for all main Windows build steps except the x86 one in public and PR builds.
|
||||
- name: WindowsArm64LogArgs
|
||||
value: /bl:artifacts/log/Release/Build.arm64.binlog
|
||||
- name: Windows64LogArgs
|
||||
value: /bl:artifacts/log/Release/Build.x64.binlog
|
||||
- name: Windows86LogArgs
|
||||
|
@ -73,6 +79,8 @@ variables:
|
|||
value: /bl:artifacts/log/Release/Build.CodeSign.binlog
|
||||
- name: WindowsInstallersLogArgs
|
||||
value: /bl:artifacts/log/Release/Build.Installers.binlog
|
||||
- name: WindowsArm64InstallersLogArgs
|
||||
value: /bl:artifacts/log/Release/Build.Installers.Arm64.binlog
|
||||
- ${{ if ne(variables['System.TeamProject'], 'internal') }}:
|
||||
- name: _UseHelixOpenQueues
|
||||
value: 'true'
|
||||
|
@ -210,7 +218,7 @@ stages:
|
|||
displayName: Build Installers
|
||||
|
||||
# A few files must also go to the VS package feed.
|
||||
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), ne(variables['PostBuildSign'], 'true')) }}:
|
||||
- task: NuGetCommand@2
|
||||
displayName: Push Visual Studio packages
|
||||
inputs:
|
||||
|
@ -263,18 +271,6 @@ stages:
|
|||
jobName: Windows_arm64_build
|
||||
jobDisplayName: "Build: Windows ARM64"
|
||||
agentOs: Windows
|
||||
buildArgs:
|
||||
-arch arm64
|
||||
-sign
|
||||
-pack
|
||||
-noBuildNodeJS
|
||||
-noBuildJava
|
||||
/p:DotNetSignType=$(_SignType)
|
||||
/p:OnlyPackPlatformSpecificPackages=true
|
||||
/p:AssetManifestFileName=aspnetcore-win-arm64.xml
|
||||
$(_BuildArgs)
|
||||
$(_PublishArgs)
|
||||
$(_InternalRuntimeDownloadArgs)
|
||||
installNodeJs: false
|
||||
installJdk: false
|
||||
artifacts:
|
||||
|
@ -286,6 +282,47 @@ stages:
|
|||
path: artifacts/packages/
|
||||
- name: Windows_arm64_Installers
|
||||
path: artifacts/installers/
|
||||
steps:
|
||||
- script: ./build.cmd
|
||||
-ci
|
||||
-arch arm64
|
||||
-sign
|
||||
-pack
|
||||
-noBuildJava
|
||||
-noBuildNative
|
||||
/p:DotNetSignType=$(_SignType)
|
||||
/p:OnlyPackPlatformSpecificPackages=true
|
||||
$(_BuildArgs)
|
||||
$(_InternalRuntimeDownloadArgs)
|
||||
$(WindowsArm64LogArgs)
|
||||
displayName: Build ARM64
|
||||
|
||||
# Windows installers bundle for arm64
|
||||
- script: ./build.cmd
|
||||
-ci
|
||||
-noBuildRepoTasks
|
||||
-arch arm64
|
||||
-sign
|
||||
-buildInstallers
|
||||
-noBuildNative
|
||||
/p:DotNetSignType=$(_SignType)
|
||||
/p:AssetManifestFileName=aspnetcore-win-arm64.xml
|
||||
$(_BuildArgs)
|
||||
$(_PublishArgs)
|
||||
$(_InternalRuntimeDownloadArgs)
|
||||
$(WindowsArm64InstallersLogArgs)
|
||||
displayName: Build Arm64 Installers
|
||||
|
||||
# A few files must also go to the VS package feed.
|
||||
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
- task: NuGetCommand@2
|
||||
displayName: Push Visual Studio packages
|
||||
inputs:
|
||||
command: push
|
||||
packagesToPush: 'artifacts/packages/**/VS.Redist.Common.AspNetCore.*.nupkg'
|
||||
nuGetFeedType: external
|
||||
publishFeedCredentials: 'DevDiv - VS package feed'
|
||||
|
||||
|
||||
# Build MacOS
|
||||
- template: jobs/default-build.yml
|
||||
|
@ -713,6 +750,7 @@ stages:
|
|||
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
- template: /eng/common/templates/post-build/post-build.yml
|
||||
parameters:
|
||||
publishingInfraVersion: 3
|
||||
enableSymbolValidation: false
|
||||
enableSigningValidation: false
|
||||
enableNugetValidation: false
|
||||
|
|
117
AspNetCore.sln
117
AspNetCore.sln
|
@ -1507,6 +1507,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.App.Un
|
|||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Localization", "Localization", "{3D34C81F-2CB5-459E-87E9-0CC04757A2A0}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GlobalizationWasmApp", "src\Components\test\testassets\GlobalizationWasmApp\GlobalizationWasmApp.csproj", "{04CFE286-6D32-41EF-8887-4B5F8086A365}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Localization.Abstractions", "src\Localization\Abstractions\src\Microsoft.Extensions.Localization.Abstractions.csproj", "{FEF97646-9BC9-4D1B-A939-784D915C18A4}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Localization", "src\Localization\Localization\src\Microsoft.Extensions.Localization.csproj", "{839CE175-E0D9-43B9-9FA8-F32C47E7F56B}"
|
||||
|
@ -1521,6 +1523,26 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Loggin
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Logging.AzureAppServices.Tests", "src\Logging.AzureAppServices\test\Microsoft.Extensions.Logging.AzureAppServices.Tests.csproj", "{43E3B132-2486-44A3-92C6-39E39724FAFD}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SiteExtensions", "SiteExtensions", "{DFC4F588-B4B4-484B-AB93-B36721374AD3}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "LoggingAggregate", "LoggingAggregate", "{48FF1D87-5066-4294-B802-2D1B478C6EB6}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.AzureAppServices.SiteExtension", "src\SiteExtensions\LoggingAggregate\src\Microsoft.AspNetCore.AzureAppServices.SiteExtension\Microsoft.AspNetCore.AzureAppServices.SiteExtension.csproj", "{563A3FFA-32DA-4ADA-891C-E00897BD919E}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.AzureAppServices.SiteExtension.Tests", "src\SiteExtensions\LoggingAggregate\test\Microsoft.AspNetCore.AzureAppServices.SiteExtension.Tests\Microsoft.AspNetCore.AzureAppServices.SiteExtension.Tests.csproj", "{DC5DE087-5C93-4441-9D62-1743A50E5086}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LB", "src\SiteExtensions\LoggingBranch\LB.csproj", "{F00CE8C1-5715-4683-A8E5-C467B712AD46}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.Web.Xdt.Extensions", "Microsoft.Web.Xdt.Extensions", "{56B45580-B089-424E-A847-A6115D591950}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Web.Xdt.Extensions", "src\SiteExtensions\Microsoft.Web.Xdt.Extensions\src\Microsoft.Web.Xdt.Extensions.csproj", "{4382555A-E4CD-4DFC-B59B-408FD4E93530}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Web.Xdt.Extensions.Tests", "src\SiteExtensions\Microsoft.Web.Xdt.Extensions\tests\Microsoft.Web.Xdt.Extensions.Tests.csproj", "{545751D5-71FC-4889-A3A0-BBD731DBA18A}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sdk", "Sdk", "{E83B0BCC-A8E0-4FBD-BE51-9A533C9CB972}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HostingStartup", "src\SiteExtensions\Sdk\HostingStartup\HostingStartup.csproj", "{5D6F99C5-D292-4459-B8BD-8E4AD42E1B21}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -7193,6 +7215,18 @@ Global
|
|||
{BAD47859-95DF-4C8F-9AF7-C48B68F478A1}.Release|x64.Build.0 = Release|Any CPU
|
||||
{BAD47859-95DF-4C8F-9AF7-C48B68F478A1}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{BAD47859-95DF-4C8F-9AF7-C48B68F478A1}.Release|x86.Build.0 = Release|Any CPU
|
||||
{04CFE286-6D32-41EF-8887-4B5F8086A365}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{04CFE286-6D32-41EF-8887-4B5F8086A365}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{04CFE286-6D32-41EF-8887-4B5F8086A365}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{04CFE286-6D32-41EF-8887-4B5F8086A365}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{04CFE286-6D32-41EF-8887-4B5F8086A365}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{04CFE286-6D32-41EF-8887-4B5F8086A365}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{04CFE286-6D32-41EF-8887-4B5F8086A365}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{04CFE286-6D32-41EF-8887-4B5F8086A365}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{04CFE286-6D32-41EF-8887-4B5F8086A365}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{04CFE286-6D32-41EF-8887-4B5F8086A365}.Release|x64.Build.0 = Release|Any CPU
|
||||
{04CFE286-6D32-41EF-8887-4B5F8086A365}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{04CFE286-6D32-41EF-8887-4B5F8086A365}.Release|x86.Build.0 = Release|Any CPU
|
||||
{010A9638-F20E-4FE6-A186-85732BFC9CB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{010A9638-F20E-4FE6-A186-85732BFC9CB0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{010A9638-F20E-4FE6-A186-85732BFC9CB0}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
|
@ -7277,6 +7311,78 @@ Global
|
|||
{43E3B132-2486-44A3-92C6-39E39724FAFD}.Release|x64.Build.0 = Release|Any CPU
|
||||
{43E3B132-2486-44A3-92C6-39E39724FAFD}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{43E3B132-2486-44A3-92C6-39E39724FAFD}.Release|x86.Build.0 = Release|Any CPU
|
||||
{563A3FFA-32DA-4ADA-891C-E00897BD919E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{563A3FFA-32DA-4ADA-891C-E00897BD919E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{563A3FFA-32DA-4ADA-891C-E00897BD919E}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{563A3FFA-32DA-4ADA-891C-E00897BD919E}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{563A3FFA-32DA-4ADA-891C-E00897BD919E}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{563A3FFA-32DA-4ADA-891C-E00897BD919E}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{563A3FFA-32DA-4ADA-891C-E00897BD919E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{563A3FFA-32DA-4ADA-891C-E00897BD919E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{563A3FFA-32DA-4ADA-891C-E00897BD919E}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{563A3FFA-32DA-4ADA-891C-E00897BD919E}.Release|x64.Build.0 = Release|Any CPU
|
||||
{563A3FFA-32DA-4ADA-891C-E00897BD919E}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{563A3FFA-32DA-4ADA-891C-E00897BD919E}.Release|x86.Build.0 = Release|Any CPU
|
||||
{DC5DE087-5C93-4441-9D62-1743A50E5086}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DC5DE087-5C93-4441-9D62-1743A50E5086}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DC5DE087-5C93-4441-9D62-1743A50E5086}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{DC5DE087-5C93-4441-9D62-1743A50E5086}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{DC5DE087-5C93-4441-9D62-1743A50E5086}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{DC5DE087-5C93-4441-9D62-1743A50E5086}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{DC5DE087-5C93-4441-9D62-1743A50E5086}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DC5DE087-5C93-4441-9D62-1743A50E5086}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DC5DE087-5C93-4441-9D62-1743A50E5086}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{DC5DE087-5C93-4441-9D62-1743A50E5086}.Release|x64.Build.0 = Release|Any CPU
|
||||
{DC5DE087-5C93-4441-9D62-1743A50E5086}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{DC5DE087-5C93-4441-9D62-1743A50E5086}.Release|x86.Build.0 = Release|Any CPU
|
||||
{F00CE8C1-5715-4683-A8E5-C467B712AD46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F00CE8C1-5715-4683-A8E5-C467B712AD46}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F00CE8C1-5715-4683-A8E5-C467B712AD46}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{F00CE8C1-5715-4683-A8E5-C467B712AD46}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{F00CE8C1-5715-4683-A8E5-C467B712AD46}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{F00CE8C1-5715-4683-A8E5-C467B712AD46}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{F00CE8C1-5715-4683-A8E5-C467B712AD46}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F00CE8C1-5715-4683-A8E5-C467B712AD46}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F00CE8C1-5715-4683-A8E5-C467B712AD46}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{F00CE8C1-5715-4683-A8E5-C467B712AD46}.Release|x64.Build.0 = Release|Any CPU
|
||||
{F00CE8C1-5715-4683-A8E5-C467B712AD46}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{F00CE8C1-5715-4683-A8E5-C467B712AD46}.Release|x86.Build.0 = Release|Any CPU
|
||||
{4382555A-E4CD-4DFC-B59B-408FD4E93530}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4382555A-E4CD-4DFC-B59B-408FD4E93530}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4382555A-E4CD-4DFC-B59B-408FD4E93530}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{4382555A-E4CD-4DFC-B59B-408FD4E93530}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{4382555A-E4CD-4DFC-B59B-408FD4E93530}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{4382555A-E4CD-4DFC-B59B-408FD4E93530}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{4382555A-E4CD-4DFC-B59B-408FD4E93530}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4382555A-E4CD-4DFC-B59B-408FD4E93530}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{4382555A-E4CD-4DFC-B59B-408FD4E93530}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{4382555A-E4CD-4DFC-B59B-408FD4E93530}.Release|x64.Build.0 = Release|Any CPU
|
||||
{4382555A-E4CD-4DFC-B59B-408FD4E93530}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{4382555A-E4CD-4DFC-B59B-408FD4E93530}.Release|x86.Build.0 = Release|Any CPU
|
||||
{545751D5-71FC-4889-A3A0-BBD731DBA18A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{545751D5-71FC-4889-A3A0-BBD731DBA18A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{545751D5-71FC-4889-A3A0-BBD731DBA18A}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{545751D5-71FC-4889-A3A0-BBD731DBA18A}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{545751D5-71FC-4889-A3A0-BBD731DBA18A}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{545751D5-71FC-4889-A3A0-BBD731DBA18A}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{545751D5-71FC-4889-A3A0-BBD731DBA18A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{545751D5-71FC-4889-A3A0-BBD731DBA18A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{545751D5-71FC-4889-A3A0-BBD731DBA18A}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{545751D5-71FC-4889-A3A0-BBD731DBA18A}.Release|x64.Build.0 = Release|Any CPU
|
||||
{545751D5-71FC-4889-A3A0-BBD731DBA18A}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{545751D5-71FC-4889-A3A0-BBD731DBA18A}.Release|x86.Build.0 = Release|Any CPU
|
||||
{5D6F99C5-D292-4459-B8BD-8E4AD42E1B21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{5D6F99C5-D292-4459-B8BD-8E4AD42E1B21}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5D6F99C5-D292-4459-B8BD-8E4AD42E1B21}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{5D6F99C5-D292-4459-B8BD-8E4AD42E1B21}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{5D6F99C5-D292-4459-B8BD-8E4AD42E1B21}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{5D6F99C5-D292-4459-B8BD-8E4AD42E1B21}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{5D6F99C5-D292-4459-B8BD-8E4AD42E1B21}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5D6F99C5-D292-4459-B8BD-8E4AD42E1B21}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{5D6F99C5-D292-4459-B8BD-8E4AD42E1B21}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{5D6F99C5-D292-4459-B8BD-8E4AD42E1B21}.Release|x64.Build.0 = Release|Any CPU
|
||||
{5D6F99C5-D292-4459-B8BD-8E4AD42E1B21}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{5D6F99C5-D292-4459-B8BD-8E4AD42E1B21}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -8029,6 +8135,7 @@ Global
|
|||
{37329855-01B8-4B03-9765-1A941B06E43C} = {8C15FD04-7F90-43FC-B488-023432FE3CE1}
|
||||
{D3246226-BC1A-47F1-8E3E-C3380A8F13FB} = {8C15FD04-7F90-43FC-B488-023432FE3CE1}
|
||||
{B06ADD57-E855-4D8C-85DC-B323509AE540} = {898F7E0B-1671-42CB-9DFB-689AFF212ED3}
|
||||
{04CFE286-6D32-41EF-8887-4B5F8086A365} = {6126DCE4-9692-4EE2-B240-C65743572995}
|
||||
{BAD47859-95DF-4C8F-9AF7-C48B68F478A1} = {A4C26078-B6D8-4FD8-87A6-7C15A3482038}
|
||||
{010A9638-F20E-4FE6-A186-85732BFC9CB0} = {A4C26078-B6D8-4FD8-87A6-7C15A3482038}
|
||||
{3D34C81F-2CB5-459E-87E9-0CC04757A2A0} = {017429CC-C5FB-48B4-9C46-034E29EE2F06}
|
||||
|
@ -8039,6 +8146,16 @@ Global
|
|||
{3EAB9890-2C01-444C-ACA0-D77B29CDE08B} = {017429CC-C5FB-48B4-9C46-034E29EE2F06}
|
||||
{3E29454A-C4DC-44B7-AF0A-A782AD2E73BC} = {3EAB9890-2C01-444C-ACA0-D77B29CDE08B}
|
||||
{43E3B132-2486-44A3-92C6-39E39724FAFD} = {3EAB9890-2C01-444C-ACA0-D77B29CDE08B}
|
||||
{DFC4F588-B4B4-484B-AB93-B36721374AD3} = {017429CC-C5FB-48B4-9C46-034E29EE2F06}
|
||||
{48FF1D87-5066-4294-B802-2D1B478C6EB6} = {DFC4F588-B4B4-484B-AB93-B36721374AD3}
|
||||
{563A3FFA-32DA-4ADA-891C-E00897BD919E} = {48FF1D87-5066-4294-B802-2D1B478C6EB6}
|
||||
{DC5DE087-5C93-4441-9D62-1743A50E5086} = {48FF1D87-5066-4294-B802-2D1B478C6EB6}
|
||||
{F00CE8C1-5715-4683-A8E5-C467B712AD46} = {DFC4F588-B4B4-484B-AB93-B36721374AD3}
|
||||
{56B45580-B089-424E-A847-A6115D591950} = {DFC4F588-B4B4-484B-AB93-B36721374AD3}
|
||||
{4382555A-E4CD-4DFC-B59B-408FD4E93530} = {56B45580-B089-424E-A847-A6115D591950}
|
||||
{545751D5-71FC-4889-A3A0-BBD731DBA18A} = {56B45580-B089-424E-A847-A6115D591950}
|
||||
{E83B0BCC-A8E0-4FBD-BE51-9A533C9CB972} = {DFC4F588-B4B4-484B-AB93-B36721374AD3}
|
||||
{5D6F99C5-D292-4459-B8BD-8E4AD42E1B21} = {E83B0BCC-A8E0-4FBD-BE51-9A533C9CB972}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {3E8720B3-DBDD-498C-B383-2CC32A054E8F}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
<IsBenchmarkProject Condition="$(MSBuildProjectName.EndsWith('.Performance')) OR $(RepoRelativeProjectDir.Contains('perf')) OR $(RepoRelativeProjectDir.Contains('benchmarkapps'))">true</IsBenchmarkProject>
|
||||
<IsSpecificationTestProject Condition="$(MSBuildProjectName.EndsWith('.Specification.Tests'))">true</IsSpecificationTestProject>
|
||||
<IsUnitTestProject>false</IsUnitTestProject>
|
||||
<IsUnitTestProject Condition=" '$(IsUnitTestProject)' == '' ">false</IsUnitTestProject>
|
||||
<IsUnitTestProject Condition="'$(IsSpecificationTestProject)' != 'true' and ( $(MSBuildProjectName.EndsWith('Tests')) or $(MSBuildProjectName.EndsWith('.Test')) or $(MSBuildProjectName.EndsWith('.FunctionalTest')) )">true</IsUnitTestProject>
|
||||
<IsTestAssetProject Condition="$(RepoRelativeProjectDir.Contains('testassets'))">true</IsTestAssetProject>
|
||||
<IsSampleProject Condition="$(RepoRelativeProjectDir.Contains('sample'))">true</IsSampleProject>
|
||||
|
|
|
@ -36,13 +36,15 @@
|
|||
<SiteExtensionPackageVersion Condition=" '$(VersionSuffix)' != '' ">$(VersionPrefix)-$(VersionSuffix.Replace('.','-'))</SiteExtensionPackageVersion>
|
||||
|
||||
<PackageVersion Condition=" '$(PackageVersion)' == '' ">$(Version)</PackageVersion>
|
||||
<PackageVersion Condition=" '$(NoSemVer20)' == 'true' ">$(SiteExtensionPackageVersion)</PackageVersion>
|
||||
|
||||
<SharedFxVersion>$(PackageVersion)</SharedFxVersion>
|
||||
<SharedFxVersion Condition=" '$(StabilizePackageVersion)' == 'true' ">$(VersionPrefix)</SharedFxVersion>
|
||||
<SharedFxProductName>$(Product) $(SharedFxVersion) Shared Framework</SharedFxProductName>
|
||||
|
||||
<TargetingPackVersion>$(TargetingPackVersionPrefix)</TargetingPackVersion>
|
||||
<TargetingPackVersion Condition=" '$(VersionSuffix)' != '' ">$(TargetingPackVersionPrefix)-$(VersionSuffix)</TargetingPackVersion>
|
||||
<TargetingPackVersion>$(SharedFxVersion)</TargetingPackVersion>
|
||||
<TargetingPackVersion Condition=" ! $(IsTargetingPackBuilding) ">$(TargetingPackVersionPrefix)</TargetingPackVersion>
|
||||
|
||||
<SharedFxProductName>$(Product) $(PackageVersion) Shared Framework</SharedFxProductName>
|
||||
<PackageVersion Condition=" '$(NoSemVer20)' == 'true' ">$(SiteExtensionPackageVersion)</PackageVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
@ -156,7 +158,7 @@
|
|||
<KnownFrameworkReference Condition="'$(UseAspNetCoreSharedRuntime)' == 'true' AND '$(DoNotApplyWorkaroundsToMicrosoftAspNetCoreApp)' != 'true'" Update="Microsoft.AspNetCore.App">
|
||||
<LatestRuntimeFrameworkVersion>$(SharedFxVersion)</LatestRuntimeFrameworkVersion>
|
||||
<DefaultRuntimeFrameworkVersion Condition="'$(IsServicingBuild)' != 'true'">$(SharedFxVersion)</DefaultRuntimeFrameworkVersion>
|
||||
<TargetingPackVersion Condition="'$(IsServicingBuild)' != 'true'">$(SharedFxVersion)</TargetingPackVersion>
|
||||
<TargetingPackVersion Condition="'$(IsServicingBuild)' != 'true'">$(TargetingPackVersion)</TargetingPackVersion>
|
||||
</KnownFrameworkReference>
|
||||
|
||||
<!-- Track compiler separately from Arcade.-->
|
||||
|
|
|
@ -296,12 +296,11 @@ if ($BuildNodeJS) { $dotnetBuildArguments += "/p:BuildNodeJS=true" }
|
|||
# Don't bother with two builds if just one will build everything. Ignore super-weird cases like
|
||||
# "-Projects ... -NoBuildJava -NoBuildManaged -NoBuildNodeJS". An empty `./build.ps1` command will build both
|
||||
# managed and native projects.
|
||||
$performDesktopBuild = ($BuildInstallers -or $BuildNative) -and `
|
||||
-not $Architecture.StartsWith("arm", [System.StringComparison]::OrdinalIgnoreCase)
|
||||
$performDesktopBuild = ($BuildInstallers -and $Architecture -ne "arm") -or `
|
||||
($BuildNative -and -not $Architecture.StartsWith("arm", [System.StringComparison]::OrdinalIgnoreCase))
|
||||
$performDotnetBuild = $BuildJava -or $BuildManaged -or $BuildNodeJS -or `
|
||||
($All -and -not ($NoBuildJava -and $NoBuildManaged -and $NoBuildNodeJS)) -or `
|
||||
($Projects -and -not ($BuildInstallers -or $specifiedBuildNative))
|
||||
|
||||
$foundJdk = $false
|
||||
$javac = Get-Command javac -ErrorAction Ignore -CommandType Application
|
||||
$localJdkPath = "$PSScriptRoot\.tools\jdk\win-x64\"
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
$(RepoRoot)src\Installers\**\*.*proj;
|
||||
$(RepoRoot)src\SignalR\clients\ts\**\node_modules\**\*.*proj;
|
||||
$(RepoRoot)src\Components\Web.JS\node_modules\**\*.*proj;
|
||||
$(RepoRoot)src\Components\WebAssembly\Build\testassets\**\*.csproj;
|
||||
$(RepoRoot)src\Components\WebAssembly\Sdk\testassets\**\*.csproj;
|
||||
$(RepoRoot)src\ProjectTemplates\Web.ProjectTemplates\content\**\*.csproj;
|
||||
$(RepoRoot)src\ProjectTemplates\Web.ProjectTemplates\content\**\*.fsproj;
|
||||
$(RepoRoot)src\ProjectTemplates\Web.Spa.ProjectTemplates\content\**\*.csproj;
|
||||
|
@ -50,7 +50,7 @@
|
|||
</ItemGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<ItemGroup Condition=" '$(BuildInstallers)' == 'true' AND '$(TargetOsName)' == 'win' ">
|
||||
<ItemGroup Condition=" '$(BuildInstallers)' == 'true' AND '$(TargetOsName)' == 'win' AND ('$(TargetArchitecture)' == 'x86' OR '$(TargetArchitecture)' == 'x64') ">
|
||||
<!-- Build the ANCM custom action -->
|
||||
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\CustomAction\aspnetcoreCA.vcxproj" AdditionalProperties="Platform=x64" />
|
||||
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\CustomAction\aspnetcoreCA.vcxproj" AdditionalProperties="Platform=Win32" />
|
||||
|
@ -64,6 +64,10 @@
|
|||
<!-- Build the targeting pack installers -->
|
||||
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\TargetingPack\TargetingPack.wixproj" AdditionalProperties="Platform=x64" />
|
||||
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\TargetingPack\TargetingPack.wixproj" AdditionalProperties="Platform=x86" />
|
||||
<!-- This really shouldn't be here, but instead of harvesting from the intermediate/output directories, the targetting pack installer logic
|
||||
harvests from a zip of the reference assemblies. Producing it in each leg ends up with multiple targeting packs
|
||||
getting produced and the BAR will reject the build. Centralize building the targeting pack in the x86/x64 leg. -->
|
||||
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\TargetingPack\TargetingPack.wixproj" AdditionalProperties="Platform=arm64" />
|
||||
|
||||
<!-- Build the SharedFramework installers -->
|
||||
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkBundle\SharedFrameworkBundle.wixproj" AdditionalProperties="Platform=x64" />
|
||||
|
@ -77,6 +81,14 @@
|
|||
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\WindowsHostingBundle\WindowsHostingBundle.wixproj" AdditionalProperties="Platform=x86" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(BuildInstallers)' == 'true' AND '$(TargetOsName)' == 'win' AND '$(TargetArchitecture)' == 'arm64' ">
|
||||
<!-- We don't build the bundle here because we'd have to bundle the x86 installer which gets built in a different leg.
|
||||
Instead we only provide the ARM64 MSI-->
|
||||
|
||||
<!-- Build the SharedFramework wixlib -->
|
||||
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkLib\SharedFrameworkLib.wixproj" AdditionalProperties="Platform=arm64" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(BuildInstallers)' == 'true' AND '$(TargetRuntimeIdentifier)' == 'linux-x64'">
|
||||
<ProjectToBuild Condition=" '$(LinuxInstallerType)' == 'deb' "
|
||||
Include="$(RepoRoot)src\Installers\Debian\**\*.*proj" />
|
||||
|
|
|
@ -73,8 +73,6 @@ and are generated based on the last package release.
|
|||
<LatestPackageReference Include="System.Reflection.Metadata" />
|
||||
<LatestPackageReference Include="System.Runtime.CompilerServices.Unsafe" />
|
||||
<LatestPackageReference Include="System.Runtime.InteropServices.RuntimeInformation" />
|
||||
<!-- System.Security.AccessControl should only be referenced in Dependencies.props and RTMVersions.csproj. -->
|
||||
<LatestPackageReference Include="System.Security.AccessControl" />
|
||||
<LatestPackageReference Include="System.Security.Cryptography.Cng" />
|
||||
<LatestPackageReference Include="System.Security.Cryptography.Pkcs" />
|
||||
<LatestPackageReference Include="System.Security.Cryptography.Xml" />
|
||||
|
@ -168,7 +166,6 @@ and are generated based on the last package release.
|
|||
<LatestPackageReference Include="MessagePack" />
|
||||
<LatestPackageReference Include="MessagePackAnalyzer" />
|
||||
<LatestPackageReference Include="Microsoft.Data.SqlClient" />
|
||||
<LatestPackageReference Include="Microsoft.Identity.Web.UI" />
|
||||
<LatestPackageReference Include="Mono.Cecil" />
|
||||
<LatestPackageReference Include="Moq" />
|
||||
<LatestPackageReference Include="Newtonsoft.Json.Bson" />
|
||||
|
@ -197,11 +194,6 @@ and are generated based on the last package release.
|
|||
<!-- Get versions. -->
|
||||
<LatestPackageReference Update="@(LatestPackageReference)">
|
||||
<Version>$(%(VersionName)PackageVersion)</Version>
|
||||
<RTMVersion>$(%(VersionName)V0PackageVersion)</RTMVersion>
|
||||
|
||||
<!-- Remove excess metadata. -->
|
||||
<RTMVersion Condition=" '%(Version)' == '%(RTMVersion)' " />
|
||||
<VersionName />
|
||||
</LatestPackageReference>
|
||||
|
||||
<!--
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<PublishingVersion>3</PublishingVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- The one use of ArtifactsDir in Publish.proj adds an additional slash, confusing itself. -->
|
||||
<ArtifactsDir Condition=" HasTrailingSlash('$(ArtifactsDir)') ">$(ArtifactsDir.Substring(0, $([MSBuild]::Subtract($(ArtifactsDir.Length), 1))))</ArtifactsDir>
|
||||
|
|
|
@ -160,36 +160,6 @@
|
|||
-->
|
||||
<MicrosoftNETCoreAppRuntimeVersion>$(MicrosoftNETCoreAppRuntimewinx64PackageVersion)</MicrosoftNETCoreAppRuntimeVersion>
|
||||
</PropertyGroup>
|
||||
<!--
|
||||
We ship ref/ assemblies for runtime packages in our targeting targeting pack. When servicing that targeting pack,
|
||||
these assemblies must not change. Must also compile our assemblies against the initial ref/ assemblies for runtime
|
||||
packages. But, need to test against the latest implementation assemblies and ship them in our shared framework.
|
||||
Upshot is we need Major.Minor.0 runtime packages for compilation and the targeting pack and Major.Minor.Latest
|
||||
runtime packages for everything else. This is not an issue for assemblies available in Microsoft.NETCore.App.Ref or
|
||||
Microsoft.Extensions.Internal.Transport because it is next to impossible we would service those packages.
|
||||
|
||||
System.Security.AccessControl should only be referenced in Dependencies.props and RTMVersions.csproj. Because
|
||||
it's a transitive reference, we reship the ref/ assembly in Microsoft.AspNetCore.App.Ref. dotnet/runtime ships
|
||||
the implementation assemblies in Microsoft.NETCore.App.Runtime.* packages.
|
||||
|
||||
If testing this configuration prior to servicing, update the versions of dependencies too. E.g. change
|
||||
`$(SystemSecurityPrincipalWindowsV0PackageVersion)` if you change `$(SystemSecurityAccessControlV0PackageVersion)`
|
||||
because System.Security.AccessControl will otherwise be loadable. This should not be necessary in servicing.
|
||||
-->
|
||||
<PropertyGroup Condition=" '$(IsServicingBuild)' == 'true' ">
|
||||
<MicrosoftWin32RegistryV0PackageVersion>$(MicrosoftWin32RegistryPackageVersion.Split('.')[0]).$(MicrosoftWin32RegistryPackageVersion.Split('.')[1]).0</MicrosoftWin32RegistryV0PackageVersion>
|
||||
<MicrosoftWin32SystemEventsV0PackageVersion>$(MicrosoftWin32SystemEventsPackageVersion.Split('.')[0]).$(MicrosoftWin32SystemEventsPackageVersion.Split('.')[1]).0</MicrosoftWin32SystemEventsV0PackageVersion>
|
||||
<SystemDiagnosticsEventLogV0PackageVersion>$(SystemDiagnosticsEventLogPackageVersion.Split('.')[0]).$(SystemDiagnosticsEventLogPackageVersion.Split('.')[1]).0</SystemDiagnosticsEventLogV0PackageVersion>
|
||||
<SystemDrawingCommonV0PackageVersion>$(SystemDrawingCommonPackageVersion.Split('.')[0]).$(SystemDrawingCommonPackageVersion.Split('.')[1]).0</SystemDrawingCommonV0PackageVersion>
|
||||
<SystemIOPipelinesV0PackageVersion>$(SystemIOPipelinesPackageVersion.Split('.')[0]).$(SystemIOPipelinesPackageVersion.Split('.')[1]).0</SystemIOPipelinesV0PackageVersion>
|
||||
<SystemSecurityAccessControlV0PackageVersion>$(SystemSecurityAccessControlPackageVersion.Split('.')[0]).$(SystemSecurityAccessControlPackageVersion.Split('.')[1]).0</SystemSecurityAccessControlV0PackageVersion>
|
||||
<SystemSecurityCryptographyCngV0PackageVersion>$(SystemSecurityCryptographyCngPackageVersion.Split('.')[0]).$(SystemSecurityCryptographyCngPackageVersion.Split('.')[1]).0</SystemSecurityCryptographyCngV0PackageVersion>
|
||||
<SystemSecurityCryptographyPkcsV0PackageVersion>$(SystemSecurityCryptographyPkcsPackageVersion.Split('.')[0]).$(SystemSecurityCryptographyPkcsPackageVersion.Split('.')[1]).0</SystemSecurityCryptographyPkcsV0PackageVersion>
|
||||
<SystemSecurityCryptographyXmlV0PackageVersion>$(SystemSecurityCryptographyXmlPackageVersion.Split('.')[0]).$(SystemSecurityCryptographyXmlPackageVersion.Split('.')[1]).0</SystemSecurityCryptographyXmlV0PackageVersion>
|
||||
<SystemSecurityPermissionsV0PackageVersion>$(SystemSecurityPermissionsPackageVersion.Split('.')[0]).$(SystemSecurityPermissionsPackageVersion.Split('.')[1]).0</SystemSecurityPermissionsV0PackageVersion>
|
||||
<SystemSecurityPrincipalWindowsV0PackageVersion>$(SystemSecurityPrincipalWindowsPackageVersion.Split('.')[0]).$(SystemSecurityPrincipalWindowsPackageVersion.Split('.')[1]).0</SystemSecurityPrincipalWindowsV0PackageVersion>
|
||||
<SystemWindowsExtensionsV0PackageVersion>$(SystemWindowsExtensionsPackageVersion.Split('.')[0]).$(SystemWindowsExtensionsPackageVersion.Split('.')[1]).0</SystemWindowsExtensionsV0PackageVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Manual">
|
||||
<!-- Packages from dotnet/roslyn -->
|
||||
<MicrosoftNetCompilersToolsetPackageVersion>3.8.0-3.20458.6</MicrosoftNetCompilersToolsetPackageVersion>
|
||||
|
@ -241,7 +211,8 @@
|
|||
<SystemIdentityModelTokensJwtPackageVersion>6.7.1</SystemIdentityModelTokensJwtPackageVersion>
|
||||
<!-- Packages from 2.1, 3.1, and 5.0 branches used for site extension build. -->
|
||||
<MicrosoftAspNetCoreAzureAppServicesSiteExtension21PackageVersion>2.1.1</MicrosoftAspNetCoreAzureAppServicesSiteExtension21PackageVersion>
|
||||
<MicrosoftAspNetCoreAzureAppServicesSiteExtension31PackageVersion>3.1.7-servicing-20372-13</MicrosoftAspNetCoreAzureAppServicesSiteExtension31PackageVersion>
|
||||
<MicrosoftAspNetCoreAzureAppServicesSiteExtension22PackageVersion>2.2.0</MicrosoftAspNetCoreAzureAppServicesSiteExtension22PackageVersion>
|
||||
<MicrosoftAspNetCoreAzureAppServicesSiteExtension31PackageVersion>3.1.8-servicing-20421-6</MicrosoftAspNetCoreAzureAppServicesSiteExtension31PackageVersion>
|
||||
<MicrosoftAspNetCoreAzureAppServicesSiteExtension31x64PackageVersion>$(MicrosoftAspNetCoreAzureAppServicesSiteExtension31PackageVersion)</MicrosoftAspNetCoreAzureAppServicesSiteExtension31x64PackageVersion>
|
||||
<MicrosoftAspNetCoreAzureAppServicesSiteExtension31x86PackageVersion>$(MicrosoftAspNetCoreAzureAppServicesSiteExtension31PackageVersion)</MicrosoftAspNetCoreAzureAppServicesSiteExtension31x86PackageVersion>
|
||||
<MicrosoftAspNetCoreAzureAppServicesSiteExtension50PackageVersion>5.0.0-preview-7-20365-19</MicrosoftAspNetCoreAzureAppServicesSiteExtension50PackageVersion>
|
||||
|
@ -253,19 +224,20 @@
|
|||
<CastleCorePackageVersion>4.2.1</CastleCorePackageVersion>
|
||||
<CommandLineParserPackageVersion>2.3.0</CommandLineParserPackageVersion>
|
||||
<FSharpCorePackageVersion>4.2.1</FSharpCorePackageVersion>
|
||||
<GoogleProtobufPackageVersion>3.10.0</GoogleProtobufPackageVersion>
|
||||
<GrpcAspNetCorePackageVersion>2.27.0</GrpcAspNetCorePackageVersion>
|
||||
<GrpcAuthPackageVersion>2.27.0</GrpcAuthPackageVersion>
|
||||
<GrpcNetClientPackageVersion>2.27.0</GrpcNetClientPackageVersion>
|
||||
<GrpcToolsPackageVersion>2.27.0</GrpcToolsPackageVersion>
|
||||
<GoogleProtobufPackageVersion>3.13.0</GoogleProtobufPackageVersion>
|
||||
<GrpcAspNetCorePackageVersion>2.32.0-pre1</GrpcAspNetCorePackageVersion>
|
||||
<GrpcAuthPackageVersion>2.32.0-pre1</GrpcAuthPackageVersion>
|
||||
<GrpcNetClientPackageVersion>2.32.0-pre1</GrpcNetClientPackageVersion>
|
||||
<GrpcToolsPackageVersion>2.32.0-pre1</GrpcToolsPackageVersion>
|
||||
<IdentityServer4AspNetIdentityPackageVersion>4.0.4</IdentityServer4AspNetIdentityPackageVersion>
|
||||
<IdentityServer4EntityFrameworkPackageVersion>4.0.4</IdentityServer4EntityFrameworkPackageVersion>
|
||||
<IdentityServer4PackageVersion>4.0.4</IdentityServer4PackageVersion>
|
||||
<IdentityServer4StoragePackageVersion>4.0.4</IdentityServer4StoragePackageVersion>
|
||||
<IdentityServer4EntityFrameworkStoragePackageVersion>4.0.4</IdentityServer4EntityFrameworkStoragePackageVersion>
|
||||
<MessagePackPackageVersion>2.1.90</MessagePackPackageVersion>
|
||||
<MicrosoftIdentityWebPackageVersion>0.3.1-preview</MicrosoftIdentityWebPackageVersion>
|
||||
<MicrosoftIdentityWebUIPackageVersion>0.3.1-preview</MicrosoftIdentityWebUIPackageVersion>
|
||||
<MicrosoftIdentityWebPackageVersion>0.4.0-preview</MicrosoftIdentityWebPackageVersion>
|
||||
<MicrosoftIdentityWebMicrosoftGraphPackageVersion>0.4.0-preview</MicrosoftIdentityWebMicrosoftGraphPackageVersion>
|
||||
<MicrosoftIdentityWebUIPackageVersion>0.4.0-preview</MicrosoftIdentityWebUIPackageVersion>
|
||||
<MessagePackAnalyzerPackageVersion>$(MessagePackPackageVersion)</MessagePackAnalyzerPackageVersion>
|
||||
<MoqPackageVersion>4.10.0</MoqPackageVersion>
|
||||
<MonoCecilPackageVersion>0.11.2</MonoCecilPackageVersion>
|
||||
|
|
|
@ -46,16 +46,6 @@ namespace RunTests
|
|||
description: "The version of the EF tool to use")
|
||||
{ Argument = new Argument<string>(), Required = true },
|
||||
|
||||
new Option(
|
||||
aliases: new string[] { "--aspnetruntime" },
|
||||
description: "The path to the aspnet runtime nupkg to install")
|
||||
{ Argument = new Argument<string>(), Required = true },
|
||||
|
||||
new Option(
|
||||
aliases: new string[] { "--aspnetref" },
|
||||
description: "The path to the aspnet ref nupkg to install")
|
||||
{ Argument = new Argument<string>(), Required = true },
|
||||
|
||||
new Option(
|
||||
aliases: new string[] { "--helixTimeout" },
|
||||
description: "The timeout duration of the Helix job")
|
||||
|
@ -68,36 +58,41 @@ namespace RunTests
|
|||
};
|
||||
|
||||
var parseResult = command.Parse(args);
|
||||
var options = new RunTestsOptions();
|
||||
options.Target = parseResult.ValueForOption<string>("--target");
|
||||
options.RuntimeVersion = parseResult.ValueForOption<string>("--runtime");
|
||||
options.HelixQueue = parseResult.ValueForOption<string>("--queue");
|
||||
options.Architecture = parseResult.ValueForOption<string>("--arch");
|
||||
options.Quarantined = parseResult.ValueForOption<bool>("--quarantined");
|
||||
options.EfVersion = parseResult.ValueForOption<string>("--ef");
|
||||
options.AspNetRuntime = parseResult.ValueForOption<string>("--aspnetruntime");
|
||||
options.AspNetRef = parseResult.ValueForOption<string>("--aspnetref");
|
||||
options.Timeout = TimeSpan.Parse(parseResult.ValueForOption<string>("--helixTimeout"));
|
||||
options.Source = parseResult.ValueForOption<IEnumerable<string>>("--source");
|
||||
options.HELIX_WORKITEM_ROOT = Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT");
|
||||
options.Path = Environment.GetEnvironmentVariable("PATH");
|
||||
options.DotnetRoot = Environment.GetEnvironmentVariable("DOTNET_ROOT");
|
||||
var sharedFxVersion = parseResult.ValueForOption<string>("--runtime");
|
||||
var options = new RunTestsOptions
|
||||
{
|
||||
Architecture = parseResult.ValueForOption<string>("--arch"),
|
||||
EfVersion = parseResult.ValueForOption<string>("--ef"),
|
||||
HelixQueue = parseResult.ValueForOption<string>("--queue"),
|
||||
Quarantined = parseResult.ValueForOption<bool>("--quarantined"),
|
||||
RuntimeVersion = sharedFxVersion,
|
||||
Target = parseResult.ValueForOption<string>("--target"),
|
||||
Timeout = TimeSpan.Parse(parseResult.ValueForOption<string>("--helixTimeout")),
|
||||
|
||||
// When targeting pack builds, it has exactly the same version as the shared framework.
|
||||
AspNetRef = $"Microsoft.AspNetCore.App.Ref.{sharedFxVersion}.nupkg",
|
||||
AspNetRuntime = $"Microsoft.AspNetCore.App.Runtime.win-x64.{sharedFxVersion}.nupkg",
|
||||
|
||||
DotnetRoot = Environment.GetEnvironmentVariable("DOTNET_ROOT"),
|
||||
HELIX_WORKITEM_ROOT = Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT"),
|
||||
Path = Environment.GetEnvironmentVariable("PATH"),
|
||||
};
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
public string Target { get; set;}
|
||||
public string SdkVersion { get; set;}
|
||||
public string RuntimeVersion { get; set;}
|
||||
public string AspNetRuntime { get; set;}
|
||||
public string AspNetRef { get; set;}
|
||||
public string HelixQueue { get; set;}
|
||||
public string Architecture { get; set;}
|
||||
public bool Quarantined { get; set;}
|
||||
public string EfVersion { get; set;}
|
||||
public string HELIX_WORKITEM_ROOT { get; set;}
|
||||
public string DotnetRoot { get; set; }
|
||||
public string Architecture { get; private set; }
|
||||
public string EfVersion { get; private set; }
|
||||
public string HelixQueue { get; private set; }
|
||||
public bool Quarantined { get; private set; }
|
||||
public string RuntimeVersion { get; private set; }
|
||||
public string Target { get; private set; }
|
||||
public TimeSpan Timeout { get; private set; }
|
||||
|
||||
public string AspNetRef { get; private set; }
|
||||
public string AspNetRuntime { get; private set; }
|
||||
public string HELIX_WORKITEM_ROOT { get; private set; }
|
||||
public string DotnetRoot { get; private set; }
|
||||
public string Path { get; set; }
|
||||
public IEnumerable<string> Source { get; set; }
|
||||
public TimeSpan Timeout { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,38 +10,41 @@ set $queue=%5
|
|||
set $arch=%6
|
||||
set $quarantined=%7
|
||||
set $ef=%8
|
||||
set $aspnetruntime=%9
|
||||
REM Batch only supports up to 9 arguments using the %# syntax, need to shift to get more
|
||||
shift
|
||||
set $aspnetref=%9
|
||||
shift
|
||||
set $helixTimeout=%9
|
||||
REM Batch only supports up to 9 arguments using the %# syntax, need to shift to get more
|
||||
shift
|
||||
set $feedCred=%9
|
||||
|
||||
set DOTNET_HOME=%HELIX_CORRELATION_PAYLOAD%\sdk
|
||||
set DOTNET_HOME=%CD%\sdk%random%
|
||||
set DOTNET_ROOT=%DOTNET_HOME%\%$arch%
|
||||
set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
|
||||
set DOTNET_MULTILEVEL_LOOKUP=0
|
||||
set DOTNET_CLI_HOME=%HELIX_CORRELATION_PAYLOAD%\home
|
||||
set DOTNET_CLI_HOME=%CD%\home%random%
|
||||
|
||||
set "PATH=%DOTNET_ROOT%;%PATH%;%HELIX_CORRELATION_PAYLOAD%\node\bin"
|
||||
echo Set path to: "%PATH%"
|
||||
echo.
|
||||
|
||||
echo "InstallDotNet %DOTNET_ROOT% %$sdkVersion% %$arch% '' $true '' '' $true"
|
||||
powershell.exe -noLogo -NoProfile -ExecutionPolicy unrestricted -command ". eng\common\tools.ps1; InstallDotNet %DOTNET_ROOT% %$sdkVersion% %$arch% '' $true '' '' $true"
|
||||
echo.
|
||||
|
||||
IF [%$feedCred%] == [] (
|
||||
echo "InstallDotNet %DOTNET_ROOT% %$runtimeVersion% %$arch% dotnet $true '' '' $true"
|
||||
powershell.exe -noLogo -NoProfile -ExecutionPolicy unrestricted -command ". eng\common\tools.ps1; InstallDotNet %DOTNET_ROOT% %$runtimeVersion% %$arch% dotnet $true '' '' $true"
|
||||
) else (
|
||||
echo "InstallDotNet %DOTNET_ROOT% %$runtimeVersion% %$arch% dotnet $true https://dotnetclimsrc.blob.core.windows.net/dotnet ... $true"
|
||||
powershell.exe -noLogo -NoProfile -ExecutionPolicy unrestricted -command ". eng\common\tools.ps1; InstallDotNet %DOTNET_ROOT% %$runtimeVersion% %$arch% dotnet $true https://dotnetclimsrc.blob.core.windows.net/dotnet %$feedCred% $true"
|
||||
)
|
||||
echo.
|
||||
|
||||
set exit_code=0
|
||||
|
||||
echo "Restore: dotnet restore RunTests\RunTests.csproj --ignore-failed-sources"
|
||||
dotnet restore RunTests\RunTests.csproj --ignore-failed-sources
|
||||
|
||||
echo "Running tests: dotnet run --no-restore --project RunTests\RunTests.csproj -- --target %$target% --runtime %$aspRuntimeVersion% --queue %$queue% --arch %$arch% --quarantined %$quarantined% --ef %$ef% --aspnetruntime %$aspnetruntime% --aspnetref %$aspnetref% --helixTimeout %$helixTimeout%"
|
||||
dotnet run --no-restore --project RunTests\RunTests.csproj -- --target %$target% --runtime %$aspRuntimeVersion% --queue %$queue% --arch %$arch% --quarantined %$quarantined% --ef %$ef% --aspnetruntime %$aspnetruntime% --aspnetref %$aspnetref% --helixTimeout %$helixTimeout%
|
||||
echo "Running tests: dotnet run --no-restore --project RunTests\RunTests.csproj -- --target %$target% --runtime %$aspRuntimeVersion% --queue %$queue% --arch %$arch% --quarantined %$quarantined% --ef %$ef% --helixTimeout %$helixTimeout%"
|
||||
dotnet run --no-restore --project RunTests\RunTests.csproj -- --target %$target% --runtime %$aspRuntimeVersion% --queue %$queue% --arch %$arch% --quarantined %$quarantined% --ef %$ef% --helixTimeout %$helixTimeout%
|
||||
if errorlevel neq 0 (
|
||||
set exit_code=%errorlevel%
|
||||
)
|
||||
|
|
|
@ -31,24 +31,30 @@ YELLOW="\033[0;33m"
|
|||
MAGENTA="\033[0;95m"
|
||||
|
||||
. eng/common/tools.sh
|
||||
echo "InstallDotNet $DOTNET_ROOT $dotnet_sdk_version '' '' true"
|
||||
InstallDotNet $DOTNET_ROOT $dotnet_sdk_version "" "" true || {
|
||||
exit_code=$?
|
||||
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "dotnet-install.sh failed (exit code '$exit_code')." >&2
|
||||
ExitWithExitCode $exit_code
|
||||
}
|
||||
if [[ -z "${11:-}" ]]; then
|
||||
echo
|
||||
|
||||
if [[ -z "${10:-}" ]]; then
|
||||
echo "InstallDotNet $DOTNET_ROOT $dotnet_runtime_version '' dotnet true"
|
||||
InstallDotNet $DOTNET_ROOT $dotnet_runtime_version "" dotnet true || {
|
||||
exit_code=$?
|
||||
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "dotnet-install.sh failed (exit code '$exit_code')." >&2
|
||||
ExitWithExitCode $exit_code
|
||||
}
|
||||
else
|
||||
InstallDotNet $DOTNET_ROOT $dotnet_runtime_version "" dotnet true https://dotnetclimsrc.blob.core.windows.net/dotnet ${11} || {
|
||||
echo "InstallDotNet $DOTNET_ROOT $dotnet_runtime_version '' dotnet true https://dotnetclimsrc.blob.core.windows.net/dotnet ..."
|
||||
InstallDotNet $DOTNET_ROOT $dotnet_runtime_version "" dotnet true https://dotnetclimsrc.blob.core.windows.net/dotnet ${10} || {
|
||||
exit_code=$?
|
||||
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "dotnet-install.sh failed (exit code '$exit_code')." >&2
|
||||
ExitWithExitCode $exit_code
|
||||
}
|
||||
fi
|
||||
echo
|
||||
|
||||
if [ -e /proc/self/coredump_filter ]; then
|
||||
# Include memory in private and shared file-backed mappings in the dump.
|
||||
|
@ -65,8 +71,8 @@ exit_code=0
|
|||
echo "Restore: $DOTNET_ROOT/dotnet restore RunTests/RunTests.csproj --ignore-failed-sources"
|
||||
$DOTNET_ROOT/dotnet restore RunTests/RunTests.csproj --ignore-failed-sources
|
||||
|
||||
echo "Running tests: $DOTNET_ROOT/dotnet run --no-restore --project RunTests/RunTests.csproj -- --target $1 --runtime $4 --queue $5 --arch $6 --quarantined $7 --ef $8 --aspnetruntime $9 --aspnetref ${10} --helixTimeout ${11}"
|
||||
$DOTNET_ROOT/dotnet run --no-restore --project RunTests/RunTests.csproj -- --target $1 --runtime $4 --queue $5 --arch $6 --quarantined $7 --ef $8 --aspnetruntime $9 --aspnetref ${10} --helixTimeout ${11}
|
||||
echo "Running tests: $DOTNET_ROOT/dotnet run --no-restore --project RunTests/RunTests.csproj -- --target $1 --runtime $4 --queue $5 --arch $6 --quarantined $7 --ef $8 --helixTimeout $9"
|
||||
$DOTNET_ROOT/dotnet run --no-restore --project RunTests/RunTests.csproj -- --target $1 --runtime $4 --queue $5 --arch $6 --quarantined $7 --ef $8 --helixTimeout $9
|
||||
exit_code=$?
|
||||
echo "Finished tests...exit_code=$exit_code"
|
||||
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
<Import Project="..\targets\Helix.Common.props" />
|
||||
<Import Project="..\Build.props" />
|
||||
|
||||
<ItemGroup>
|
||||
<!-- Microsoft.DotNet.Helix.Sdk.MultiQueue.targets splits $(HelixTargetQueues) into @(HelixTargetQueue) items. -->
|
||||
<ItemGroup Condition=" '$(HelixTargetQueues)' == '' ">
|
||||
<HelixTargetQueue Condition="'$(_UseHelixOpenQueues)' == 'true'" Include="@(HelixAvailableTargetQueue)" />
|
||||
<HelixTargetQueue Condition="'$(_UseHelixOpenQueues)' != 'true'" Include="@(HelixAvailableTargetQueue->'%(Identity)'->Replace('.Open',''))" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
.PARAMETER Project
|
||||
The test project to publish and send to Helix.
|
||||
.PARAMETER HelixQueues
|
||||
Set the Helix queues to use, the list is ';' separated.
|
||||
Set the Helix queues to use. The list is '+' or ';'-separated.
|
||||
Some supported queues:
|
||||
Ubuntu.1604.Amd64.Open
|
||||
Ubuntu.1804.Amd64.Open
|
||||
|
|
|
@ -12,7 +12,12 @@
|
|||
<PackageReference Include="MicroBuild.Core" Version="0.3.0" PrivateAssets="All" AllowExplicitReference="true" ExcludeAssets="All" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(UsingMicrosoftNETSdkWeb)' == 'true' OR '$(UsingMicrosoftNETSdkBlazorWebAssembly)' == 'true' OR '$(RazorSdkCurrentVersionProps)' != ''">
|
||||
<PropertyGroup>
|
||||
<_ReferenceLocalRazorSDK
|
||||
Condition="'$(UsingMicrosoftNETSdkWeb)' == 'true' OR '$(UsingMicrosoftNETSdkBlazorWebAssembly)' == 'true' OR '$(RazorSdkCurrentVersionProps)' != '' OR '$(_RazorSdkImportsMicrosoftNetSdk)' == 'true'">true</_ReferenceLocalRazorSDK>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Condition="'$(_ReferenceLocalRazorSDK)' == 'true'">
|
||||
<!--
|
||||
Use the Razor SDK as a project reference. The version of the .NET Core SDK we build with often contains a version of the Razor SDK
|
||||
several versions older than latest. We reference the project to ensure it's built before the other projects that use it. Since this
|
||||
|
@ -25,7 +30,7 @@
|
|||
UndefineProperties="TargetFramework;TargetFrameworks" />
|
||||
</ItemGroup>
|
||||
|
||||
<ImportGroup Condition="'$(UsingMicrosoftNETSdkWeb)' == 'true' OR '$(UsingMicrosoftNETSdkBlazorWebAssembly)' == 'true' OR '$(RazorSdkCurrentVersionProps)' != ''">
|
||||
<ImportGroup Condition="'$(_ReferenceLocalRazorSDK)' == 'true'">
|
||||
<Import Project="$(RepoRoot)eng\targets\GetRazorSDKDirectory.props" />
|
||||
<Import Project="$(RepoRoot)src\Razor\Microsoft.NET.Sdk.Razor\src\build\netstandard2.0\Microsoft.NET.Sdk.Razor.props" />
|
||||
</ImportGroup>
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
|
||||
<!-- Public members should not use oblivious types. Not done with all nullable annotations. -->
|
||||
<NoWarn>$(NoWarn);RS0041</NoWarn>
|
||||
|
||||
<!-- Turn off platform compatiblity analyzer warnings in test, test assets, and samples -->
|
||||
<NoWarn Condition="'$(IsTestProject)' == 'true' OR '$(IsTestAssetProject)' == 'true' OR '$(ISBenchmarkProject)' == 'true' OR '$(IsSampleProject)' == 'true'">$(NoWarn);CA1416</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Condition=" Exists('$(MSBuildProjectDirectory)\PublicAPI.*.txt') AND
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
<ItemGroup Condition="'$(IsWindowsOnlyTest)' != 'true' AND '$(TargetArchitecture)' == 'x64' AND '$(IsHelixDaily)' == 'true'">
|
||||
<HelixAvailableTargetQueue Include="Windows.7.Amd64.Open" Platform="Windows" />
|
||||
<HelixAvailableTargetQueue Include="Windows.81.Amd64.Open" Platform="Windows" />
|
||||
<HelixAvailableTargetQueue Include="Windows.10.Amd64.Server20H1.Open" Platform="Windows" />
|
||||
<HelixAvailableTargetQueue Include="Ubuntu.1804.Amd64.Open" Platform="Linux" />
|
||||
<HelixAvailableTargetQueue Include="Ubuntu.2004.Amd64.Open" Platform="Linux" />
|
||||
<HelixAvailableTargetQueue Include="Centos.7.Amd64.Open" Platform="Linux" />
|
||||
|
|
|
@ -16,11 +16,20 @@
|
|||
<HelixPreCommand Include="call RunPowershell.cmd InstallNode.ps1 $(NodeVersion) %25HELIX_CORRELATION_PAYLOAD%25\node\bin || exit /b 1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(IsHelixJob)' == 'true' AND '$(TestDependsOnAspNetRuntime)' == 'true'">
|
||||
<HelixContent Include="$(RepoRoot)artifacts\packages\Release\Shipping\*-ci.nupkg" />
|
||||
<ItemGroup Condition=" '$(TestDependsOnAspNetRuntime)' == 'true' ">
|
||||
<!-- Grab all shipping packages. -->
|
||||
<HelixContent Include="$(RepoRoot)artifacts\packages\$(Configuration)\Shipping\*$(SharedFxVersion).nupkg" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Item group has to be defined here becasue Helix.props is evaluated before xunit.runner.console.props -->
|
||||
<ItemGroup>
|
||||
<!-- Java test projects do not use xUnit. -->
|
||||
<HelixContent Include="$(OutputPath)Microsoft.VisualStudio.TestPlatform.Extension.Xunit.Xml.TestAdapter.dll"
|
||||
Condition=" EXISTS('$(OutputPath)Microsoft.VisualStudio.TestPlatform.Extension.Xunit.Xml.TestLogger.dll') " />
|
||||
<HelixContent Include="$(OutputPath)Microsoft.VisualStudio.TestPlatform.Extension.Xunit.Xml.TestLogger.dll"
|
||||
Condition=" EXISTS('$(OutputPath)Microsoft.VisualStudio.TestPlatform.Extension.Xunit.Xml.TestLogger.dll') " />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Item group has to be defined here because Helix.props is evaluated before xunit.runner.console.props -->
|
||||
<ItemGroup Condition="$(BuildHelixPayload)">
|
||||
<Content Include="@(HelixContent)" />
|
||||
<Content Include="$(RepoRoot)eng\scripts\Download.ps1" />
|
||||
|
@ -40,13 +49,10 @@
|
|||
</ContentWithTargetPath>
|
||||
</ItemGroup>
|
||||
|
||||
<!--
|
||||
|
||||
This target is meant to be used when invoking helix tests on one project at a time.
|
||||
|
||||
Usage: dotnet msbuild /t:Helix src/MyTestProject.csproj
|
||||
|
||||
-->
|
||||
<!--
|
||||
This target is meant to be used when invoking helix tests on one project at a time.
|
||||
Usage: dotnet msbuild /t:Helix src/MyTestProject.csproj
|
||||
-->
|
||||
<Target Name="Helix">
|
||||
<MSBuild Projects="$(MSBuildThisFileDirectory)..\helix\helix.proj"
|
||||
Properties="ProjectToBuild=$(MSBuildProjectFullPath)" />
|
||||
|
@ -101,25 +107,6 @@ Usage: dotnet msbuild /t:Helix src/MyTestProject.csproj
|
|||
</Target>
|
||||
|
||||
<Target Name="_CreateHelixWorkItem" Condition="$(BuildHelixPayload)">
|
||||
<ItemGroup>
|
||||
<HelixContent Include="$(OutputPath)/Microsoft.VisualStudio.TestPlatform.Extension.Xunit.Xml.TestAdapter.dll" />
|
||||
<HelixContent Include="$(OutputPath)/Microsoft.VisualStudio.TestPlatform.Extension.Xunit.Xml.TestLogger.dll" />
|
||||
</ItemGroup>
|
||||
|
||||
<!--
|
||||
Could use _GetPackageVersionInfo target (defined in eng/targets/Packaging.targets and included in every C#
|
||||
and F# project) instead of the $(SharedFxVersion) property but the property works everywhere except in site
|
||||
extensions projects. Could also use $(TargetingPackVersion) but that has slightly more complicated semantics
|
||||
and doesn't keep up when in servicing.
|
||||
-->
|
||||
<ItemGroup Condition=" '$(TestDependsOnAspNetRef)' == 'true' AND '$(IsTargetingPackBuilding)' == 'true' ">
|
||||
<HelixContent Include="$(RepoRoot)artifacts\packages\Release\Shipping\Microsoft.AspNetCore.App.Ref.$(SharedFxVersion).nupkg" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TestDependsOnAspNetRuntime)' == 'true' ">
|
||||
<HelixContent Include="$(RepoRoot)artifacts\packages\Release\Shipping\Microsoft.AspNetCore.App.Runtime.win-x64.$(SharedFxVersion).nupkg" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- Extract the effective queue name from this format "(name)host@dockerimage". This is sometimes used in test code to skip tests. -->
|
||||
<_HelixFriendlyNameTargetQueue>$(HelixTargetQueue)</_HelixFriendlyNameTargetQueue>
|
||||
|
@ -139,8 +126,12 @@ Usage: dotnet msbuild /t:Helix src/MyTestProject.csproj
|
|||
<TestAssembly>$(TargetFileName)</TestAssembly>
|
||||
<PreCommands>@(HelixPreCommand)</PreCommands>
|
||||
<PostCommands>@(HelixPostCommand)</PostCommands>
|
||||
<Command Condition="$(IsWindowsHelixQueue)">call runtests.cmd $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppRuntimeVersion) $(SharedFxVersion) $(_HelixFriendlyNameTargetQueue) $(TargetArchitecture) $(RunQuarantinedTests) $(DotnetEfPackageVersion) Microsoft.AspNetCore.App.Runtime.win-x64.$(SharedFxVersion).nupkg Microsoft.AspNetCore.App.Ref.$(SharedFxVersion).nupkg $(HelixTimeout)</Command>
|
||||
<Command Condition="!$(IsWindowsHelixQueue)">./runtests.sh $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppRuntimeVersion) $(SharedFxVersion) $(_HelixFriendlyNameTargetQueue) $(TargetArchitecture) $(RunQuarantinedTests) $(DotnetEfPackageVersion) Microsoft.AspNetCore.App.Runtime.win-x64.$(SharedFxVersion).nupkg Microsoft.AspNetCore.App.Ref.$(SharedFxVersion).nupkg $(HelixTimeout)</Command>
|
||||
<!--
|
||||
When the targeting pack builds, it has exactly the same version as the shared framework. Passing
|
||||
SharedFxVersion because that's needed even when the targeting pack isn't building.
|
||||
-->
|
||||
<Command Condition="$(IsWindowsHelixQueue)">call runtests.cmd $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppInternalPackageVersion) $(SharedFxVersion) $(_HelixFriendlyNameTargetQueue) $(TargetArchitecture) $(RunQuarantinedTests) $(DotnetEfPackageVersion) $(HelixTimeout) $(DotNetRuntimeSourceFeedKey)</Command>
|
||||
<Command Condition="!$(IsWindowsHelixQueue)">./runtests.sh $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppInternalPackageVersion) $(SharedFxVersion) $(_HelixFriendlyNameTargetQueue) $(TargetArchitecture) $(RunQuarantinedTests) $(DotnetEfPackageVersion) $(HelixTimeout) $(DotNetRuntimeSourceFeedKey)</Command>
|
||||
<Command Condition="$(HelixCommand) != ''">$(HelixCommand)</Command>
|
||||
<Timeout>$(HelixTimeout)</Timeout>
|
||||
</HelixWorkItem>
|
||||
|
|
|
@ -253,45 +253,6 @@
|
|||
Text="Could not resolve this reference. Could not locate the package or project for "%(Reference.Identity)". Did you update baselines and dependencies lists? See docs/ReferenceResolution.md for more details." />
|
||||
</Target>
|
||||
|
||||
<!--
|
||||
Change @(ResolvedCompileFileDefinitions) items between generation and use in order to compile against RTM lib/
|
||||
or ref/ assemblies. The approach works for all TFMs because it happens after a specific assembly is chosen for
|
||||
compilation; no need to restrict this to (say) the default TFM.
|
||||
|
||||
This target could get confused if the layout changes for one of the dozen special-cased packages during servicing.
|
||||
E.g. ResolvePackageAssets picks a compatible assembly from the 5.0.1 package and _UseRTMReferenceAssemblies
|
||||
changes the path to one not present in the 5.0.0 package. Fortunately, this will break the build with complaints
|
||||
about the "invalid strong name".
|
||||
-->
|
||||
<Target Name="_UseRTMReferenceAssemblies"
|
||||
Condition=" '$(MSBuildProjectName)' != 'RepoTasks' "
|
||||
AfterTargets="ResolvePackageAssets"
|
||||
BeforeTargets="GenerateBuildDependencyFile;GeneratePublishDependencyFile;ILLink;ResolveLockFileReferences"
|
||||
DependsOnTargets="ResolvePackageAssets">
|
||||
<Error Condition=" !EXISTS('$(RepoRoot)artifacts\obj\RepoTasks\RepoTasks.csproj.nuget.g.props') "
|
||||
Text="The eng/tools/RepoTasks project must be restored before building other projects." />
|
||||
|
||||
<JoinItems Left="@(ResolvedCompileFileDefinitions)"
|
||||
Right="@(LatestPackageReference->HasMetadata('RTMVersion'))"
|
||||
LeftKey="Filename"
|
||||
ItemSpecToUse="Left"
|
||||
LeftMetadata="*"
|
||||
RightMetadata="RTMVersion;Version">
|
||||
<Output TaskParameter="JoinResult" ItemName="_ResolvedCompileFileDefinitionsToChange" />
|
||||
</JoinItems>
|
||||
|
||||
<ItemGroup>
|
||||
<ResolvedCompileFileDefinitions Remove="@(_ResolvedCompileFileDefinitionsToChange)" />
|
||||
|
||||
<!-- Ignore %(NuGetPackageVersion) when doing substitution because some projects use downlevel packages. -->
|
||||
<_ResolvedCompileFileDefinitionsToChange
|
||||
HintPath="$([System.String]::new('%(Identity)').Replace('\%(Version)\', '\%(RTMVersion)\').Replace('/%(Version)/', '/%(RTMVersion)/'))" />
|
||||
<ResolvedCompileFileDefinitions Include="@(_ResolvedCompileFileDefinitionsToChange -> '%(HintPath)')" />
|
||||
|
||||
<_ResolvedCompileFileDefinitionsToChange Remove="@(_ResolvedCompileFileDefinitionsToChange)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<PropertyGroup>
|
||||
<_CompileTfmUsingReferenceAssemblies>false</_CompileTfmUsingReferenceAssemblies>
|
||||
<_CompileTfmUsingReferenceAssemblies
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProductVersion>3.11</ProductVersion>
|
||||
<WixVersion>3.11.1</WixVersion>
|
||||
<ProductVersion>3.14</ProductVersion>
|
||||
<WixVersion>3.14.0-dotnet</WixVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
|
|
@ -36,15 +36,5 @@
|
|||
<Reference Include="Microsoft.Deployment.WindowsInstaller.Package">
|
||||
<HintPath>$(WiXSdkPath)\Microsoft.Deployment.WindowsInstaller.Package.dll</HintPath>
|
||||
</Reference>
|
||||
|
||||
<!--
|
||||
Gather project references for compilation against RTM packages. %(RTMVersion) is set for about a dozen packages
|
||||
in all servicing builds. Cannot reference two versions of a package, mandating this separation from projects
|
||||
using the relevant packages.
|
||||
-->
|
||||
<PackageReference Include="@(LatestPackageReference->HasMetadata('RTMVersion'))"
|
||||
IncludeAssets="None"
|
||||
PrivateAssets="All"
|
||||
Version="%(RTMVersion)" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"sdk": {
|
||||
"version": "5.0.100-rc.1.20379.10"
|
||||
"version": "5.0.100-rc.1.20452.10"
|
||||
},
|
||||
"tools": {
|
||||
"dotnet": "5.0.100-rc.1.20379.10",
|
||||
"dotnet": "5.0.100-rc.1.20452.10",
|
||||
"runtimes": {
|
||||
"dotnet/x64": [
|
||||
"2.1.18",
|
||||
|
|
|
@ -98,6 +98,7 @@
|
|||
"src\\Components\\Ignitor\\src\\Ignitor.csproj",
|
||||
"src\\Components\\Ignitor\\test\\Ignitor.Test.csproj",
|
||||
"src\\Components\\test\\testassets\\ComponentsApp.Server\\ComponentsApp.Server.csproj",
|
||||
"src\\Components\\test\\testassets\\GlobalizationWasmApp\\GlobalizationWasmApp.csproj",
|
||||
"src\\Components\\benchmarkapps\\Wasm.Performance\\Driver\\Wasm.Performance.Driver.csproj",
|
||||
"src\\Components\\benchmarkapps\\Wasm.Performance\\TestApp\\Wasm.Performance.TestApp.csproj",
|
||||
"src\\Components\\Web.Extensions\\src\\Microsoft.AspNetCore.Components.Web.Extensions.csproj",
|
||||
|
|
|
@ -23,10 +23,9 @@ namespace Microsoft.AspNetCore.Components
|
|||
private static readonly object BoxedFalse = false;
|
||||
|
||||
private delegate object? BindFormatter<T>(T value, CultureInfo? culture);
|
||||
private delegate object BindFormatterWithFormat<T>(T value, CultureInfo? culture, string format);
|
||||
|
||||
internal delegate bool BindParser<T>(object? obj, CultureInfo? culture, out T value);
|
||||
internal delegate bool BindParserWithFormat<T>(object? obj, CultureInfo? culture, string? format, out T value);
|
||||
internal delegate bool BindParser<T>(object? obj, CultureInfo? culture, [MaybeNullWhen(false)] out T value);
|
||||
internal delegate bool BindParserWithFormat<T>(object? obj, CultureInfo? culture, string? format, [MaybeNullWhen(false)] out T value);
|
||||
|
||||
/// <summary>
|
||||
/// Formats the provided <paramref name="value"/> as a <see cref="System.String"/>.
|
||||
|
@ -1276,7 +1275,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
|
||||
/// <param name="value">The converted value.</param>
|
||||
/// <returns><c>true</c> if conversion is successful, otherwise <c>false</c>.</returns>
|
||||
public static bool TryConvertTo<T>(object? obj, CultureInfo? culture, out T value)
|
||||
public static bool TryConvertTo<T>(object? obj, CultureInfo? culture, [MaybeNullWhen(false)] out T value)
|
||||
{
|
||||
var converter = ParserDelegateCache.Get<T>();
|
||||
return converter(obj, culture, out value);
|
||||
|
|
|
@ -51,11 +51,11 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// </summary>
|
||||
/// <param name="arg">The argument.</param>
|
||||
/// <returns>A <see cref="Task"/> which completes asynchronously once event processing has completed.</returns>
|
||||
public Task InvokeAsync(object arg)
|
||||
public Task InvokeAsync(object? arg)
|
||||
{
|
||||
if (Receiver == null)
|
||||
{
|
||||
return EventCallbackWorkItem.InvokeAsync<object>(Delegate, arg);
|
||||
return EventCallbackWorkItem.InvokeAsync<object?>(Delegate, arg);
|
||||
}
|
||||
|
||||
return Receiver.HandleEventAsync(new EventCallbackWorkItem(Delegate), arg);
|
||||
|
|
|
@ -46,11 +46,11 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// </summary>
|
||||
/// <param name="arg">The argument.</param>
|
||||
/// <returns>A <see cref="Task"/> which completes asynchronously once event processing has completed.</returns>
|
||||
public Task InvokeAsync(TValue arg)
|
||||
public Task InvokeAsync(TValue? arg)
|
||||
{
|
||||
if (Receiver == null)
|
||||
{
|
||||
return EventCallbackWorkItem.InvokeAsync<TValue>(Delegate, arg);
|
||||
return EventCallbackWorkItem.InvokeAsync<TValue?>(Delegate, arg);
|
||||
}
|
||||
|
||||
return Receiver.HandleEventAsync(new EventCallbackWorkItem(Delegate), arg);
|
||||
|
|
|
@ -88,9 +88,8 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <typeparam name="TValue">The type of the value.</typeparam>
|
||||
/// <param name="parameterName">The name of the parameter.</param>
|
||||
/// <returns>The parameter value if found; otherwise the default value for the specified type.</returns>
|
||||
[return: MaybeNull]
|
||||
public TValue GetValueOrDefault<TValue>(string parameterName)
|
||||
=> GetValueOrDefault<TValue>(parameterName, default!);
|
||||
public TValue? GetValueOrDefault<TValue>(string parameterName)
|
||||
=> GetValueOrDefault<TValue?>(parameterName, default);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value of the parameter with the specified name, or a specified default value
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
"src\\Components\\test\\E2ETest\\Microsoft.AspNetCore.Components.E2ETests.csproj",
|
||||
"src\\Components\\test\\testassets\\BasicTestApp\\BasicTestApp.csproj",
|
||||
"src\\Components\\test\\testassets\\ComponentsApp.Server\\ComponentsApp.Server.csproj",
|
||||
"src\\Components\\test\\testassets\\GlobalizationWasmApp\\GlobalizationWasmApp.csproj",
|
||||
"src\\Components\\test\\testassets\\TestContentPackage\\TestContentPackage.csproj",
|
||||
"src\\Components\\test\\testassets\\TestServer\\Components.TestServer.csproj"
|
||||
]
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace Ignitor
|
|||
{
|
||||
Timeout = timeout;
|
||||
|
||||
Completion = new TaskCompletionSource<TResult>(TaskContinuationOptions.RunContinuationsAsynchronously);
|
||||
Completion = new TaskCompletionSource<TResult>(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||
Completion.Task.ContinueWith(
|
||||
(task, state) =>
|
||||
{
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
|
@ -29,7 +28,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
|||
|
||||
public string Secret { get; }
|
||||
|
||||
public bool Equals([AllowNull] CircuitId other)
|
||||
public bool Equals(CircuitId other)
|
||||
{
|
||||
// We want to use a fixed time equality comparison for a *real* comparisons.
|
||||
// The only use case for Secret being null is with a default struct value,
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -26,6 +26,7 @@ export interface BootJsonData {
|
|||
readonly linkerEnabled: boolean;
|
||||
readonly cacheBootResources: boolean;
|
||||
readonly config: string[];
|
||||
readonly icuDataMode: ICUDataMode;
|
||||
}
|
||||
|
||||
export interface ResourceGroups {
|
||||
|
@ -37,3 +38,9 @@ export interface ResourceGroups {
|
|||
}
|
||||
|
||||
export type ResourceList = { [name: string]: string };
|
||||
|
||||
export enum ICUDataMode {
|
||||
Sharded,
|
||||
All,
|
||||
Invariant
|
||||
}
|
||||
|
|
|
@ -4,10 +4,10 @@ import { showErrorNotification } from '../../BootErrors';
|
|||
import { WebAssemblyResourceLoader, LoadingResource } from '../WebAssemblyResourceLoader';
|
||||
import { Platform, System_Array, Pointer, System_Object, System_String, HeapLock } from '../Platform';
|
||||
import { WebAssemblyBootResourceType } from '../WebAssemblyStartOptions';
|
||||
import { BootJsonData, ICUDataMode } from '../BootConfig';
|
||||
|
||||
let mono_wasm_add_assembly: (name: string, heapAddress: number, length: number) => void;
|
||||
const appBinDirName = 'appBinDir';
|
||||
const icuDataResourceName = 'icudt.dat';
|
||||
const uint64HighOrderShift = Math.pow(2, 32);
|
||||
const maxSafeNumberHighPart = Math.pow(2, 21) - 1; // The high-order int32 from Number.MAX_SAFE_INTEGER
|
||||
|
||||
|
@ -138,13 +138,13 @@ export const monoPlatform: Platform = {
|
|||
return ((baseAddress as any as number) + (fieldOffset || 0)) as any as T;
|
||||
},
|
||||
|
||||
beginHeapLock: function() {
|
||||
beginHeapLock: function () {
|
||||
assertHeapIsNotLocked();
|
||||
currentHeapLock = new MonoHeapLock();
|
||||
return currentHeapLock;
|
||||
},
|
||||
|
||||
invokeWhenHeapUnlocked: function(callback) {
|
||||
invokeWhenHeapUnlocked: function (callback) {
|
||||
// This is somewhat like a sync context. If we're not locked, just pass through the call directly.
|
||||
if (!currentHeapLock) {
|
||||
callback();
|
||||
|
@ -183,7 +183,7 @@ function addScriptTagsToDocument(resourceLoader: WebAssemblyResourceLoader) {
|
|||
const resourceType: WebAssemblyBootResourceType = 'dotnetjs';
|
||||
const customSrc = resourceLoader.startOptions.loadBootResource(
|
||||
resourceType, dotnetJsResourceName, scriptElem.src, dotnetJsContentHash);
|
||||
if (typeof(customSrc) === 'string') {
|
||||
if (typeof (customSrc) === 'string') {
|
||||
scriptElem.src = customSrc;
|
||||
} else if (customSrc) {
|
||||
// Since we must load this via a <script> tag, it's only valid to supply a URI (and not a Request, say)
|
||||
|
@ -213,7 +213,7 @@ function addGlobalModuleScriptTagsToDocument(callback: () => void) {
|
|||
|
||||
function createEmscriptenModuleInstance(resourceLoader: WebAssemblyResourceLoader, onReady: () => void, onError: (reason?: any) => void) {
|
||||
const resources = resourceLoader.bootConfig.resources;
|
||||
const module = (window['Module'] || { }) as typeof Module;
|
||||
const module = (window['Module'] || {}) as typeof Module;
|
||||
const suppressMessages = ['DEBUGGING ENABLED'];
|
||||
|
||||
module.print = line => (suppressMessages.indexOf(line) < 0 && console.log(line));
|
||||
|
@ -250,7 +250,9 @@ function createEmscriptenModuleInstance(resourceLoader: WebAssemblyResourceLoade
|
|||
}
|
||||
|
||||
let icuDataResource: LoadingResource | undefined;
|
||||
if (resourceLoader.bootConfig.resources.runtime.hasOwnProperty(icuDataResourceName)) {
|
||||
if (resourceLoader.bootConfig.icuDataMode != ICUDataMode.Invariant) {
|
||||
const applicationCulture = resourceLoader.startOptions.applicationCulture || (navigator.languages && navigator.languages[0]);
|
||||
const icuDataResourceName = getICUResourceName(resourceLoader.bootConfig, applicationCulture);
|
||||
icuDataResource = resourceLoader.loadResource(
|
||||
icuDataResourceName,
|
||||
`_framework/${icuDataResourceName}`,
|
||||
|
@ -287,7 +289,7 @@ function createEmscriptenModuleInstance(resourceLoader: WebAssemblyResourceLoade
|
|||
loadICUData(icuDataResource);
|
||||
} else {
|
||||
// Use invariant culture if the app does not carry icu data.
|
||||
MONO.mono_wasm_setenv("DOTNET_SYSTEM_GLOBALIZATION_INVARIANT", "1");
|
||||
MONO.mono_wasm_setenv('DOTNET_SYSTEM_GLOBALIZATION_INVARIANT', '1');
|
||||
}
|
||||
|
||||
// Fetch the assemblies and PDBs in the background, telling Mono to wait until they are loaded
|
||||
|
@ -302,16 +304,22 @@ function createEmscriptenModuleInstance(resourceLoader: WebAssemblyResourceLoade
|
|||
|
||||
// Wire-up callbacks for satellite assemblies. Blazor will call these as part of the application
|
||||
// startup sequence to load satellite assemblies for the application's culture.
|
||||
window['Blazor']._internal.getSatelliteAssemblies = (culturesToLoadDotNetArray: System_Array<System_String>) : System_Object => {
|
||||
window['Blazor']._internal.getSatelliteAssemblies = (culturesToLoadDotNetArray: System_Array<System_String>): System_Object => {
|
||||
const culturesToLoad = BINDING.mono_array_to_js_array<System_String, string>(culturesToLoadDotNetArray);
|
||||
const satelliteResources = resourceLoader.bootConfig.resources.satelliteResources;
|
||||
const applicationCulture = resourceLoader.startOptions.applicationCulture || (navigator.languages && navigator.languages[0]);
|
||||
|
||||
if (resourceLoader.bootConfig.icuDataMode == ICUDataMode.Sharded && culturesToLoad && culturesToLoad[0] !== applicationCulture) {
|
||||
// We load an initial icu file based on the browser's locale. However if the application's culture requires a different set, flag this as an error.
|
||||
throw new Error('To change culture dynamically during startup, set <BlazorWebAssemblyLoadAllGlobalizationData>true</BlazorWebAssemblyLoadAllGlobalizationData> in the application\'s project file.');
|
||||
}
|
||||
|
||||
if (satelliteResources) {
|
||||
const resourcePromises = Promise.all(culturesToLoad
|
||||
.filter(culture => satelliteResources.hasOwnProperty(culture))
|
||||
.map(culture => resourceLoader.loadResources(satelliteResources[culture], fileName => `_framework/${fileName}`, 'assembly'))
|
||||
.reduce((previous, next) => previous.concat(next), new Array<LoadingResource>())
|
||||
.map(async resource => (await resource.response).arrayBuffer()));
|
||||
.filter(culture => satelliteResources.hasOwnProperty(culture))
|
||||
.map(culture => resourceLoader.loadResources(satelliteResources[culture], fileName => `_framework/${fileName}`, 'assembly'))
|
||||
.reduce((previous, next) => previous.concat(next), new Array<LoadingResource>())
|
||||
.map(async resource => (await resource.response).arrayBuffer()));
|
||||
|
||||
return BINDING.js_to_mono_obj(
|
||||
resourcePromises.then(resourcesToLoad => {
|
||||
|
@ -322,16 +330,16 @@ function createEmscriptenModuleInstance(resourceLoader: WebAssemblyResourceLoade
|
|||
BINDING.mono_obj_array_set(array, i, BINDING.js_typed_array_to_array(new Uint8Array(resourcesToLoad[i])));
|
||||
}
|
||||
return array;
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return resourcesToLoad.length;
|
||||
}));
|
||||
return resourcesToLoad.length;
|
||||
}));
|
||||
}
|
||||
return BINDING.js_to_mono_obj(Promise.resolve(0));
|
||||
}
|
||||
|
||||
window['Blazor']._internal.getLazyAssemblies = (assembliesToLoadDotNetArray: System_Array<System_String>) : System_Object => {
|
||||
window['Blazor']._internal.getLazyAssemblies = (assembliesToLoadDotNetArray: System_Array<System_String>): System_Object => {
|
||||
const assembliesToLoad = BINDING.mono_array_to_js_array<System_String, string>(assembliesToLoadDotNetArray);
|
||||
const lazyAssemblies = resourceLoader.bootConfig.resources.lazyAssembly;
|
||||
|
||||
|
@ -347,24 +355,24 @@ function createEmscriptenModuleInstance(resourceLoader: WebAssemblyResourceLoade
|
|||
}
|
||||
|
||||
const resourcePromises = Promise.all(assembliesMarkedAsLazy
|
||||
.map(assembly => resourceLoader.loadResource(assembly, `_framework/${assembly}`, lazyAssemblies[assembly], 'assembly'))
|
||||
.map(async resource => (await resource.response).arrayBuffer()));
|
||||
.map(assembly => resourceLoader.loadResource(assembly, `_framework/${assembly}`, lazyAssemblies[assembly], 'assembly'))
|
||||
.map(async resource => (await resource.response).arrayBuffer()));
|
||||
|
||||
return BINDING.js_to_mono_obj(
|
||||
resourcePromises.then(resourcesToLoad => {
|
||||
if (resourcesToLoad.length) {
|
||||
window['Blazor']._internal.readLazyAssemblies = () => {
|
||||
const array = BINDING.mono_obj_array_new(resourcesToLoad.length);
|
||||
for (var i = 0; i < resourcesToLoad.length; i++) {
|
||||
BINDING.mono_obj_array_set(array, i, BINDING.js_typed_array_to_array(new Uint8Array(resourcesToLoad[i])));
|
||||
}
|
||||
return array;
|
||||
return BINDING.js_to_mono_obj(
|
||||
resourcePromises.then(resourcesToLoad => {
|
||||
if (resourcesToLoad.length) {
|
||||
window['Blazor']._internal.readLazyAssemblies = () => {
|
||||
const array = BINDING.mono_obj_array_new(resourcesToLoad.length);
|
||||
for (var i = 0; i < resourcesToLoad.length; i++) {
|
||||
BINDING.mono_obj_array_set(array, i, BINDING.js_typed_array_to_array(new Uint8Array(resourcesToLoad[i])));
|
||||
}
|
||||
return array;
|
||||
};
|
||||
}
|
||||
|
||||
return resourcesToLoad.length;
|
||||
}));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
module.postRun.push(() => {
|
||||
|
@ -385,7 +393,7 @@ function createEmscriptenModuleInstance(resourceLoader: WebAssemblyResourceLoade
|
|||
const load_runtime = cwrap('mono_wasm_load_runtime', null, ['string', 'number']);
|
||||
// -1 enables debugging with logging disabled. 0 disables debugging entirely.
|
||||
load_runtime(appBinDirName, hasDebuggingEnabled() ? -1 : 0);
|
||||
MONO.mono_wasm_runtime_ready ();
|
||||
MONO.mono_wasm_runtime_ready();
|
||||
attachInteropInvoker();
|
||||
onReady();
|
||||
});
|
||||
|
@ -408,8 +416,8 @@ function createEmscriptenModuleInstance(resourceLoader: WebAssemblyResourceLoade
|
|||
mono_wasm_add_assembly(loadAsName, heapAddress, data.length);
|
||||
MONO.loaded_files.push(toAbsoluteUrl(dependency.url));
|
||||
} catch (errorInfo) {
|
||||
onError(errorInfo);
|
||||
return;
|
||||
onError(errorInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
removeRunDependency(runDependencyId);
|
||||
|
@ -433,7 +441,7 @@ function bindStaticMethod(assembly: string, typeName: string, method: string) {
|
|||
}
|
||||
|
||||
function attachInteropInvoker(): void {
|
||||
const dotNetDispatcherInvokeMethodHandle = bindStaticMethod('Microsoft.AspNetCore.Components.WebAssembly', 'Microsoft.AspNetCore.Components.WebAssembly.Services.DefaultWebAssemblyJSRuntime', 'InvokeDotNet');
|
||||
const dotNetDispatcherInvokeMethodHandle = bindStaticMethod('Microsoft.AspNetCore.Components.WebAssembly', 'Microsoft.AspNetCore.Components.WebAssembly.Services.DefaultWebAssemblyJSRuntime', 'InvokeDotNet');
|
||||
const dotNetDispatcherBeginInvokeMethodHandle = bindStaticMethod('Microsoft.AspNetCore.Components.WebAssembly', 'Microsoft.AspNetCore.Components.WebAssembly.Services.DefaultWebAssemblyJSRuntime', 'BeginInvokeDotNet');
|
||||
const dotNetDispatcherEndInvokeJSMethodHandle = bindStaticMethod('Microsoft.AspNetCore.Components.WebAssembly', 'Microsoft.AspNetCore.Components.WebAssembly.Services.DefaultWebAssemblyJSRuntime', 'EndInvokeJS');
|
||||
|
||||
|
@ -449,12 +457,12 @@ function attachInteropInvoker(): void {
|
|||
? dotNetObjectId.toString()
|
||||
: assemblyName;
|
||||
|
||||
dotNetDispatcherBeginInvokeMethodHandle(
|
||||
callId ? callId.toString() : null,
|
||||
assemblyNameOrDotNetObjectId,
|
||||
methodIdentifier,
|
||||
argsJson,
|
||||
);
|
||||
dotNetDispatcherBeginInvokeMethodHandle(
|
||||
callId ? callId.toString() : null,
|
||||
assemblyNameOrDotNetObjectId,
|
||||
methodIdentifier,
|
||||
argsJson,
|
||||
);
|
||||
},
|
||||
endInvokeJSFromDotNet: (asyncHandle, succeeded, serializedArgs): void => {
|
||||
dotNetDispatcherEndInvokeJSMethodHandle(
|
||||
|
@ -473,7 +481,7 @@ function attachInteropInvoker(): void {
|
|||
});
|
||||
}
|
||||
|
||||
async function loadTimezone(timeZoneResource: LoadingResource) : Promise<void> {
|
||||
async function loadTimezone(timeZoneResource: LoadingResource): Promise<void> {
|
||||
const runDependencyId = `blazor:timezonedata`;
|
||||
addRunDependency(runDependencyId);
|
||||
|
||||
|
@ -488,7 +496,23 @@ async function loadTimezone(timeZoneResource: LoadingResource) : Promise<void> {
|
|||
removeRunDependency(runDependencyId);
|
||||
}
|
||||
|
||||
async function loadICUData(icuDataResource: LoadingResource) : Promise<void> {
|
||||
function getICUResourceName(bootConfig: BootJsonData, culture: string | undefined): string {
|
||||
const combinedICUResourceName = 'icudt.dat';
|
||||
if (!culture || bootConfig.icuDataMode == ICUDataMode.All) {
|
||||
return combinedICUResourceName;
|
||||
}
|
||||
|
||||
const prefix = culture.split('-')[0];
|
||||
if (['en', 'fr', 'it', 'de', 'es'].includes(prefix)) {
|
||||
return 'icudt_EFIGS.dat';
|
||||
} else if (['zh', 'ko', 'ja'].includes(prefix)) {
|
||||
return 'icudt_CJK.dat';
|
||||
} else {
|
||||
return 'icudt_no_CJK.dat';
|
||||
}
|
||||
}
|
||||
|
||||
async function loadICUData(icuDataResource: LoadingResource): Promise<void> {
|
||||
const runDependencyId = `blazor:icudata`;
|
||||
addRunDependency(runDependencyId);
|
||||
|
||||
|
@ -496,8 +520,7 @@ async function loadICUData(icuDataResource: LoadingResource) : Promise<void> {
|
|||
const array = new Uint8Array(await request.arrayBuffer());
|
||||
|
||||
const offset = MONO.mono_wasm_load_bytes_into_heap(array);
|
||||
if (!MONO.mono_wasm_load_icu_data(offset))
|
||||
{
|
||||
if (!MONO.mono_wasm_load_icu_data(offset)) {
|
||||
throw new Error("Error loading ICU asset.");
|
||||
}
|
||||
removeRunDependency(runDependencyId);
|
||||
|
|
|
@ -14,6 +14,11 @@ export interface WebAssemblyStartOptions {
|
|||
* Override built-in environment setting on start.
|
||||
*/
|
||||
environment?: string;
|
||||
|
||||
/**
|
||||
* Gets the application culture. This is a name specified in the BCP 47 format. See https://tools.ietf.org/html/bcp47
|
||||
*/
|
||||
applicationCulture?: string;
|
||||
}
|
||||
|
||||
// This type doesn't have to align with anything in BootConfig.
|
||||
|
|
|
@ -35,10 +35,8 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
/// <example>
|
||||
/// @bind-Value="model.PropertyName"
|
||||
/// </example>
|
||||
[AllowNull]
|
||||
[MaybeNull]
|
||||
[Parameter]
|
||||
public TValue Value { get; set; } = default;
|
||||
public TValue? Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a callback that updates the bound value.
|
||||
|
@ -69,17 +67,15 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
/// <summary>
|
||||
/// Gets or sets the current value of the input.
|
||||
/// </summary>
|
||||
[AllowNull]
|
||||
protected TValue CurrentValue
|
||||
protected TValue? CurrentValue
|
||||
{
|
||||
[return: MaybeNull]
|
||||
get => Value!;
|
||||
get => Value;
|
||||
set
|
||||
{
|
||||
var hasChanged = !EqualityComparer<TValue>.Default.Equals(value, Value);
|
||||
if (hasChanged)
|
||||
{
|
||||
Value = value!;
|
||||
Value = value;
|
||||
_ = ValueChanged.InvokeAsync(Value);
|
||||
EditContext.NotifyFieldChanged(FieldIdentifier);
|
||||
}
|
||||
|
@ -148,7 +144,7 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
/// </summary>
|
||||
/// <param name="value">The value to format.</param>
|
||||
/// <returns>A string representation of the value.</returns>
|
||||
protected virtual string? FormatValueAsString([AllowNull] TValue value)
|
||||
protected virtual string? FormatValueAsString(TValue? value)
|
||||
=> value?.ToString();
|
||||
|
||||
/// <summary>
|
||||
|
@ -159,7 +155,7 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
/// <param name="result">An instance of <typeparamref name="TValue"/>.</param>
|
||||
/// <param name="validationErrorMessage">If the value could not be parsed, provides a validation error message.</param>
|
||||
/// <returns>True if the value could be parsed; otherwise false.</returns>
|
||||
protected abstract bool TryParseValueFromString(string? value, [MaybeNull] out TValue result, [NotNullWhen(false)] out string? validationErrorMessage);
|
||||
protected abstract bool TryParseValueFromString(string? value, [MaybeNullWhen(false)] out TValue result, [NotNullWhen(false)] out string? validationErrorMessage);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a string that indicates the status of the field being edited. This will include
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
using Microsoft.AspNetCore.Components.Rendering;
|
||||
|
@ -34,7 +35,7 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override string FormatValueAsString([AllowNull] TValue value)
|
||||
protected override string FormatValueAsString(TValue? value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
|
@ -48,7 +49,7 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override bool TryParseValueFromString(string? value, [MaybeNull] out TValue result, [NotNullWhen(false)] out string? validationErrorMessage)
|
||||
protected override bool TryParseValueFromString(string? value, [MaybeNullWhen(false)] out TValue result, [NotNullWhen(false)] out string? validationErrorMessage)
|
||||
{
|
||||
// Unwrap nullable types. We don't have to deal with receiving empty values for nullable
|
||||
// types here, because the underlying InputBase already covers that.
|
||||
|
@ -70,6 +71,7 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
|
||||
if (success)
|
||||
{
|
||||
Debug.Assert(result != null);
|
||||
validationErrorMessage = null;
|
||||
return true;
|
||||
}
|
||||
|
@ -80,7 +82,7 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
}
|
||||
}
|
||||
|
||||
static bool TryParseDateTime(string? value, [MaybeNullWhen(false)] out TValue result)
|
||||
private static bool TryParseDateTime(string? value, [MaybeNullWhen(false)] out TValue result)
|
||||
{
|
||||
var success = BindConverter.TryConvertToDateTime(value, CultureInfo.InvariantCulture, DateFormat, out var parsedValue);
|
||||
if (success)
|
||||
|
@ -95,7 +97,7 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
}
|
||||
}
|
||||
|
||||
static bool TryParseDateTimeOffset(string? value, [MaybeNullWhen(false)] out TValue result)
|
||||
private static bool TryParseDateTimeOffset(string? value, [MaybeNullWhen(false)] out TValue result)
|
||||
{
|
||||
var success = BindConverter.TryConvertToDateTimeOffset(value, CultureInfo.InvariantCulture, DateFormat, out var parsedValue);
|
||||
if (success)
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
{
|
||||
internal static class InputExtensions
|
||||
{
|
||||
public static bool TryParseSelectableValueFromString<TValue>(this InputBase<TValue> input, string? value, [MaybeNull] out TValue result, [NotNullWhen(false)] out string? validationErrorMessage)
|
||||
public static bool TryParseSelectableValueFromString<TValue>(this InputBase<TValue> input, string? value, [MaybeNullWhen(false)] out TValue result, [NotNullWhen(false)] out string? validationErrorMessage)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
|
@ -73,6 +73,11 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
{
|
||||
var imageFile = await JSRuntime.InvokeAsync<BrowserFile>(InputFileInterop.ToImageFile, _inputFileElement, file.Id, format, maxWidth, maxHeight);
|
||||
|
||||
if (imageFile is null)
|
||||
{
|
||||
throw new InvalidOperationException("ToImageFile returned an unexpected null result.");
|
||||
}
|
||||
|
||||
imageFile.Owner = this;
|
||||
|
||||
return imageFile;
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
using System;
|
||||
using System.Buffers;
|
||||
using System.IO.Pipelines;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.JSInterop;
|
||||
|
@ -64,10 +65,10 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
offset,
|
||||
segmentSize);
|
||||
|
||||
if (bytes.Length != segmentSize)
|
||||
if (bytes is null || bytes.Length != segmentSize)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
$"A segment with size {bytes.Length} bytes was received, but {segmentSize} bytes were expected.");
|
||||
$"A segment with size {bytes?.Length ?? 0} bytes was received, but {segmentSize} bytes were expected.");
|
||||
}
|
||||
|
||||
bytes.CopyTo(pipeBuffer);
|
||||
|
|
|
@ -55,7 +55,7 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override bool TryParseValueFromString(string? value, [MaybeNull] out TValue result, [NotNullWhen(false)] out string? validationErrorMessage)
|
||||
protected override bool TryParseValueFromString(string? value, [MaybeNullWhen(false)] out TValue result, [NotNullWhen(false)] out string? validationErrorMessage)
|
||||
{
|
||||
if (BindConverter.TryConvertTo<TValue>(value, CultureInfo.InvariantCulture, out result))
|
||||
{
|
||||
|
@ -74,7 +74,7 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
/// </summary>
|
||||
/// <param name="value">The value to format.</param>
|
||||
/// <returns>A string representation of the value.</returns>
|
||||
protected override string? FormatValueAsString([AllowNull] TValue value)
|
||||
protected override string? FormatValueAsString(TValue? value)
|
||||
{
|
||||
// Avoiding a cast to IFormattable to avoid boxing.
|
||||
switch (value)
|
||||
|
|
|
@ -27,10 +27,8 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
/// <summary>
|
||||
/// Gets or sets the value of this input.
|
||||
/// </summary>
|
||||
[AllowNull]
|
||||
[MaybeNull]
|
||||
[Parameter]
|
||||
public TValue Value { get; set; } = default;
|
||||
public TValue? Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the parent input radio group.
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override bool TryParseValueFromString(string? value, [MaybeNull] out TValue result, [NotNullWhen(false)] out string? validationErrorMessage)
|
||||
protected override bool TryParseValueFromString(string? value, [MaybeNullWhen(false)] out TValue result, [NotNullWhen(false)] out string? validationErrorMessage)
|
||||
=> this.TryParseSelectableValueFromString(value, out result, out validationErrorMessage);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override bool TryParseValueFromString(string? value, [MaybeNull] out TValue result, [NotNullWhen(false)] out string? validationErrorMessage)
|
||||
protected override bool TryParseValueFromString(string? value, [MaybeNullWhen(false)] out TValue result, [NotNullWhen(false)] out string? validationErrorMessage)
|
||||
=> this.TryParseSelectableValueFromString(value, out result, out validationErrorMessage);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -219,13 +219,52 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
|
|||
var bootJsonPath = Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "blazor.boot.json");
|
||||
var bootJsonData = ReadBootJsonData(result, bootJsonPath);
|
||||
|
||||
Assert.Equal(ICUDataMode.Invariant, bootJsonData.icuDataMode);
|
||||
var runtime = bootJsonData.resources.runtime.Keys;
|
||||
Assert.Contains("dotnet.wasm", runtime);
|
||||
Assert.Contains("dotnet.timezones.blat", runtime);
|
||||
Assert.DoesNotContain("icudt.dat", runtime);
|
||||
Assert.DoesNotContain("icudt_EFIGS.dat", runtime);
|
||||
|
||||
Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "dotnet.wasm");
|
||||
Assert.FileDoesNotExist(result, buildOutputDirectory, "wwwroot", "_framework", "icudt.dat");
|
||||
Assert.FileDoesNotExist(result, buildOutputDirectory, "wwwroot", "_framework", "icudt_CJK.dat");
|
||||
Assert.FileDoesNotExist(result, buildOutputDirectory, "wwwroot", "_framework", "icudt_EFIGS.dat");
|
||||
Assert.FileDoesNotExist(result, buildOutputDirectory, "wwwroot", "_framework", "icudt_no_CJK.dat");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Build_WithBlazorWebAssemblyLoadAllGlobalizationData_SetsICUDataMode()
|
||||
{
|
||||
// Arrange
|
||||
using var project = ProjectDirectory.Create("blazorwasm-minimal");
|
||||
project.AddProjectFileContent(
|
||||
@"
|
||||
<PropertyGroup>
|
||||
<BlazorWebAssemblyLoadAllGlobalizationData>true</BlazorWebAssemblyLoadAllGlobalizationData>
|
||||
</PropertyGroup>");
|
||||
|
||||
var result = await MSBuildProcessManager.DotnetMSBuild(project);
|
||||
|
||||
Assert.BuildPassed(result);
|
||||
|
||||
var buildOutputDirectory = project.BuildOutputDirectory;
|
||||
|
||||
var bootJsonPath = Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "blazor.boot.json");
|
||||
var bootJsonData = ReadBootJsonData(result, bootJsonPath);
|
||||
|
||||
Assert.Equal(ICUDataMode.All, bootJsonData.icuDataMode);
|
||||
var runtime = bootJsonData.resources.runtime.Keys;
|
||||
Assert.Contains("dotnet.wasm", runtime);
|
||||
Assert.Contains("dotnet.timezones.blat", runtime);
|
||||
Assert.Contains("icudt.dat", runtime);
|
||||
Assert.Contains("icudt_EFIGS.dat", runtime);
|
||||
|
||||
Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "dotnet.wasm");
|
||||
Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "icudt.dat");
|
||||
Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "icudt_CJK.dat");
|
||||
Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "icudt_EFIGS.dat");
|
||||
Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "icudt_no_CJK.dat");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
@ -845,12 +845,17 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
|
|||
var bootJsonPath = Path.Combine(publishOutputDirectory, "wwwroot", "_framework", "blazor.boot.json");
|
||||
var bootJsonData = ReadBootJsonData(result, bootJsonPath);
|
||||
|
||||
Assert.Equal(ICUDataMode.Invariant, bootJsonData.icuDataMode);
|
||||
var runtime = bootJsonData.resources.runtime.Keys;
|
||||
Assert.Contains("dotnet.wasm", runtime);
|
||||
Assert.DoesNotContain("icudt.dat", runtime);
|
||||
Assert.DoesNotContain("icudt_EFIGS.dat", runtime);
|
||||
|
||||
Assert.FileExists(result, publishOutputDirectory, "wwwroot", "_framework", "dotnet.wasm");
|
||||
Assert.FileDoesNotExist(result, publishOutputDirectory, "wwwroot", "_framework", "icudt.dat");
|
||||
Assert.FileDoesNotExist(result, publishOutputDirectory, "wwwroot", "_framework", "icudt_CJK.dat");
|
||||
Assert.FileDoesNotExist(result, publishOutputDirectory, "wwwroot", "_framework", "icudt_EFIGS.dat");
|
||||
Assert.FileDoesNotExist(result, publishOutputDirectory, "wwwroot", "_framework", "icudt_no_CJK.dat");
|
||||
}
|
||||
|
||||
private static void AddWasmProjectContent(ProjectDirectory project, string content)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
@ -49,6 +49,11 @@ namespace Microsoft.NET.Sdk.BlazorWebAssembly
|
|||
/// Config files for the application
|
||||
/// </summary>
|
||||
public List<string> config { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="ICUDataMode"/> that determines how icu files are loaded.
|
||||
/// </summary>
|
||||
public ICUDataMode icuDataMode { get; set; }
|
||||
}
|
||||
|
||||
public class ResourcesData
|
||||
|
@ -81,5 +86,23 @@ namespace Microsoft.NET.Sdk.BlazorWebAssembly
|
|||
[DataMember(EmitDefaultValue = false)]
|
||||
public ResourceHashesByNameDictionary lazyAssembly { get; set; }
|
||||
}
|
||||
|
||||
public enum ICUDataMode
|
||||
{
|
||||
/// <summary>
|
||||
/// Load optimized icu data file based on the user's locale
|
||||
/// </summary>
|
||||
Sharded,
|
||||
|
||||
/// <summary>
|
||||
/// Use the combined icudt.dat file
|
||||
/// </summary>
|
||||
All,
|
||||
|
||||
/// <summary>
|
||||
/// Do not load any icu data files.
|
||||
/// </summary>
|
||||
Invariant,
|
||||
}
|
||||
#pragma warning restore IDE1006 // Naming Styles
|
||||
}
|
||||
|
|
|
@ -31,6 +31,10 @@ namespace Microsoft.NET.Sdk.BlazorWebAssembly
|
|||
[Required]
|
||||
public bool CacheBootResources { get; set; }
|
||||
|
||||
public bool LoadAllICUData { get; set; }
|
||||
|
||||
public string InvariantGlobalization { get; set; }
|
||||
|
||||
public ITaskItem[] ConfigurationFiles { get; set; }
|
||||
|
||||
[Required]
|
||||
|
@ -58,6 +62,17 @@ namespace Microsoft.NET.Sdk.BlazorWebAssembly
|
|||
// Internal for tests
|
||||
public void WriteBootJson(Stream output, string entryAssemblyName)
|
||||
{
|
||||
var icuDataMode = ICUDataMode.Sharded;
|
||||
|
||||
if (string.Equals(InvariantGlobalization, "true", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
icuDataMode = ICUDataMode.Invariant;
|
||||
}
|
||||
else if (LoadAllICUData)
|
||||
{
|
||||
icuDataMode = ICUDataMode.All;
|
||||
}
|
||||
|
||||
var result = new BootJsonData
|
||||
{
|
||||
entryAssembly = entryAssemblyName,
|
||||
|
@ -66,6 +81,7 @@ namespace Microsoft.NET.Sdk.BlazorWebAssembly
|
|||
linkerEnabled = LinkerEnabled,
|
||||
resources = new ResourcesData(),
|
||||
config = new List<string>(),
|
||||
icuDataMode = icuDataMode,
|
||||
};
|
||||
|
||||
// Build a two-level dictionary of the form:
|
||||
|
|
|
@ -126,6 +126,9 @@ Copyright (c) .NET Foundation. All rights reserved.
|
|||
<_BlazorSatelliteAssemblyCacheFile>$(IntermediateOutputPath)blazor.satelliteasm.props</_BlazorSatelliteAssemblyCacheFile>
|
||||
<!-- Workaround for https://github.com/dotnet/sdk/issues/12114-->
|
||||
<PublishDir Condition="'$(AppendRuntimeIdentifierToOutputPath)' != 'true' AND '$(PublishDir)' == '$(OutputPath)$(RuntimeIdentifier)\$(PublishDirName)\'">$(OutputPath)$(PublishDirName)\</PublishDir>
|
||||
|
||||
<_BlazorWebAssemblyLoadAllGlobalizationData>$(BlazorWebAssemblyLoadAllGlobalizationData)</_BlazorWebAssemblyLoadAllGlobalizationData>
|
||||
<_BlazorWebAssemblyLoadAllGlobalizationData Condition="'$(_BlazorWebAssemblyLoadAllGlobalizationData)' == ''">false</_BlazorWebAssemblyLoadAllGlobalizationData>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -141,7 +144,7 @@ Copyright (c) .NET Foundation. All rights reserved.
|
|||
Condition="'$(BlazorEnableTimeZoneSupport)' == 'false' AND '%(ReferenceCopyLocalPaths.FileName)%(ReferenceCopyLocalPaths.Extension)' == 'dotnet.timezones.blat'" />
|
||||
|
||||
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)"
|
||||
Condition="'$(InvariantGlobalization)' == 'true' AND '%(ReferenceCopyLocalPaths.FileName)%(ReferenceCopyLocalPaths.Extension)' == 'icudt.dat'" />
|
||||
Condition="'$(InvariantGlobalization)' == 'true' AND '%(ReferenceCopyLocalPaths.Extension)' == '.dat' AND $([System.String]::Copy('%(ReferenceCopyLocalPaths.FileName)').StartsWith('icudt'))" />
|
||||
|
||||
<!--
|
||||
ReferenceCopyLocalPaths includes satellite assemblies from referenced projects but are inexpicably missing
|
||||
|
@ -282,6 +285,7 @@ Copyright (c) .NET Foundation. All rights reserved.
|
|||
<PropertyGroup>
|
||||
<_BlazorBuildBootJsonPath>$(IntermediateOutputPath)blazor.boot.json</_BlazorBuildBootJsonPath>
|
||||
<_BlazorOutputContent>@(_BlazorOutputWithHash)</_BlazorOutputContent>
|
||||
<_BlazorWebAssemblyLoadAllGlobalizationData Condition="'$(BlazorWebAssemblyLoadAllGlobalizationData)' == ''">false</_BlazorWebAssemblyLoadAllGlobalizationData>
|
||||
</PropertyGroup>
|
||||
|
||||
<Error
|
||||
|
@ -297,7 +301,9 @@ Copyright (c) .NET Foundation. All rights reserved.
|
|||
CacheBootResources="$(BlazorCacheBootResources)"
|
||||
OutputPath="$(_BlazorBuildBootJsonPath)"
|
||||
ConfigurationFiles="@(_BlazorConfigFile)"
|
||||
LazyLoadedAssemblies="@(BlazorWebAssemblyLazyLoad)" />
|
||||
LazyLoadedAssemblies="@(BlazorWebAssemblyLazyLoad)"
|
||||
InvariantGlobalization="$(InvariantGlobalization)"
|
||||
LoadAllICUData="$(_BlazorWebAssemblyLoadAllGlobalizationData)" />
|
||||
|
||||
<ItemGroup>
|
||||
<FileWrites Include="$(OutDir)$(_BlazorOutputPath)blazor.boot.json" />
|
||||
|
@ -467,7 +473,7 @@ Copyright (c) .NET Foundation. All rights reserved.
|
|||
Condition="'$(BlazorEnableTimeZoneSupport)' == 'false' AND '%(ResolvedFileToPublish.FileName)%(ResolvedFileToPublish.Extension)' == 'dotnet.timezones.blat'" />
|
||||
|
||||
<ResolvedFileToPublish Remove="@(ResolvedFileToPublish)"
|
||||
Condition="'$(InvariantGlobalization)' == 'true' AND '%(ResolvedFileToPublish.FileName)%(ResolvedFileToPublish.Extension)' == 'icudt.dat'" />
|
||||
Condition="'$(InvariantGlobalization)' == 'true' AND '%(ResolvedFileToPublish.Extension)' == '.dat' AND $([System.String]::Copy('%(ResolvedFileToPublish.FileName)').StartsWith('icudt'))" />
|
||||
|
||||
<!-- Remove dotnet.js from publish output -->
|
||||
<ResolvedFileToPublish Remove="@(ResolvedFileToPublish)" Condition="'%(ResolvedFileToPublish.RelativePath)' == 'dotnet.js'" />
|
||||
|
@ -503,7 +509,7 @@ Copyright (c) .NET Foundation. All rights reserved.
|
|||
<PropertyGroup>
|
||||
<_BlazorOutputContent>@(_BlazorPublishBootResourceWithHash)</_BlazorOutputContent>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<Error
|
||||
Text="Unable to find %(BlazorWebAssemblyLazyLoad.Identity) to be lazy loaded later. Confirm that project or package references are included and the reference is used in the project."
|
||||
Code="BLAZORSDK1001"
|
||||
|
@ -517,7 +523,9 @@ Copyright (c) .NET Foundation. All rights reserved.
|
|||
CacheBootResources="$(BlazorCacheBootResources)"
|
||||
OutputPath="$(IntermediateOutputPath)blazor.publish.boot.json"
|
||||
ConfigurationFiles="@(_BlazorConfigFile)"
|
||||
LazyLoadedAssemblies="@(BlazorWebAssemblyLazyLoad)" />
|
||||
LazyLoadedAssemblies="@(BlazorWebAssemblyLazyLoad)"
|
||||
InvariantGlobalization="$(InvariantGlobalization)"
|
||||
LoadAllICUData="$(_BlazorWebAssemblyLoadAllGlobalizationData)" />
|
||||
|
||||
<ItemGroup>
|
||||
<ResolvedFileToPublish
|
||||
|
|
|
@ -252,6 +252,7 @@ namespace Wasm.Performance.Driver
|
|||
static void PrettyPrint(BenchmarkResult benchmarkResult)
|
||||
{
|
||||
Console.WriteLine();
|
||||
Console.WriteLine($"Download size: {(benchmarkResult.DownloadSize / 1024)}kb.");
|
||||
Console.WriteLine("| Name | Description | Duration | NumExecutions | ");
|
||||
Console.WriteLine("--------------------------");
|
||||
foreach (var result in benchmarkResult.ScenarioResults)
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
<ProjectReference Include="..\..\WebAssembly\testassets\HostedInAspNet.Server\HostedInAspNet.Server.csproj" />
|
||||
<ProjectReference Include="..\..\WebAssembly\testassets\StandaloneApp\StandaloneApp.csproj" />
|
||||
<ProjectReference Include="..\testassets\BasicTestApp\BasicTestApp.csproj" />
|
||||
<ProjectReference Include="..\testassets\GlobalizationWasmApp\GlobalizationWasmApp.csproj" />
|
||||
<ProjectReference Include="..\testassets\TestServer\Components.TestServer.csproj" />
|
||||
<ProjectReference Include="..\..\WebAssembly\testassets\Wasm.Authentication.Server\Wasm.Authentication.Server.csproj" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -47,7 +47,7 @@ namespace Microsoft.AspNetCore.Components.E2ETest.ServerExecutionTests
|
|||
Browser.MountTestComponent<CounterComponent>();
|
||||
Browser.Equal("Current count: 0", () => Browser.FindElement(By.TagName("p")).Text);
|
||||
|
||||
GracefulDisconnectCompletionSource = new TaskCompletionSource<object>(TaskContinuationOptions.RunContinuationsAsynchronously);
|
||||
GracefulDisconnectCompletionSource = new TaskCompletionSource<object>(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||
Sink = _serverFixture.Host.Services.GetRequiredService<TestSink>();
|
||||
Messages = new List<(Extensions.Logging.LogLevel level, string eventIdName)>();
|
||||
Sink.MessageLogged += Log;
|
||||
|
|
|
@ -16,7 +16,7 @@ using Xunit.Abstractions;
|
|||
|
||||
namespace Microsoft.AspNetCore.Components.E2ETest.Tests
|
||||
{
|
||||
public class ClientRenderingMultpleComponentsTest : ServerTestBase<BasicTestAppServerSiteFixture<MultipleComponents>>
|
||||
public class ClientRenderingMultpleComponentsTest : E2ETest.Infrastructure.ServerTestBase<BasicTestAppServerSiteFixture<MultipleComponents>>
|
||||
{
|
||||
private const string MarkerPattern = ".*?<!--Blazor:(.*?)-->.*?";
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ using Xunit.Abstractions;
|
|||
|
||||
namespace Microsoft.AspNetCore.Components.E2ETest.Tests
|
||||
{
|
||||
public class HeadComponentsTest : ServerTestBase<ToggleExecutionModeServerFixture<Program>>
|
||||
public class HeadComponentsTest : E2ETest.Infrastructure.ServerTestBase<ToggleExecutionModeServerFixture<Program>>
|
||||
{
|
||||
public HeadComponentsTest(
|
||||
BrowserFixture browserFixture,
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using BasicTestApp;
|
||||
using Microsoft.AspNetCore.Components.E2ETest.Infrastructure;
|
||||
using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures;
|
||||
using Microsoft.AspNetCore.E2ETesting;
|
||||
using OpenQA.Selenium;
|
||||
using TestServer;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace Microsoft.AspNetCore.Components.E2ETest.Tests
|
||||
{
|
||||
public class SignalRClientTest : ServerTestBase<DevHostServerFixture<BasicTestApp.Program>>,
|
||||
IClassFixture<BasicTestAppServerSiteFixture<CorsStartup>>
|
||||
{
|
||||
private readonly ServerFixture _apiServerFixture;
|
||||
|
||||
public SignalRClientTest(
|
||||
BrowserFixture browserFixture,
|
||||
DevHostServerFixture<BasicTestApp.Program> devHostServerFixture,
|
||||
BasicTestAppServerSiteFixture<CorsStartup> apiServerFixture,
|
||||
ITestOutputHelper output)
|
||||
: base(browserFixture, devHostServerFixture, output)
|
||||
{
|
||||
_serverFixture.PathBase = "/subdir";
|
||||
_apiServerFixture = apiServerFixture;
|
||||
}
|
||||
|
||||
protected override void InitializeAsyncCore()
|
||||
{
|
||||
Navigate(ServerPathBase);
|
||||
Browser.MountTestComponent<SignalRClientComponent>();
|
||||
Browser.Exists(By.Id("signalr-client"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SignalRClientWorks()
|
||||
{
|
||||
Browser.FindElement(By.Id("hub-url")).SendKeys(
|
||||
new Uri(_apiServerFixture.RootUri, "/subdir/chathub").AbsoluteUri);
|
||||
Browser.FindElement(By.Id("hub-connect")).Click();
|
||||
|
||||
Browser.Equal("SignalR Client: Echo",
|
||||
() => Browser.FindElements(By.CssSelector("li")).FirstOrDefault()?.Text);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -13,7 +13,7 @@ using Xunit.Abstractions;
|
|||
|
||||
namespace Microsoft.AspNetCore.Components.E2ETest.Tests
|
||||
{
|
||||
public class VirtualizationTest : ServerTestBase<ToggleExecutionModeServerFixture<Program>>
|
||||
public class VirtualizationTest : E2ETest.Infrastructure.ServerTestBase<ToggleExecutionModeServerFixture<Program>>
|
||||
{
|
||||
public VirtualizationTest(
|
||||
BrowserFixture browserFixture,
|
||||
|
|
|
@ -14,9 +14,7 @@ namespace Microsoft.AspNetCore.Components.E2ETest.Tests
|
|||
{
|
||||
// For now this is limited to server-side execution because we don't have the ability to set the
|
||||
// culture in client-side Blazor.
|
||||
// This type is internal since localization currently does not work.
|
||||
// Make it public onc https://github.com/dotnet/runtime/issues/38124 is resolved.
|
||||
internal class WebAssemblyGlobalizationTest : GlobalizationTest<ToggleExecutionModeServerFixture<Program>>
|
||||
public class WebAssemblyGlobalizationTest : GlobalizationTest<ToggleExecutionModeServerFixture<Program>>
|
||||
{
|
||||
public WebAssemblyGlobalizationTest(
|
||||
BrowserFixture browserFixture,
|
||||
|
|
|
@ -0,0 +1,122 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Globalization;
|
||||
using GlobalizationWasmApp;
|
||||
using Microsoft.AspNetCore.Components.E2ETest.Infrastructure;
|
||||
using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures;
|
||||
using Microsoft.AspNetCore.E2ETesting;
|
||||
using OpenQA.Selenium;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace Microsoft.AspNetCore.Components.E2ETest.Tests
|
||||
{
|
||||
// Blazor WebAssembly loads ICU (globalization) data for subset of cultures by default.
|
||||
// This app covers testing this along with verifying the behavior for fallback culture for localized resources.
|
||||
public class WebAssemblyICUShardingTest : ServerTestBase<ToggleExecutionModeServerFixture<Program>>
|
||||
{
|
||||
public WebAssemblyICUShardingTest(
|
||||
BrowserFixture browserFixture,
|
||||
ToggleExecutionModeServerFixture<Program> serverFixture,
|
||||
ITestOutputHelper output)
|
||||
: base(browserFixture, serverFixture, output)
|
||||
{
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LoadingApp_FrenchLanguage_Works()
|
||||
{
|
||||
// Arrange
|
||||
// This verifies the EFIGS icu data set.
|
||||
var culture = new CultureInfo("fr-FR");
|
||||
Initialize(culture);
|
||||
|
||||
var cultureDisplay = Browser.Exists(By.Id("culture"));
|
||||
Assert.Equal(culture.ToString(), cultureDisplay.Text);
|
||||
|
||||
var dateDisplay = Browser.Exists(By.Id("dateTime"));
|
||||
Assert.Equal("02/09/2020 00:00:00", dateDisplay.Text);
|
||||
|
||||
var localizedDisplay = Browser.Exists(By.Id("localizedString"));
|
||||
Assert.Equal("Bonjour!", localizedDisplay.Text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LoadingApp_KoreanLanguage_Works()
|
||||
{
|
||||
// Arrange
|
||||
// This verifies the CJK icu data set.
|
||||
var culture = new CultureInfo("ko-KO");
|
||||
Initialize(culture);
|
||||
|
||||
var cultureDisplay = Browser.Exists(By.Id("culture"));
|
||||
Assert.Equal(culture.ToString(), cultureDisplay.Text);
|
||||
|
||||
var dateDisplay = Browser.Exists(By.Id("dateTime"));
|
||||
Assert.Equal("2020. 9. 2. 오전 12:00:00", dateDisplay.Text);
|
||||
|
||||
var localizedDisplay = Browser.Exists(By.Id("localizedString"));
|
||||
// The app has a "ko" resx file. This test verifies that we can walk up the culture hierarchy correctly.
|
||||
Assert.Equal("안녕하세요", localizedDisplay.Text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LoadingApp_RussianLanguage_Works()
|
||||
{
|
||||
// Arrange
|
||||
// This verifies the non-CJK icu data set.
|
||||
var culture = new CultureInfo("ru");
|
||||
Initialize(culture);
|
||||
|
||||
var cultureDisplay = Browser.Exists(By.Id("culture"));
|
||||
Assert.Equal(culture.ToString(), cultureDisplay.Text);
|
||||
|
||||
var dateDisplay = Browser.Exists(By.Id("dateTime"));
|
||||
Assert.Equal("02.09.2020 00:00:00", dateDisplay.Text);
|
||||
|
||||
var localizedDisplay = Browser.Exists(By.Id("localizedString"));
|
||||
Assert.Equal("Hello", localizedDisplay.Text); // No localized resources for this culture.
|
||||
}
|
||||
|
||||
[Fact(Skip = "Figure out why this is broken")]
|
||||
public void LoadingApp_KannadaLanguage_Works()
|
||||
{
|
||||
// Arrange
|
||||
// This verifies the non-CJK icu data set.
|
||||
var culture = new CultureInfo("kn");
|
||||
Initialize(culture);
|
||||
|
||||
var cultureDisplay = Browser.Exists(By.Id("culture"));
|
||||
Assert.Equal(culture.ToString(), cultureDisplay.Text);
|
||||
|
||||
var dateDisplay = Browser.Exists(By.Id("dateTime"));
|
||||
Assert.Equal("2/9/2020 12:00:00 ಪೂರ್ವಾಹ್ನ", dateDisplay.Text);
|
||||
|
||||
var localizedDisplay = Browser.Exists(By.Id("localizedString"));
|
||||
Assert.Equal("ಹಲೋ", localizedDisplay.Text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LoadingApp_DynamicallySetLanguageThrows()
|
||||
{
|
||||
// Arrange
|
||||
// This verifies that we complain if the app programtically configures a language.
|
||||
Navigate($"{ServerPathBase}/?culture=fr&dotNetCulture=es", noReload: false);
|
||||
|
||||
var errorUi = Browser.Exists(By.Id("blazor-error-ui"));
|
||||
Browser.Equal("block", () => errorUi.GetCssValue("display"));
|
||||
|
||||
// Browser logs cannot be retrieved: https://github.com/dotnet/aspnetcore/issues/25803"
|
||||
// var expected = "This application's globalization settings requires using the combined globalization data file.";
|
||||
// var logs = Browser.GetBrowserLogs(LogLevel.Severe).Select(l => l.Message);
|
||||
// Assert.True(logs.Any(l => l.Contains(expected)),
|
||||
// $"Expected to see globalization error message in the browser logs: {string.Join(Environment.NewLine, logs)}.");
|
||||
}
|
||||
|
||||
private void Initialize(CultureInfo culture)
|
||||
{
|
||||
Navigate($"{ServerPathBase}/?culture={culture}", noReload: false);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,7 +2,6 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using BasicTestApp;
|
||||
using Microsoft.AspNetCore.Components.E2ETest;
|
||||
using Microsoft.AspNetCore.Components.E2ETest.Infrastructure;
|
||||
using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures;
|
||||
using Microsoft.AspNetCore.E2ETesting;
|
||||
|
|
|
@ -8,6 +8,9 @@
|
|||
|
||||
<!-- Resx generation on Resources.resx only -->
|
||||
<GenerateResxSource>false</GenerateResxSource>
|
||||
|
||||
<!-- Project supports more than one language -->
|
||||
<BlazorWebAssemblyLoadAllGlobalizationData>true</BlazorWebAssemblyLoadAllGlobalizationData>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -16,6 +19,7 @@
|
|||
<Reference Include="Microsoft.AspNetCore.Components.WebAssembly" />
|
||||
<Reference Include="Microsoft.AspNetCore.Components.Authorization" />
|
||||
<Reference Include="Microsoft.AspNetCore.Components.Web.Extensions" />
|
||||
<Reference Include="Microsoft.AspNetCore.SignalR.Client" />
|
||||
<Reference Include="Microsoft.Extensions.Logging.Configuration" />
|
||||
<Reference Include="Newtonsoft.Json" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -80,6 +80,7 @@
|
|||
<option value="BasicTestApp.RouterTest.TestRouterWithOnNavigate">Router with OnNavigate</option>
|
||||
<option value="BasicTestApp.RouterTest.TestRouterWithLazyAssembly">Router with dynamic assembly</option>
|
||||
<option value="BasicTestApp.RouterTest.TestRouterWithAdditionalAssembly">Router with additional assembly</option>
|
||||
<option value="BasicTestApp.SignalRClientComponent">SignalR client</option>
|
||||
<option value="BasicTestApp.StringComparisonComponent">StringComparison</option>
|
||||
<option value="BasicTestApp.SvgComponent">SVG</option>
|
||||
<option value="BasicTestApp.SvgWithChildComponent">SVG with child component</option>
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
@using Microsoft.AspNetCore.SignalR.Client
|
||||
|
||||
<h1 id="signalr-client">SignalR Client</h1>
|
||||
|
||||
<p>This shows that the SignalR client can be used on WebAssembly.</p>
|
||||
|
||||
<p>
|
||||
Hub URL:
|
||||
<input id="hub-url" @bind="hubUrl" />
|
||||
<button id="hub-connect" @onclick="Connect">Connect</button>
|
||||
</p>
|
||||
|
||||
<div>Connected: @IsConnected</div>
|
||||
|
||||
<ul id="messagesList">
|
||||
@foreach (var message in messages)
|
||||
{
|
||||
<li>@message</li>
|
||||
}
|
||||
</ul>
|
||||
|
||||
@code {
|
||||
private string hubUrl;
|
||||
private HubConnection hubConnection;
|
||||
private List<string> messages = new List<string>();
|
||||
|
||||
protected async Task Connect()
|
||||
{
|
||||
hubConnection = new HubConnectionBuilder()
|
||||
.WithUrl(hubUrl)
|
||||
.Build();
|
||||
|
||||
hubConnection.On<string, string>("ReceiveMessage", (user, message) =>
|
||||
{
|
||||
var encodedMsg = $"{user}: {message}";
|
||||
messages.Add(encodedMsg);
|
||||
StateHasChanged();
|
||||
});
|
||||
|
||||
await hubConnection.StartAsync();
|
||||
await hubConnection.SendAsync("SendMessage", "SignalR Client", "Echo");
|
||||
}
|
||||
|
||||
public bool IsConnected =>
|
||||
hubConnection != null && hubConnection.State == HubConnectionState.Connected;
|
||||
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
return hubConnection.DisposeAsync();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,123 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Hello" xml:space="preserve">
|
||||
<value>Bonjour!</value>
|
||||
</data>
|
||||
</root>
|
|
@ -0,0 +1,123 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Hello" xml:space="preserve">
|
||||
<value>ಹಲೋ</value>
|
||||
</data>
|
||||
</root>
|
|
@ -0,0 +1,123 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Hello" xml:space="preserve">
|
||||
<value>안녕하세요</value>
|
||||
</data>
|
||||
</root>
|
|
@ -0,0 +1,8 @@
|
|||
@using System.Globalization
|
||||
@inject Microsoft.Extensions.Localization.IStringLocalizer<App> Loc
|
||||
|
||||
<p>App's culture: <span id="culture">@CultureInfo.CurrentCulture</span></p>
|
||||
|
||||
<p>DateTime: <span id="dateTime">@(new DateTime(2020, 09, 02))</span></p>
|
||||
|
||||
<p>Localized string: <span id="localizedString">@Loc["Hello"]</span></p>
|
|
@ -0,0 +1,18 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
|
||||
|
||||
<AdditionalRunArguments>--pathbase /subdir</AdditionalRunArguments>
|
||||
|
||||
<!-- Resx generation on Resources.resx only -->
|
||||
<GenerateResxSource>false</GenerateResxSource>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.AspNetCore.Components.WebAssembly" />
|
||||
<Reference Include="Microsoft.Extensions.Localization" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,39 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace GlobalizationWasmApp
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static async Task Main(string[] args)
|
||||
{
|
||||
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
||||
builder.Services.AddLocalization();
|
||||
builder.RootComponents.Add<App>("app");
|
||||
|
||||
var host = builder.Build();
|
||||
ConfigureCulture(host);
|
||||
|
||||
await host.RunAsync();
|
||||
}
|
||||
|
||||
private static void ConfigureCulture(WebAssemblyHost host)
|
||||
{
|
||||
var uri = new Uri(host.Services.GetService<NavigationManager>().Uri);
|
||||
|
||||
var cultureName = HttpUtility.ParseQueryString(uri.Query)["dotNetCulture"] ?? HttpUtility.ParseQueryString(uri.Query)["culture"];
|
||||
|
||||
var culture = new CultureInfo(cultureName);
|
||||
CultureInfo.DefaultThreadCurrentCulture = culture;
|
||||
CultureInfo.DefaultThreadCurrentUICulture = culture;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<head>
|
||||
<style>
|
||||
#blazor-error-ui { display: none }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="blazor-error-ui">Error</div>
|
||||
<app>Loading...</app>
|
||||
<script src="_framework/blazor.webassembly.js" autostart="false"></script>
|
||||
<script>
|
||||
(function(){
|
||||
const search = new window.URLSearchParams(window.location.search);
|
||||
const culture = search.get('culture');
|
||||
Blazor.start({ applicationCulture: culture });
|
||||
})();
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
|
||||
namespace TestServer
|
||||
{
|
||||
public class ChatHub : Hub
|
||||
{
|
||||
public async Task SendMessage(string user, string message)
|
||||
{
|
||||
await Clients.All.SendAsync("ReceiveMessage", user, message);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -18,6 +18,7 @@ namespace TestServer
|
|||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddSignalR();
|
||||
services.AddMvc();
|
||||
services.AddCors(options =>
|
||||
{
|
||||
|
@ -50,10 +51,11 @@ namespace TestServer
|
|||
|
||||
app.UseRouting();
|
||||
|
||||
app.UseCors();
|
||||
app.UseCors("AllowAll");
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapHub<ChatHub>("/chathub");
|
||||
endpoints.MapControllers();
|
||||
endpoints.MapFallbackToFile("index.html");
|
||||
});
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography;
|
||||
using Microsoft.AspNetCore.Cryptography;
|
||||
using Microsoft.AspNetCore.Cryptography.Cng;
|
||||
|
@ -52,6 +54,8 @@ namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption
|
|||
throw new PlatformNotSupportedException(Resources.Platform_WindowsRequiredForGcm);
|
||||
}
|
||||
|
||||
Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
|
||||
|
||||
var configuration = new CngGcmAuthenticatedEncryptorConfiguration()
|
||||
{
|
||||
EncryptionAlgorithm = GetBCryptAlgorithmNameFromEncryptionAlgorithm(authenticatedConfiguration.EncryptionAlgorithm),
|
||||
|
@ -64,6 +68,7 @@ namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption
|
|||
{
|
||||
if (OSVersionUtil.IsWindows())
|
||||
{
|
||||
Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
|
||||
// CNG preferred over managed implementations if running on Windows
|
||||
var configuration = new CngCbcAuthenticatedEncryptorConfiguration()
|
||||
{
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
using Microsoft.AspNetCore.Cryptography;
|
||||
using Microsoft.AspNetCore.Cryptography.Cng;
|
||||
using Microsoft.AspNetCore.Cryptography.SafeHandles;
|
||||
|
@ -32,9 +35,11 @@ namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption
|
|||
return null;
|
||||
}
|
||||
|
||||
Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
|
||||
return CreateAuthenticatedEncryptorInstance(descriptor.MasterKey, descriptor.Configuration);
|
||||
}
|
||||
|
||||
[SupportedOSPlatform("windows")]
|
||||
internal CbcAuthenticatedEncryptor CreateAuthenticatedEncryptorInstance(
|
||||
ISecret secret,
|
||||
CngCbcAuthenticatedEncryptorConfiguration configuration)
|
||||
|
@ -51,6 +56,7 @@ namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption
|
|||
hmacAlgorithmHandle: GetHmacAlgorithmHandle(configuration));
|
||||
}
|
||||
|
||||
[SupportedOSPlatform("windows")]
|
||||
private BCryptAlgorithmHandle GetHmacAlgorithmHandle(CngCbcAuthenticatedEncryptorConfiguration configuration)
|
||||
{
|
||||
// basic argument checking
|
||||
|
@ -84,6 +90,7 @@ namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption
|
|||
return algorithmHandle;
|
||||
}
|
||||
|
||||
[SupportedOSPlatform("windows")]
|
||||
private BCryptAlgorithmHandle GetSymmetricBlockCipherAlgorithmHandle(CngCbcAuthenticatedEncryptorConfiguration configuration)
|
||||
{
|
||||
// basic argument checking
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
using Microsoft.AspNetCore.Cryptography;
|
||||
using Microsoft.AspNetCore.Cryptography.Cng;
|
||||
using Microsoft.AspNetCore.Cryptography.SafeHandles;
|
||||
|
@ -32,9 +35,12 @@ namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption
|
|||
return null;
|
||||
}
|
||||
|
||||
Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
|
||||
|
||||
return CreateAuthenticatedEncryptorInstance(descriptor.MasterKey, descriptor.Configuration);
|
||||
}
|
||||
|
||||
[SupportedOSPlatform("windows")]
|
||||
internal GcmAuthenticatedEncryptor CreateAuthenticatedEncryptorInstance(
|
||||
ISecret secret,
|
||||
CngGcmAuthenticatedEncryptorConfiguration configuration)
|
||||
|
@ -50,6 +56,7 @@ namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption
|
|||
symmetricAlgorithmKeySizeInBytes: (uint)(configuration.EncryptionAlgorithmKeySize / 8));
|
||||
}
|
||||
|
||||
[SupportedOSPlatform("windows")]
|
||||
private BCryptAlgorithmHandle GetSymmetricBlockCipherAlgorithmHandle(CngGcmAuthenticatedEncryptorConfiguration configuration)
|
||||
{
|
||||
// basic argument checking
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Runtime.Versioning;
|
||||
using Microsoft.AspNetCore.Cryptography;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
|
||||
|
@ -10,6 +11,7 @@ namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.Configurat
|
|||
/// Represents a configured authenticated encryption mechanism which uses
|
||||
/// Windows CNG algorithms in CBC encryption + HMAC authentication modes.
|
||||
/// </summary>
|
||||
[SupportedOSPlatform("windows")]
|
||||
public sealed class CngCbcAuthenticatedEncryptorConfiguration : AlgorithmConfiguration, IInternalAlgorithmConfiguration
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Runtime.Versioning;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel
|
||||
|
@ -10,6 +11,7 @@ namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.Configurat
|
|||
/// A descriptor which can create an authenticated encryption system based upon the
|
||||
/// configuration provided by an <see cref="CngCbcAuthenticatedEncryptorConfiguration"/> object.
|
||||
/// </summary>
|
||||
[SupportedOSPlatform("windows")]
|
||||
public sealed class CngCbcAuthenticatedEncryptorDescriptor : IAuthenticatedEncryptorDescriptor
|
||||
{
|
||||
public CngCbcAuthenticatedEncryptorDescriptor(CngCbcAuthenticatedEncryptorConfiguration configuration, ISecret masterKey)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Runtime.Versioning;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel
|
||||
|
@ -10,6 +11,7 @@ namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.Configurat
|
|||
/// A class that can deserialize an <see cref="XElement"/> that represents the serialized version
|
||||
/// of an <see cref="CngCbcAuthenticatedEncryptorDescriptor"/>.
|
||||
/// </summary>
|
||||
[SupportedOSPlatform("windows")]
|
||||
public sealed class CngCbcAuthenticatedEncryptorDescriptorDeserializer : IAuthenticatedEncryptorDescriptorDeserializer
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Runtime.Versioning;
|
||||
using Microsoft.AspNetCore.Cryptography;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
|
||||
|
@ -10,6 +11,7 @@ namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.Configurat
|
|||
/// Represents a configured authenticated encryption mechanism which uses
|
||||
/// Windows CNG algorithms in GCM encryption + authentication modes.
|
||||
/// </summary>
|
||||
[SupportedOSPlatform("windows")]
|
||||
public sealed class CngGcmAuthenticatedEncryptorConfiguration : AlgorithmConfiguration, IInternalAlgorithmConfiguration
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Runtime.Versioning;
|
||||
using System.Xml.Linq;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel
|
||||
{
|
||||
|
@ -11,6 +11,7 @@ namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.Configurat
|
|||
/// A descriptor which can create an authenticated encryption system based upon the
|
||||
/// configuration provided by an <see cref="CngGcmAuthenticatedEncryptorConfiguration"/> object.
|
||||
/// </summary>
|
||||
[SupportedOSPlatform("windows")]
|
||||
public sealed class CngGcmAuthenticatedEncryptorDescriptor : IAuthenticatedEncryptorDescriptor
|
||||
{
|
||||
public CngGcmAuthenticatedEncryptorDescriptor(CngGcmAuthenticatedEncryptorConfiguration configuration, ISecret masterKey)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Runtime.Versioning;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel
|
||||
|
@ -10,6 +11,7 @@ namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.Configurat
|
|||
/// A class that can deserialize an <see cref="XElement"/> that represents the serialized version
|
||||
/// of an <see cref="CngGcmAuthenticatedEncryptorDescriptor"/>.
|
||||
/// </summary>
|
||||
[SupportedOSPlatform("windows")]
|
||||
public sealed class CngGcmAuthenticatedEncryptorDescriptorDeserializer : IAuthenticatedEncryptorDescriptorDeserializer
|
||||
{
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Runtime.Versioning;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using Microsoft.AspNetCore.Cryptography;
|
||||
using Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption;
|
||||
|
@ -223,6 +224,7 @@ namespace Microsoft.AspNetCore.DataProtection
|
|||
/// <param name="builder">The <see cref="IDataProtectionBuilder"/>.</param>
|
||||
/// <param name="registryKey">The location in the registry where keys should be stored.</param>
|
||||
/// <returns>A reference to the <see cref="IDataProtectionBuilder" /> after this operation has completed.</returns>
|
||||
[SupportedOSPlatform("windows")]
|
||||
public static IDataProtectionBuilder PersistKeysToRegistry(this IDataProtectionBuilder builder, RegistryKey registryKey)
|
||||
{
|
||||
if (builder == null)
|
||||
|
@ -356,6 +358,7 @@ namespace Microsoft.AspNetCore.DataProtection
|
|||
/// <remarks>
|
||||
/// This API is only supported on Windows platforms.
|
||||
/// </remarks>
|
||||
[SupportedOSPlatform("windows")]
|
||||
public static IDataProtectionBuilder ProtectKeysWithDpapi(this IDataProtectionBuilder builder)
|
||||
{
|
||||
if (builder == null)
|
||||
|
@ -378,6 +381,7 @@ namespace Microsoft.AspNetCore.DataProtection
|
|||
/// <remarks>
|
||||
/// This API is only supported on Windows platforms.
|
||||
/// </remarks>
|
||||
[SupportedOSPlatform("windows")]
|
||||
public static IDataProtectionBuilder ProtectKeysWithDpapi(this IDataProtectionBuilder builder, bool protectToLocalMachine)
|
||||
{
|
||||
if (builder == null)
|
||||
|
@ -408,6 +412,7 @@ namespace Microsoft.AspNetCore.DataProtection
|
|||
/// See https://msdn.microsoft.com/en-us/library/windows/desktop/hh706794(v=vs.85).aspx
|
||||
/// for more information on DPAPI-NG. This API is only supported on Windows 8 / Windows Server 2012 and higher.
|
||||
/// </remarks>
|
||||
[SupportedOSPlatform("windows")]
|
||||
public static IDataProtectionBuilder ProtectKeysWithDpapiNG(this IDataProtectionBuilder builder)
|
||||
{
|
||||
if (builder == null)
|
||||
|
@ -435,6 +440,7 @@ namespace Microsoft.AspNetCore.DataProtection
|
|||
/// and <paramref name="flags"/> arguments.
|
||||
/// This API is only supported on Windows 8 / Windows Server 2012 and higher.
|
||||
/// </remarks>
|
||||
[SupportedOSPlatform("windows")]
|
||||
public static IDataProtectionBuilder ProtectKeysWithDpapiNG(this IDataProtectionBuilder builder, string protectionDescriptorRule, DpapiNGProtectionDescriptorFlags flags)
|
||||
{
|
||||
if (builder == null)
|
||||
|
@ -523,6 +529,7 @@ namespace Microsoft.AspNetCore.DataProtection
|
|||
/// This API is only available on Windows.
|
||||
/// </remarks>
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[SupportedOSPlatform("windows")]
|
||||
public static IDataProtectionBuilder UseCustomCryptographicAlgorithms(this IDataProtectionBuilder builder, CngCbcAuthenticatedEncryptorConfiguration configuration)
|
||||
{
|
||||
if (builder == null)
|
||||
|
@ -551,6 +558,7 @@ namespace Microsoft.AspNetCore.DataProtection
|
|||
/// This API is only available on Windows.
|
||||
/// </remarks>
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[SupportedOSPlatform("windows")]
|
||||
public static IDataProtectionBuilder UseCustomCryptographicAlgorithms(this IDataProtectionBuilder builder, CngGcmAuthenticatedEncryptorConfiguration configuration)
|
||||
{
|
||||
if (builder == null)
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using Microsoft.AspNetCore.Cryptography.Cng;
|
||||
using Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption;
|
||||
using Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel;
|
||||
|
@ -102,6 +104,8 @@ namespace Microsoft.AspNetCore.DataProtection
|
|||
var configuration = new T();
|
||||
if (configuration is CngGcmAuthenticatedEncryptorConfiguration)
|
||||
{
|
||||
Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
|
||||
|
||||
var descriptor = (CngGcmAuthenticatedEncryptorDescriptor)new T().CreateNewDescriptor();
|
||||
return new CngGcmAuthenticatedEncryptorFactory(loggerFactory)
|
||||
.CreateAuthenticatedEncryptorInstance(
|
||||
|
|
|
@ -7,6 +7,7 @@ using System.Diagnostics;
|
|||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
|
@ -500,6 +501,8 @@ namespace Microsoft.AspNetCore.DataProtection.KeyManagement
|
|||
{
|
||||
if (OSVersionUtil.IsWindows())
|
||||
{
|
||||
Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); // Hint for the platform compatibility analyzer.
|
||||
|
||||
// If the user profile is available, we can protect using DPAPI.
|
||||
// Probe to see if protecting to local user is available, and use it as the default if so.
|
||||
encryptor = new DpapiXmlEncryptor(
|
||||
|
@ -523,10 +526,14 @@ namespace Microsoft.AspNetCore.DataProtection.KeyManagement
|
|||
RegistryKey regKeyStorageKey = null;
|
||||
if (OSVersionUtil.IsWindows())
|
||||
{
|
||||
Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); // Hint for the platform compatibility analyzer.
|
||||
regKeyStorageKey = RegistryXmlRepository.DefaultRegistryKey;
|
||||
}
|
||||
if (regKeyStorageKey != null)
|
||||
{
|
||||
Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); // Hint for the platform compatibility analyzer.
|
||||
regKeyStorageKey = RegistryXmlRepository.DefaultRegistryKey;
|
||||
|
||||
// If the user profile isn't available, we can protect using DPAPI (to machine).
|
||||
encryptor = new DpapiXmlEncryptor(protectToLocalMachine: true, loggerFactory: _loggerFactory);
|
||||
repository = new RegistryXmlRepository(regKeyStorageKey, _loggerFactory);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<Description>ASP.NET Core logic to protect and unprotect data, similar to DPAPI.</Description>
|
||||
|
@ -14,6 +14,8 @@
|
|||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\shared\src\*.cs" />
|
||||
<Compile Include="$(SharedSourceRoot)PlatformAttributes.cs"
|
||||
Condition="'$(TargetFramework)' != '$(DefaultNetCoreTargetFramework)'" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -6,6 +6,7 @@ using System.Collections.Generic;
|
|||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Versioning;
|
||||
using Microsoft.AspNetCore.Cryptography;
|
||||
using Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel;
|
||||
using Microsoft.AspNetCore.DataProtection.Internal;
|
||||
|
@ -17,6 +18,7 @@ namespace Microsoft.AspNetCore.DataProtection
|
|||
/// <summary>
|
||||
/// A type which allows reading policy from the system registry.
|
||||
/// </summary>
|
||||
[SupportedOSPlatform("windows")]
|
||||
internal sealed class RegistryPolicyResolver: IRegistryPolicyResolver
|
||||
{
|
||||
private readonly Func<RegistryKey> _getPolicyRegKey;
|
||||
|
|
|
@ -5,6 +5,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Runtime.Versioning;
|
||||
using System.Security.Principal;
|
||||
using System.Xml.Linq;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
@ -15,6 +16,7 @@ namespace Microsoft.AspNetCore.DataProtection.Repositories
|
|||
/// <summary>
|
||||
/// An XML repository backed by the Windows registry.
|
||||
/// </summary>
|
||||
[SupportedOSPlatform("windows")]
|
||||
public class RegistryXmlRepository : IXmlRepository
|
||||
{
|
||||
private static readonly Lazy<RegistryKey> _defaultRegistryKeyLazy = new Lazy<RegistryKey>(GetDefaultHklmStorageKey);
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Runtime.Versioning;
|
||||
using System.Security.Principal;
|
||||
using System.Xml.Linq;
|
||||
using Microsoft.AspNetCore.Cryptography;
|
||||
|
@ -18,6 +19,7 @@ namespace Microsoft.AspNetCore.DataProtection.XmlEncryption
|
|||
/// <remarks>
|
||||
/// This API is only supported on Windows 8 / Windows Server 2012 and higher.
|
||||
/// </remarks>
|
||||
[SupportedOSPlatform("windows")]
|
||||
public sealed class DpapiNGXmlEncryptor : IXmlEncryptor
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Runtime.Versioning;
|
||||
using System.Security.Principal;
|
||||
using System.Xml.Linq;
|
||||
using Microsoft.AspNetCore.Cryptography;
|
||||
|
@ -16,6 +17,7 @@ namespace Microsoft.AspNetCore.DataProtection.XmlEncryption
|
|||
/// <remarks>
|
||||
/// This API is only supported on Windows platforms.
|
||||
/// </remarks>
|
||||
[SupportedOSPlatform("windows")]
|
||||
public sealed class DpapiXmlEncryptor : IXmlEncryptor
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
|
|
|
@ -52,6 +52,9 @@ This package is an internal implementation of the .NET Core SDK and is not meant
|
|||
<!-- Runtime extensions transport paths -->
|
||||
<RuntimeExtensionsReferenceDirectory>$(PkgMicrosoft_Extensions_Internal_Transport)\ref\$(TargetFramework)\</RuntimeExtensionsReferenceDirectory>
|
||||
|
||||
<!-- Platform manifest override metadata. -->
|
||||
<ReferencePlatformManifestPath Condition="'$(IsServicingBuild)' != 'true'">$(PlatformManifestOutputPath)</ReferencePlatformManifestPath>
|
||||
<ReferencePlatformManifestPath Condition="'$(IsServicingBuild)' == 'true'">$(RepoRoot)eng\PlatformManifest.txt</ReferencePlatformManifestPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -144,7 +147,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
|
|||
<RefPackContent Include="@(AspNetCoreReferenceAssemblyPath)" PackagePath="$(RefAssemblyPackagePath)" />
|
||||
<RefPackContent Include="@(AspNetCoreReferenceDocXml)" PackagePath="$(RefAssemblyPackagePath)" />
|
||||
<RefPackContent Include="$(TargetDir)$(PackageConflictManifestFileName)" PackagePath="$(ManifestsPackagePath)" />
|
||||
<RefPackContent Include="$(PlatformManifestOutputPath)" PackagePath="$(ManifestsPackagePath)" />
|
||||
<RefPackContent Include="$(ReferencePlatformManifestPath)" PackagePath="$(ManifestsPackagePath)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
|
|
|
@ -281,21 +281,22 @@ This package is an internal implementation of the .NET Core SDK and is not meant
|
|||
<!-- This target resolves files into the BuiltProjectOutputGroupOutput which NuGet uses to generate the package files. -->
|
||||
<Target Name="_ResolveRuntimePackBuildOutput" DependsOnTargets="ResolveReferences;Crossgen">
|
||||
<ItemGroup>
|
||||
<BuiltProjectOutputGroupOutput Include="$(ProjectDepsFilePath)" />
|
||||
<BuiltProjectOutputGroupOutput Include="@(ReferenceCopyLocalPaths)" Condition=" '%(ReferenceCopyLocalPaths.IsNativeImage)' != 'true' " />
|
||||
<BuildOutputFiles Include="$(ProjectDepsFilePath)" />
|
||||
<BuildOutputFiles Include="@(ReferenceCopyLocalPaths)" Condition=" '%(ReferenceCopyLocalPaths.IsNativeImage)' != 'true' " />
|
||||
<!-- Include all .pdbs in build output. Some .pdb files are part of ReferenceCopyLocalPaths, but this can change when running /t:Pack /p:NoBuild=true. -->
|
||||
<BuiltProjectOutputGroupOutput Include="$(TargetDir)*.pdb" Exclude="@(ReferenceCopyLocalPaths)" />
|
||||
<BuildOutputFiles Include="$(TargetDir)*.pdb" Exclude="@(ReferenceCopyLocalPaths)" />
|
||||
<!-- Crossgen symbols for Linux include a GUID in the file name which cannot be predicted. -->
|
||||
<BuiltProjectOutputGroupOutput Include="$(TargetDir)*.map" Condition="'$(CrossGenSymbolsType)' == 'PerfMap'" />
|
||||
<BuildOutputFiles Include="$(TargetDir)*.map" Condition="'$(CrossGenSymbolsType)' == 'PerfMap'" />
|
||||
|
||||
<!-- Strip duplicate Files by checking for distinct %(FileName)%(Extension) -->
|
||||
<OutputFileNames Include="%(BuiltProjectOutputGroupOutput.FileName)%(BuiltProjectOutputGroupOutput.Extension)">
|
||||
<ItemPath>%(BuiltProjectOutputGroupOutput.Identity)</ItemPath>
|
||||
<OutputFileNames Include="%(BuildOutputFiles.FileName)%(BuildOutputFiles.Extension)">
|
||||
<ItemPath>%(BuildOutputFiles.Identity)</ItemPath>
|
||||
</OutputFileNames>
|
||||
|
||||
<DistinctOutputFileNames Include="@(OutputFileNames->Distinct())"></DistinctOutputFileNames>
|
||||
|
||||
<NuGetPackInput Include="%(DistinctOutputFileNames.ItemPath)" />
|
||||
<!--BuiltProjectOutputGroupOuput is the item actually used by Nuget -->
|
||||
<BuiltProjectOutputGroupOutput Include="%(DistinctOutputFileNames.ItemPath)" />
|
||||
<NuGetPackInput Include="@(BuiltProjectOutputGroupOutput)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
<RootNamespace>Microsoft.AspNetCore</RootNamespace>
|
||||
<VerifyAncmBinary Condition="'$(TargetOsName)' == 'win' AND '$(TargetArchitecture)' != 'arm'">true</VerifyAncmBinary>
|
||||
<TestDependsOnAspNetRuntime>true</TestDependsOnAspNetRuntime>
|
||||
<TestDependsOnAspNetRef>true</TestDependsOnAspNetRef>
|
||||
<SkipHelixArm>true</SkipHelixArm>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -52,11 +51,13 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\App.Ref\src\Microsoft.AspNetCore.App.Ref.csproj">
|
||||
<ProjectReference Include="..\App.Ref\src\Microsoft.AspNetCore.App.Ref.csproj"
|
||||
Condition=" $(IsTargetingPackBuilding) ">
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\App.Runtime\src\Microsoft.AspNetCore.App.Runtime.csproj">
|
||||
<ProjectReference Include="..\App.Runtime\src\Microsoft.AspNetCore.App.Runtime.csproj"
|
||||
Condition=" !$(IsTargetingPackBuilding) ">
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
|
||||
</ProjectReference>
|
||||
|
@ -70,20 +71,6 @@
|
|||
<Output TaskParameter="TargetOutputs" ItemName="_TargetingPackDependencies" />
|
||||
</MSBuild>
|
||||
|
||||
<!-- This target is defined in eng/targets/Packaging.targets and included in every C# and F# project. -->
|
||||
<MSBuild Projects="$(RepoRoot)src\Framework\App.Runtime\src\Microsoft.AspNetCore.App.Runtime.csproj"
|
||||
Targets="_GetPackageVersionInfo"
|
||||
SkipNonexistentProjects="false">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="_RuntimePackageVersionInfo" />
|
||||
</MSBuild>
|
||||
|
||||
<!-- Runtime and Ref packs may have separate versions. -->
|
||||
<MSBuild Projects="$(RepoRoot)src\Framework\App.Ref\src\Microsoft.AspNetCore.App.Ref.csproj"
|
||||
Targets="_GetPackageVersionInfo"
|
||||
SkipNonexistentProjects="false">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="_TargetingPackVersionInfo" />
|
||||
</MSBuild>
|
||||
|
||||
<ItemGroup>
|
||||
<AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
|
||||
<_Parameter1>TargetingPackDependencies</_Parameter1>
|
||||
|
@ -119,12 +106,12 @@
|
|||
|
||||
<AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
|
||||
<_Parameter1>RuntimePackageVersion</_Parameter1>
|
||||
<_Parameter2>@(_RuntimePackageVersionInfo->'%(PackageVersion)')</_Parameter2>
|
||||
<_Parameter2>$(SharedFxVersion)</_Parameter2>
|
||||
</AssemblyAttribute>
|
||||
|
||||
<AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
|
||||
<_Parameter1>TargetingPackVersion</_Parameter1>
|
||||
<_Parameter2>@(_TargetingPackVersionInfo->'%(PackageVersion)')</_Parameter2>
|
||||
<_Parameter2>$(TargetingPackVersion)</_Parameter2>
|
||||
</AssemblyAttribute>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
|
|
@ -90,7 +90,22 @@ namespace InteropTests
|
|||
{
|
||||
using (var serverProcess = new WebsiteProcess(_serverPath, _output))
|
||||
{
|
||||
await serverProcess.WaitForReady().TimeoutAfter(DefaultTimeout);
|
||||
try
|
||||
{
|
||||
await serverProcess.WaitForReady().TimeoutAfter(DefaultTimeout);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
var errorMessage = $@"Error while running server process.
|
||||
|
||||
Server ready: {serverProcess.IsReady}
|
||||
|
||||
Server process output:
|
||||
======================================
|
||||
{serverProcess.GetOutput()}
|
||||
======================================";
|
||||
throw new InvalidOperationException(errorMessage, ex);
|
||||
}
|
||||
|
||||
using (var clientProcess = new ClientProcess(_output, _clientPath, serverProcess.ServerPort, name))
|
||||
{
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
<PropertyGroup>
|
||||
<ContainsFunctionalTestAssets>true</ContainsFunctionalTestAssets>
|
||||
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
|
||||
<TestDependsOnAspNetRuntime>true</TestDependsOnAspNetRuntime>
|
||||
<IsWindowsOnlyTest>true</IsWindowsOnlyTest>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -168,7 +168,7 @@ namespace InteropTestsClient
|
|||
httpClientHandler.ClientCertificates.Add(cert);
|
||||
}
|
||||
|
||||
var httpClient = new HttpClient(new VersionPolicyHandler(httpClientHandler));
|
||||
var httpClient = new HttpClient(httpClientHandler);
|
||||
|
||||
var channel = GrpcChannel.ForAddress($"{scheme}://{options.ServerHost}:{options.ServerPort}", new GrpcChannelOptions
|
||||
{
|
||||
|
@ -180,21 +180,6 @@ namespace InteropTestsClient
|
|||
return new GrpcChannelWrapper(channel);
|
||||
}
|
||||
|
||||
// TODO(JamesNK): This type can be removed in the future when Grpc.Net.Client sets VersionPolicy automatically.
|
||||
// https://github.com/grpc/grpc-dotnet/pull/987
|
||||
private class VersionPolicyHandler : DelegatingHandler
|
||||
{
|
||||
public VersionPolicyHandler(HttpMessageHandler innerHandler) : base(innerHandler)
|
||||
{
|
||||
}
|
||||
|
||||
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
|
||||
{
|
||||
request.VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher;
|
||||
return base.SendAsync(request, cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<ChannelCredentials> CreateCredentialsAsync(bool? useTestCaOverride = null)
|
||||
{
|
||||
var credentials = ChannelCredentials.Insecure;
|
||||
|
@ -875,7 +860,7 @@ namespace InteropTestsClient
|
|||
string keyFile = Environment.GetEnvironmentVariable("GOOGLE_APPLICATION_CREDENTIALS")!;
|
||||
Assert.IsNotNull(keyFile);
|
||||
var jobject = JObject.Parse(File.ReadAllText(keyFile));
|
||||
string email = jobject.GetValue("client_email").Value<string>();
|
||||
string email = jobject.GetValue("client_email")!.Value<string>()!;
|
||||
Assert.IsTrue(email.Length > 0); // spec requires nonempty client email.
|
||||
return email;
|
||||
}
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<RestoreAdditionalProjectSources>$(RestoreAdditionalProjectSources);$(ArtifactsShippingPackagesDir)</RestoreAdditionalProjectSources>
|
||||
<MicrosoftAspNetCoreAppRefPackageVersion Condition="'$(IsTargetingPackBuilding)' != 'false'">$(TargetingPackVersion)</MicrosoftAspNetCoreAppRefPackageVersion>
|
||||
<MicrosoftAspNetCoreAppRefPackageVersion Condition="'$(IsTargetingPackBuilding)' == 'false'">$(AspNetCoreBaselineVersion)</MicrosoftAspNetCoreAppRefPackageVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Use the shared framework that was produced -->
|
||||
|
@ -18,7 +16,7 @@
|
|||
RuntimePackNamePatterns="Microsoft.AspNetCore.App.Runtime.**RID**"
|
||||
DefaultRuntimeFrameworkVersion="$(SharedFxVersion)"
|
||||
LatestRuntimeFrameworkVersion="$(SharedFxVersion)"
|
||||
TargetingPackVersion="$(MicrosoftAspNetCoreAppRefPackageVersion)"
|
||||
TargetingPackVersion="$(TargetingPackVersion)"
|
||||
RuntimePackRuntimeIdentifiers="$(SupportedRuntimeIdentifiers)" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -22,6 +22,7 @@ using Grpc.Testing;
|
|||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Net.Http.Headers;
|
||||
|
||||
namespace InteropTestsWebsite
|
||||
{
|
||||
|
@ -44,6 +45,8 @@ namespace InteropTestsWebsite
|
|||
|
||||
var runtimeVersion = typeof(object).GetTypeInfo().Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion ?? "Unknown";
|
||||
Console.WriteLine($"NetCoreAppVersion: {runtimeVersion}");
|
||||
var aspNetCoreVersion = typeof(HeaderNames).GetTypeInfo().Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion ?? "Unknown";
|
||||
Console.WriteLine($"AspNetCoreAppVersion: {aspNetCoreVersion}");
|
||||
});
|
||||
|
||||
app.UseRouting();
|
||||
|
|
|
@ -2,5 +2,7 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.Versioning;
|
||||
|
||||
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Hosting.WindowsServices.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: SupportedOSPlatform("windows")]
|
|
@ -144,8 +144,7 @@ namespace Microsoft.AspNetCore.Authentication
|
|||
/// <typeparam name="T">Parameter type.</typeparam>
|
||||
/// <param name="key">Parameter key.</param>
|
||||
/// <returns>Retrieved value or the default value if the property is not set.</returns>
|
||||
[return: MaybeNull]
|
||||
public T GetParameter<T>(string key)
|
||||
public T? GetParameter<T>(string key)
|
||||
=> Parameters.TryGetValue(key, out var obj) && obj is T value ? value : default;
|
||||
|
||||
/// <summary>
|
||||
|
@ -154,7 +153,7 @@ namespace Microsoft.AspNetCore.Authentication
|
|||
/// <typeparam name="T">Parameter type.</typeparam>
|
||||
/// <param name="key">Parameter key.</param>
|
||||
/// <param name="value">Value to set.</param>
|
||||
public void SetParameter<T>(string key, [MaybeNull] T value)
|
||||
public void SetParameter<T>(string key, T value)
|
||||
=> Parameters[key] = value;
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Microsoft.Extensions.Primitives;
|
||||
|
||||
namespace Microsoft.Net.Http.Headers
|
||||
|
@ -13,9 +12,9 @@ namespace Microsoft.Net.Http.Headers
|
|||
{
|
||||
}
|
||||
|
||||
protected abstract int GetParsedValueLength(StringSegment value, int startIndex, [MaybeNull] out T parsedValue);
|
||||
protected abstract int GetParsedValueLength(StringSegment value, int startIndex, out T? parsedValue);
|
||||
|
||||
public sealed override bool TryParseValue(StringSegment value, ref int index, [MaybeNull] out T parsedValue)
|
||||
public sealed override bool TryParseValue(StringSegment value, ref int index, out T? parsedValue)
|
||||
{
|
||||
parsedValue = default;
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace Microsoft.Net.Http.Headers
|
|||
// Cache-Control headers, only one instance of CacheControlHeaderValue is created (if all headers contain valid
|
||||
// values, otherwise we may have multiple strings containing the invalid values).
|
||||
private static readonly HttpHeaderParser<CacheControlHeaderValue> Parser
|
||||
= new GenericHeaderParser<CacheControlHeaderValue>(true, GetCacheControlLength!);
|
||||
= new GenericHeaderParser<CacheControlHeaderValue>(true, GetCacheControlLength);
|
||||
|
||||
private static readonly Action<StringSegment> CheckIsValidTokenAction = CheckIsValidToken;
|
||||
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче