Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .azure/pipelines/jobs/default-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ jobs:
${{ if eq(parameters.agentOs, 'Windows') }}:
${{ if eq(variables['System.TeamProject'], 'public') }}:
name: NetCore1ESPool-Public
demands: ImageOverride -equals 1es-windows-2019-open
demands: ImageOverride -equals build.windows.amd64.vs2022.open
${{ if eq(variables['System.TeamProject'], 'internal') }}:
name: NetCore1ESPool-Internal
# Visual Studio Enterprise - contains some stuff, like SQL Server and IIS Express, that we use for testing
demands: ImageOverride -equals Build.Server.Amd64.VS2019
demands: ImageOverride -equals build.windows.amd64.vs2022
${{ if ne(parameters.container, '') }}:
container: ${{ parameters.container }}
${{ if ne(parameters.disableComponentGovernance, '') }}:
Expand Down
10 changes: 10 additions & 0 deletions eng/targets/Cpp.Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
<TestProjectSkipReason>You cannot test native ARM64 projects on a x86/x64 machine</TestProjectSkipReason>
</PropertyGroup>

<PropertyGroup Label="Configuration">
<Configuration Condition="'$(Configuration)'==''">Debug</Configuration>
<VCProjectVersion>15.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<Platform Condition="'$(Platform)' == ''">x64</Platform>
<PlatformToolsetVersion>v143</PlatformToolsetVersion>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @HaoK
I moved the toolset and windows versions to our common Cpp props and removed them from IIS and Installers. So in case you notice them missing from IIS in the future this is why 😉

<PlatformToolset>$(PlatformToolsetVersion)</PlatformToolset>
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.19041.0</WindowsTargetPlatformVersion>
</PropertyGroup>

<Import Project="MicroBuild.Plugin.props" Condition="'$(MicroBuildSentinelFile)' == ''" />
<Import Project="$(MicroBuildPluginDirectory)\MicroBuild.Plugins.*\**\build\MicroBuild.Plugins.*.props" Condition=" '$(MicroBuildPluginDirectory)' != ''" />

Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"sdk": {
"version": "7.0.100-preview.5.22263.22"
"version": "7.0.100-preview.6.22310.1"
},
"tools": {
"dotnet": "7.0.100-preview.5.22263.22",
"dotnet": "7.0.100-preview.6.22310.1",
"runtimes": {
"dotnet/x86": [
"$(MicrosoftNETCoreBrowserDebugHostTransportVersion)"
Expand Down
2 changes: 2 additions & 0 deletions src/Components/Authorization/src/AuthorizeRouteView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ private void RenderAuthorizeRouteViewCore(RenderTreeBuilder builder)
Justification = "OpenComponent already has the right set of attributes")]
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2110:RequiresUnreferencedCode",
Justification = "OpenComponent already has the right set of attributes")]
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2118:RequiresUnreferencedCode",
Justification = "OpenComponent already has the right set of attributes")]
private void RenderContentInDefaultLayout(RenderTreeBuilder builder, RenderFragment content)
{
builder.OpenComponent<LayoutView>(0);
Expand Down
1 change: 1 addition & 0 deletions src/Components/Components/src/RouteView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public Task SetParametersAsync(ParameterView parameters)
/// </summary>
/// <param name="builder">The <see cref="RenderTreeBuilder"/>.</param>
[UnconditionalSuppressMessage("Trimming", "IL2111", Justification = "Layout components are preserved because the LayoutAttribute constructor parameter is correctly annotated.")]
[UnconditionalSuppressMessage("Trimming", "IL2118", Justification = "Layout components are preserved because the LayoutAttribute constructor parameter is correctly annotated.")]
protected virtual void Render(RenderTreeBuilder builder)
{
var pageLayoutType = RouteData.PageType.GetCustomAttribute<LayoutAttribute>()?.LayoutType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ internal static RouteTable Create(List<Type> componentTypes)
return Create(templatesByHandler);
}

[UnconditionalSuppressMessage("Trimming", "IL2067", Justification = "Application code does not get trimmed, and the framework does not define routable components.")]
internal static RouteTable Create(Dictionary<Type, string[]> templatesByHandler)
{
var routes = new List<RouteEntry>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Diagnostics.CodeAnalysis;
using Microsoft.AspNetCore.Components.RenderTree;
using Microsoft.AspNetCore.Components.Web.Infrastructure;
using Microsoft.AspNetCore.Internal;

namespace Microsoft.AspNetCore.Components.Web;

Expand All @@ -20,11 +21,11 @@ public sealed class JSComponentConfigurationStore
// without needing any changes on the downstream code that implements IJSComponentConfiguration,
// and without exposing any of the configuration storage across layers.

internal Dictionary<string, Type> JSComponentTypesByIdentifier { get; } = new(StringComparer.Ordinal);
private readonly Dictionary<string, Type> _jsComponentTypesByIdentifier = new(StringComparer.Ordinal);
internal Dictionary<string, JSComponentParameter[]> JSComponentParametersByIdentifier { get; } = new(StringComparer.Ordinal);
internal Dictionary<string, List<string>> JSComponentIdentifiersByInitializer { get; } = new(StringComparer.Ordinal);

internal void Add(Type componentType, string identifier)
internal void Add([DynamicallyAccessedMembers(LinkerFlags.Component)] Type componentType, string identifier)
{
var parameterTypes = JSComponentInterop.GetComponentParameters(componentType).ParameterInfoByName;
var parameters = new JSComponentParameter[parameterTypes.Count];
Expand All @@ -34,15 +35,24 @@ internal void Add(Type componentType, string identifier)
parameters[index++] = new JSComponentParameter(name, type.Type);
}

JSComponentTypesByIdentifier.Add(identifier, componentType);
_jsComponentTypesByIdentifier.Add(identifier, componentType);
JSComponentParametersByIdentifier.Add(identifier, parameters);
}

[UnconditionalSuppressMessage("Trimming", "IL2067",
Justification = "Types added to dictionary are always correctly annotated.")]
internal bool TryGetComponentType(
string identifier,
[NotNullWhen(true)][DynamicallyAccessedMembers(LinkerFlags.Component)] out Type? componentType)
{
return _jsComponentTypesByIdentifier.TryGetValue(identifier, out componentType);
}

[DynamicDependency(DynamicallyAccessedMemberTypes.PublicProperties, typeof(JSComponentParameter))]
[DynamicDependency(nameof(WebRenderer.WebRendererInteropMethods.AddRootComponent), typeof(WebRenderer.WebRendererInteropMethods))]
[DynamicDependency(nameof(WebRenderer.WebRendererInteropMethods.SetRootComponentParameters), typeof(WebRenderer.WebRendererInteropMethods))]
[DynamicDependency(nameof(WebRenderer.WebRendererInteropMethods.RemoveRootComponent), typeof(WebRenderer.WebRendererInteropMethods))]
internal void Add(Type componentType, string identifier, string javaScriptInitializer)
internal void Add([DynamicallyAccessedMembers(LinkerFlags.Component)] Type componentType, string identifier, string javaScriptInitializer)
{
Add(componentType, identifier);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ internal void AttachToRenderer(WebRenderer renderer)
/// </summary>
protected internal virtual int AddRootComponent(string identifier, string domElementSelector)
{
if (!Configuration.JSComponentTypesByIdentifier.TryGetValue(identifier, out var componentType))
if (!Configuration.TryGetComponentType(identifier, out var componentType))
{
throw new ArgumentException($"There is no registered JS component with identifier '{identifier}'.");
}
Expand Down
21 changes: 7 additions & 14 deletions src/Identity/UI/src/Microsoft.AspNetCore.Identity.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

<StaticWebAssetBasePath>Identity</StaticWebAssetBasePath>
<ProvideApplicationPartFactoryAttributeTypeName>Microsoft.AspNetCore.Mvc.ApplicationParts.NullApplicationPartFactory, Microsoft.AspNetCore.Mvc.Core</ProvideApplicationPartFactoryAttributeTypeName>
<GenerateStaticWebAssetsPackTargetsDependsOn>_GenerateIdentityUIPackItems;$(GenerateStaticWebAssetsPackTargetsDependsOn)</GenerateStaticWebAssetsPackTargetsDependsOn>
<DisableStaticWebAssetsBuildPropsFileGeneration>true</DisableStaticWebAssetsBuildPropsFileGeneration>
<StaticWebAssetsDisableProjectBuildPropsFileGeneration>true</StaticWebAssetsDisableProjectBuildPropsFileGeneration>
<StaticWebAssetsDisableProjectBuildMultiTargetingPropsFileGeneration>true</StaticWebAssetsDisableProjectBuildMultiTargetingPropsFileGeneration>
Expand Down Expand Up @@ -74,7 +73,7 @@
</ItemGroup>
</Target>

<Target Name="_GenerateIdentityUIPackItems">
<Target Name="_GenerateIdentityUIPackItems" BeforeTargets="GenerateStaticWebAssetsPackFiles">
<ItemGroup>
<V4AssetsCandidates Include="assets\V4\**" />
<V4AssetsCandidates>
Expand All @@ -96,25 +95,19 @@
<GenerateStaticWebAsssetsPropsFile StaticWebAssets="@(V5Assets)" PackagePathPrefix="staticwebassets/V5" TargetPropsFilePath="$(IntermediateOutputPath)IdentityUI.V5.targets" />

<ComputeStaticWebAssetsTargetPaths Assets="@(V4Assets)" PathPrefix="staticwebassets/V4" AdjustPathsForPack="true">
<Output TaskParameter="AssetsWithTargetPath" ItemName="_PackV4Asset" />
<Output TaskParameter="AssetsWithTargetPath" ItemName="_PackStaticWebAssetWithTargetPath" />
</ComputeStaticWebAssetsTargetPaths>
<ComputeStaticWebAssetsTargetPaths Assets="@(V5Assets)" PathPrefix="staticwebassets/V5" AdjustPathsForPack="true">
<Output TaskParameter="AssetsWithTargetPath" ItemName="_PackV5Asset" />
<Output TaskParameter="AssetsWithTargetPath" ItemName="_PackStaticWebAssetWithTargetPath" />
</ComputeStaticWebAssetsTargetPaths>

<ItemGroup>
<TfmSpecificPackageFile Include="$(IntermediateOutputPath)IdentityUI.V4.targets">
<StaticWebAssetPackageFile Include="$(IntermediateOutputPath)IdentityUI.V4.targets">
<PackagePath>build\Microsoft.AspNetCore.StaticWebAssets.V4.targets</PackagePath>
</TfmSpecificPackageFile>
<TfmSpecificPackageFile Include="%(_PackV4Asset.Identity)">
<PackagePath>%(_PackV4Asset.TargetPath)</PackagePath>
</TfmSpecificPackageFile>
<TfmSpecificPackageFile Include="$(IntermediateOutputPath)IdentityUI.V5.targets">
</StaticWebAssetPackageFile>
<StaticWebAssetPackageFile Include="$(IntermediateOutputPath)IdentityUI.V5.targets">
<PackagePath>build\Microsoft.AspNetCore.StaticWebAssets.V5.targets</PackagePath>
</TfmSpecificPackageFile>
<TfmSpecificPackageFile Include="%(_PackV5Asset.Identity)">
<PackagePath>%(_PackV5Asset.TargetPath)</PackagePath>
</TfmSpecificPackageFile>
</StaticWebAssetPackageFile>
</ItemGroup>
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,11 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolsetVersion>v142</PlatformToolsetVersion>
<PlatformToolset>$(PlatformToolsetVersion)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<VCToolsVersion>14.29.30133</VCToolsVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup>
<AdditionalIncludeDirectories>$(IIS-Common)version;$(IIS-Common)Include;$(IIS-Setup)iisca\lib;$(WIX)sdk\$(WixPlatformToolset)\inc;$(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
<Keyword>Win32Proj</Keyword>
<RootNamespace>Lib</RootNamespace>
<ProjectName>CommonLib</ProjectName>
<PlatformToolsetVersion Condition=" '$(VisualStudioVersion)' == '17.0' ">v143</PlatformToolsetVersion>
<PlatformToolsetVersion Condition=" '$(PlatformToolsetVersion)' == '' ">v142</PlatformToolsetVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@
<ProjectGuid>{7324770c-0871-4d73-be3d-5e2f3e9e1b1e}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>iisca</RootNamespace>
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.18362.0</WindowsTargetPlatformVersion>
<PlatformToolsetVersion>v142</PlatformToolsetVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup>
Expand All @@ -86,9 +84,6 @@
<PlatformToolset>$(PlatformToolsetVersion)</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup Label="Configuration">
<VCToolsVersion>14.29.30133</VCToolsVersion>
</PropertyGroup>
<PropertyGroup>
<AdditionalIncludeDirectories>$(IIS-Common)version;$(IIS-Common)Include;$(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PrecompiledHeader>Create</PrecompiledHeader>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class MemoryOutputCacheStoreTests
public async Task StoreAndGetValue_Succeeds()
{
var store = new MemoryOutputCacheStore(new MemoryCache(new MemoryCacheOptions()));
var value = "abc"u8;
var value = "abc"u8.ToArray();
var key = "abc";

await store.SetAsync(key, value, null, TimeSpan.FromMinutes(1), default);
Expand All @@ -31,7 +31,7 @@ public async Task StoreAndGetValue_TimesOut()
{
var testClock = new TestMemoryOptionsClock { UtcNow = DateTimeOffset.UtcNow };
var store = new MemoryOutputCacheStore(new MemoryCache(new MemoryCacheOptions { Clock = testClock }));
var value = "abc"u8;
var value = "abc"u8.ToArray();
var key = "abc";

await store.SetAsync(key, value, null, TimeSpan.FromMilliseconds(5), default);
Expand All @@ -46,7 +46,7 @@ public async Task StoreAndGetValue_TimesOut()
public async Task StoreNullKey_ThrowsException()
{
var store = new MemoryOutputCacheStore(new MemoryCache(new MemoryCacheOptions()));
var value = "abc"u8;
var value = "abc"u8.ToArray();
string key = null;

_ = await Assert.ThrowsAsync<ArgumentNullException>("key", () => store.SetAsync(key, value, null, TimeSpan.FromMilliseconds(5), default).AsTask());
Expand All @@ -67,7 +67,7 @@ public async Task EvictByTag_SingleTag_SingleEntry()
{
var testClock = new TestMemoryOptionsClock { UtcNow = DateTimeOffset.UtcNow };
var store = new MemoryOutputCacheStore(new MemoryCache(new MemoryCacheOptions { Clock = testClock }));
var value = "abc"u8;
var value = "abc"u8.ToArray();
var key = "abc";
var tags = new string[] { "tag1" };

Expand All @@ -83,7 +83,7 @@ public async Task EvictByTag_SingleTag_MultipleEntries()
{
var testClock = new TestMemoryOptionsClock { UtcNow = DateTimeOffset.UtcNow };
var store = new MemoryOutputCacheStore(new MemoryCache(new MemoryCacheOptions { Clock = testClock }));
var value = "abc"u8;
var value = "abc"u8.ToArray();
var key1 = "abc";
var key2 = "def";
var tags = new string[] { "tag1" };
Expand All @@ -103,7 +103,7 @@ public async Task EvictByTag_MultipleTags_SingleEntry()
{
var testClock = new TestMemoryOptionsClock { UtcNow = DateTimeOffset.UtcNow };
var store = new MemoryOutputCacheStore(new MemoryCache(new MemoryCacheOptions { Clock = testClock }));
var value = "abc"u8;
var value = "abc"u8.ToArray();
var key = "abc";
var tags = new string[] { "tag1", "tag2" };

Expand All @@ -119,7 +119,7 @@ public async Task EvictByTag_MultipleTags_MultipleEntries()
{
var testClock = new TestMemoryOptionsClock { UtcNow = DateTimeOffset.UtcNow };
var store = new MemoryOutputCacheStore(new MemoryCache(new MemoryCacheOptions { Clock = testClock }));
var value = "abc"u8;
var value = "abc"u8.ToArray();
var key1 = "abc";
var key2 = "def";
var tags1 = new string[] { "tag1", "tag2" };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public async Task StoreAndGet_StoresAllValues()
var key = "abc";
var entry = new OutputCacheEntry()
{
Body = new CachedResponseBody(new List<byte[]>() { "lorem"u8, "ipsum"u8 }, 10),
Body = new CachedResponseBody(new List<byte[]>() { "lorem"u8.ToArray(), "ipsum"u8.ToArray() }, 10),
Created = DateTimeOffset.UtcNow,
Headers = new HeaderDictionary { [HeaderNames.Accept] = "text/plain", [HeaderNames.AcceptCharset] = "utf8" },
StatusCode = StatusCodes.Status201Created,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,15 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{1eac8125-1765-4e2d-8cbe-56dc98a1c8c1}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.18362.0</WindowsTargetPlatformVersion>
<PlatformToolsetVersion Condition=" '$(PlatformToolsetVersion)' == '' ">v142</PlatformToolsetVersion>
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.19041.0</WindowsTargetPlatformVersion>
<PlatformToolsetVersion Condition=" '$(PlatformToolsetVersion)' == '' ">v143</PlatformToolsetVersion>
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>$(PlatformToolsetVersion)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<IsTestProject>true</IsTestProject>
<DisableArcadeTestFramework>true</DisableArcadeTestFramework>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<VCToolsVersion>14.29.30133</VCToolsVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Label="Shared" />
Expand Down
4 changes: 0 additions & 4 deletions src/Servers/IIS/build/Build.Common.Settings
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@
<SolutionDir Condition="'$(SolutionDir)' == '' Or '$(SolutionDir)' == '*Undefined*'">$(MSBuildThisFileDirectory)..\</SolutionDir>
<Configuration Condition="'$(Configuration)'==''">Debug</Configuration>
<VCProjectVersion>15.0</VCProjectVersion>
<VCToolsVersion>14.29.30133</VCToolsVersion>
<Keyword>Win32Proj</Keyword>
<Platform Condition="'$(Platform)' == ''">x64</Platform>
<PlatformToolsetVersion>v142</PlatformToolsetVersion>
<PlatformToolset>$(PlatformToolsetVersion)</PlatformToolset>
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.18362.0</WindowsTargetPlatformVersion>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>

Expand Down