Skip to content

Commit db8cef1

Browse files
authored
Merge branch 'release/3.1' into prkrishn/fix-null-ref
2 parents c906902 + ab1347e commit db8cef1

File tree

28 files changed

+188
-107
lines changed

28 files changed

+188
-107
lines changed

eng/Workarounds.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<!-- Reference base shared framework at incoming dependency flow version, not bundled sdk version. -->
1010
<FrameworkReference
1111
Update="Microsoft.NETCore.App"
12-
Condition="'$(TargetFramework)' == 'netcoreapp3.1'"
12+
Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)'"
1313
RuntimeFrameworkVersion="$(MicrosoftNETCoreAppRuntimeVersion)"
1414
TargetingPackVersion="$(MicrosoftNETCoreAppRefPackageVersion)"
1515
/>

eng/tools/BaselineGenerator/BaselineGenerator.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
66
<StartArguments>-s https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json</StartArguments>
77
<StartWorkingDirectory>$(MSBuildThisFileDirectory)../../</StartWorkingDirectory>
88
</PropertyGroup>

eng/tools/RepoTasks/RepoTasks.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
4+
<TargetFrameworks>$(DefaultNetCoreTargetFramework)</TargetFrameworks>
55
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net472</TargetFrameworks>
66
<DefineConstants Condition="'$(TargetFramework)' == 'net472'">$(DefineConstants);BUILD_MSI_TASKS</DefineConstants>
77
<Optimize>false</Optimize>
@@ -16,7 +16,7 @@
1616
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.1.0" />
1717
</ItemGroup>
1818

19-
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
19+
<ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)'">
2020
<PackageReference Include="Microsoft.Build.Framework" Version="15.8.166" />
2121
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="15.8.166" />
2222
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="15.8.166" />

src/Components/Components.sln

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Signal
210210
EndProject
211211
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Http.Connections.Client", "..\SignalR\clients\csharp\Http.Connections.Client\src\Microsoft.AspNetCore.Http.Connections.Client.csproj", "{F88118E1-6F4A-4F89-B047-5FFD2889B9F0}"
212212
EndProject
213-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ignitor", "Ignitor\src\Ignitor.csproj", "{A78CE874-76B7-46FE-8009-1ED5258BA0AA}"
214-
EndProject
215-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ignitor.Test", "Ignitor\test\Ignitor.Test.csproj", "{FC2A1EB0-A116-4689-92B7-239B1DCCF4CA}"
216-
EndProject
217213
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Blazor.HttpClient", "Blazor\Http\src\Microsoft.AspNetCore.Blazor.HttpClient.csproj", "{74D21785-2FAB-4266-B7C4-E311EC8EE0DF}"
218214
EndProject
219215
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Blazor.HttpClient.Tests", "Blazor\Http\test\Microsoft.AspNetCore.Blazor.HttpClient.Tests.csproj", "{E4C01A3F-D3C1-4639-A6A9-930E918843DD}"
@@ -238,7 +234,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.HttpsP
238234
EndProject
239235
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorServerApp", "Samples\BlazorServerApp\BlazorServerApp.csproj", "{BBF37AF9-8290-4B70-8BA8-0F6017B3B620}"
240236
EndProject
241-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ignitor", "Ignitor", "{29B5A306-7273-4649-8B04-26234D71ADBD}"
237+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ignitor", "Ignitor", "{BDE2397D-C53A-4783-8B3A-1F54F48A6926}"
238+
EndProject
239+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ignitor", "Ignitor\src\Ignitor.csproj", "{CD0EF85C-4187-4515-A355-E5A0D4485F40}"
240+
EndProject
241+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ignitor.Test", "Ignitor\test\Ignitor.Test.csproj", "{F31E8118-014E-4CCE-8A48-5282F7B9BB3E}"
242242
EndProject
243243
Global
244244
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -1354,30 +1354,6 @@ Global
13541354
{F88118E1-6F4A-4F89-B047-5FFD2889B9F0}.Release|x64.Build.0 = Release|Any CPU
13551355
{F88118E1-6F4A-4F89-B047-5FFD2889B9F0}.Release|x86.ActiveCfg = Release|Any CPU
13561356
{F88118E1-6F4A-4F89-B047-5FFD2889B9F0}.Release|x86.Build.0 = Release|Any CPU
1357-
{A78CE874-76B7-46FE-8009-1ED5258BA0AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1358-
{A78CE874-76B7-46FE-8009-1ED5258BA0AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
1359-
{A78CE874-76B7-46FE-8009-1ED5258BA0AA}.Debug|x64.ActiveCfg = Debug|Any CPU
1360-
{A78CE874-76B7-46FE-8009-1ED5258BA0AA}.Debug|x64.Build.0 = Debug|Any CPU
1361-
{A78CE874-76B7-46FE-8009-1ED5258BA0AA}.Debug|x86.ActiveCfg = Debug|Any CPU
1362-
{A78CE874-76B7-46FE-8009-1ED5258BA0AA}.Debug|x86.Build.0 = Debug|Any CPU
1363-
{A78CE874-76B7-46FE-8009-1ED5258BA0AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
1364-
{A78CE874-76B7-46FE-8009-1ED5258BA0AA}.Release|Any CPU.Build.0 = Release|Any CPU
1365-
{A78CE874-76B7-46FE-8009-1ED5258BA0AA}.Release|x64.ActiveCfg = Release|Any CPU
1366-
{A78CE874-76B7-46FE-8009-1ED5258BA0AA}.Release|x64.Build.0 = Release|Any CPU
1367-
{A78CE874-76B7-46FE-8009-1ED5258BA0AA}.Release|x86.ActiveCfg = Release|Any CPU
1368-
{A78CE874-76B7-46FE-8009-1ED5258BA0AA}.Release|x86.Build.0 = Release|Any CPU
1369-
{FC2A1EB0-A116-4689-92B7-239B1DCCF4CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1370-
{FC2A1EB0-A116-4689-92B7-239B1DCCF4CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
1371-
{FC2A1EB0-A116-4689-92B7-239B1DCCF4CA}.Debug|x64.ActiveCfg = Debug|Any CPU
1372-
{FC2A1EB0-A116-4689-92B7-239B1DCCF4CA}.Debug|x64.Build.0 = Debug|Any CPU
1373-
{FC2A1EB0-A116-4689-92B7-239B1DCCF4CA}.Debug|x86.ActiveCfg = Debug|Any CPU
1374-
{FC2A1EB0-A116-4689-92B7-239B1DCCF4CA}.Debug|x86.Build.0 = Debug|Any CPU
1375-
{FC2A1EB0-A116-4689-92B7-239B1DCCF4CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
1376-
{FC2A1EB0-A116-4689-92B7-239B1DCCF4CA}.Release|Any CPU.Build.0 = Release|Any CPU
1377-
{FC2A1EB0-A116-4689-92B7-239B1DCCF4CA}.Release|x64.ActiveCfg = Release|Any CPU
1378-
{FC2A1EB0-A116-4689-92B7-239B1DCCF4CA}.Release|x64.Build.0 = Release|Any CPU
1379-
{FC2A1EB0-A116-4689-92B7-239B1DCCF4CA}.Release|x86.ActiveCfg = Release|Any CPU
1380-
{FC2A1EB0-A116-4689-92B7-239B1DCCF4CA}.Release|x86.Build.0 = Release|Any CPU
13811357
{74D21785-2FAB-4266-B7C4-E311EC8EE0DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13821358
{74D21785-2FAB-4266-B7C4-E311EC8EE0DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
13831359
{74D21785-2FAB-4266-B7C4-E311EC8EE0DF}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -1486,6 +1462,30 @@ Global
14861462
{BBF37AF9-8290-4B70-8BA8-0F6017B3B620}.Release|x64.Build.0 = Release|Any CPU
14871463
{BBF37AF9-8290-4B70-8BA8-0F6017B3B620}.Release|x86.ActiveCfg = Release|Any CPU
14881464
{BBF37AF9-8290-4B70-8BA8-0F6017B3B620}.Release|x86.Build.0 = Release|Any CPU
1465+
{CD0EF85C-4187-4515-A355-E5A0D4485F40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1466+
{CD0EF85C-4187-4515-A355-E5A0D4485F40}.Debug|Any CPU.Build.0 = Debug|Any CPU
1467+
{CD0EF85C-4187-4515-A355-E5A0D4485F40}.Debug|x64.ActiveCfg = Debug|Any CPU
1468+
{CD0EF85C-4187-4515-A355-E5A0D4485F40}.Debug|x64.Build.0 = Debug|Any CPU
1469+
{CD0EF85C-4187-4515-A355-E5A0D4485F40}.Debug|x86.ActiveCfg = Debug|Any CPU
1470+
{CD0EF85C-4187-4515-A355-E5A0D4485F40}.Debug|x86.Build.0 = Debug|Any CPU
1471+
{CD0EF85C-4187-4515-A355-E5A0D4485F40}.Release|Any CPU.ActiveCfg = Release|Any CPU
1472+
{CD0EF85C-4187-4515-A355-E5A0D4485F40}.Release|Any CPU.Build.0 = Release|Any CPU
1473+
{CD0EF85C-4187-4515-A355-E5A0D4485F40}.Release|x64.ActiveCfg = Release|Any CPU
1474+
{CD0EF85C-4187-4515-A355-E5A0D4485F40}.Release|x64.Build.0 = Release|Any CPU
1475+
{CD0EF85C-4187-4515-A355-E5A0D4485F40}.Release|x86.ActiveCfg = Release|Any CPU
1476+
{CD0EF85C-4187-4515-A355-E5A0D4485F40}.Release|x86.Build.0 = Release|Any CPU
1477+
{F31E8118-014E-4CCE-8A48-5282F7B9BB3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1478+
{F31E8118-014E-4CCE-8A48-5282F7B9BB3E}.Debug|Any CPU.Build.0 = Debug|Any CPU
1479+
{F31E8118-014E-4CCE-8A48-5282F7B9BB3E}.Debug|x64.ActiveCfg = Debug|Any CPU
1480+
{F31E8118-014E-4CCE-8A48-5282F7B9BB3E}.Debug|x64.Build.0 = Debug|Any CPU
1481+
{F31E8118-014E-4CCE-8A48-5282F7B9BB3E}.Debug|x86.ActiveCfg = Debug|Any CPU
1482+
{F31E8118-014E-4CCE-8A48-5282F7B9BB3E}.Debug|x86.Build.0 = Debug|Any CPU
1483+
{F31E8118-014E-4CCE-8A48-5282F7B9BB3E}.Release|Any CPU.ActiveCfg = Release|Any CPU
1484+
{F31E8118-014E-4CCE-8A48-5282F7B9BB3E}.Release|Any CPU.Build.0 = Release|Any CPU
1485+
{F31E8118-014E-4CCE-8A48-5282F7B9BB3E}.Release|x64.ActiveCfg = Release|Any CPU
1486+
{F31E8118-014E-4CCE-8A48-5282F7B9BB3E}.Release|x64.Build.0 = Release|Any CPU
1487+
{F31E8118-014E-4CCE-8A48-5282F7B9BB3E}.Release|x86.ActiveCfg = Release|Any CPU
1488+
{F31E8118-014E-4CCE-8A48-5282F7B9BB3E}.Release|x86.Build.0 = Release|Any CPU
14891489
EndGlobalSection
14901490
GlobalSection(SolutionProperties) = preSolution
14911491
HideSolutionNode = FALSE
@@ -1585,8 +1585,6 @@ Global
15851585
{DA137BD4-F7F1-4D53-855F-5EC40CEA36B0} = {2FC10057-7A0A-4E34-8302-879925BC0102}
15861586
{0CDAB70B-71DC-43BE-ACB7-AD2EE3541FFB} = {2FC10057-7A0A-4E34-8302-879925BC0102}
15871587
{F88118E1-6F4A-4F89-B047-5FFD2889B9F0} = {2FC10057-7A0A-4E34-8302-879925BC0102}
1588-
{A78CE874-76B7-46FE-8009-1ED5258BA0AA} = {29B5A306-7273-4649-8B04-26234D71ADBD}
1589-
{FC2A1EB0-A116-4689-92B7-239B1DCCF4CA} = {29B5A306-7273-4649-8B04-26234D71ADBD}
15901588
{74D21785-2FAB-4266-B7C4-E311EC8EE0DF} = {7260DED9-22A9-4E9D-92F4-5E8A4404DEAF}
15911589
{E4C01A3F-D3C1-4639-A6A9-930E918843DD} = {7260DED9-22A9-4E9D-92F4-5E8A4404DEAF}
15921590
{DE297C91-B3E9-4C6F-B74D-0AF9EFEBF684} = {A27FF193-195B-4474-8E6C-840B2E339373}
@@ -1596,6 +1594,8 @@ Global
15961594
{173D84A3-0F37-480F-AC0F-7E2DBBE32B28} = {B0EEB429-4C8C-42AA-8822-3058E7DBC98F}
15971595
{4664276D-606A-4BB3-873A-9EE84FB22877} = {2FC10057-7A0A-4E34-8302-879925BC0102}
15981596
{BBF37AF9-8290-4B70-8BA8-0F6017B3B620} = {46E4300C-5726-4108-B9A2-18BB94EB26ED}
1597+
{CD0EF85C-4187-4515-A355-E5A0D4485F40} = {BDE2397D-C53A-4783-8B3A-1F54F48A6926}
1598+
{F31E8118-014E-4CCE-8A48-5282F7B9BB3E} = {BDE2397D-C53A-4783-8B3A-1F54F48A6926}
15991599
EndGlobalSection
16001600
GlobalSection(ExtensibilityGlobals) = postSolution
16011601
SolutionGuid = {CC3C47E1-AD1A-4619-9CD3-E08A0148E5CE}

src/Components/ComponentsNoDeps.slnf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@
2626
"Components\\test\\Microsoft.AspNetCore.Components.Tests.csproj",
2727
"Forms\\src\\Microsoft.AspNetCore.Components.Forms.csproj",
2828
"Forms\\test\\Microsoft.AspNetCore.Components.Forms.Tests.csproj",
29-
"Samples\\BlazorServer.Sample\\BlazorServer.Sample.csproj",
29+
"Ignitor\\src\\Ignitor.csproj",
30+
"Ignitor\\test\\Ignitor.Test.csproj",
31+
"Samples\\BlazorServerApp\\BlazorServerApp.csproj",
3032
"Server\\src\\Microsoft.AspNetCore.Components.Server.csproj",
3133
"Server\\test\\Microsoft.AspNetCore.Components.Server.Tests.csproj",
3234
"Web\\src\\Microsoft.AspNetCore.Components.Web.csproj",
3335
"Web\\test\\Microsoft.AspNetCore.Components.Web.Tests.csproj",
3436
"test\\E2ETest\\Microsoft.AspNetCore.Components.E2ETests.csproj",
35-
"test\\Ignitor.Test\\Ignitor.Test.csproj",
3637
"test\\testassets\\BasicTestApp\\BasicTestApp.csproj",
37-
"test\\testassets\\Ignitor\\Ignitor.csproj",
3838
"test\\testassets\\TestContentPackage\\TestContentPackage.csproj",
3939
"test\\testassets\\TestServer\\Components.TestServer.csproj"
4040
]
4141
}
42-
}
42+
}

src/Components/Web/src/Routing/NavLink.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ private void OnLocationChanged(object sender, LocationChangedEventArgs args)
109109

110110
private bool ShouldMatch(string currentUriAbsolute)
111111
{
112+
if (_hrefAbsolute == null)
113+
{
114+
return false;
115+
}
116+
112117
if (EqualsHrefExactlyOrIfTrailingSlashAdded(currentUriAbsolute))
113118
{
114119
return true;

src/Components/test/testassets/BasicTestApp/RouterTest/Links.razor

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<li><NavLink href="/subdir/WithParameters/Name/Abc/LastName/McDef">With more parameters</NavLink></li>
2121
<li><NavLink href="/subdir/LongPage1">Long page 1</NavLink></li>
2222
<li><NavLink href="/subdir/LongPage2">Long page 2</NavLink></li>
23+
<li><NavLink>Null href never matches</NavLink></li>
2324
</ul>
2425

2526
<button id="do-navigation" @onclick=@(x => NavigationManager.NavigateTo("Other"))>

src/Framework/src/Microsoft.AspNetCore.App.Runtime.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
2525
<BaseRuntimeVersionFileName>aspnetcore_base_runtime.version</BaseRuntimeVersionFileName>
2626
<BaseRuntimeVersionFileOutputPath>$(InstallersOutputPath)$(BaseRuntimeVersionFileName)</BaseRuntimeVersionFileOutputPath>
2727

28-
<!-- NuGet appends target framework to this value. Example: runtimes/win-x64/lib/netcoreapp3.1/ -->
28+
<!-- NuGet appends target framework to this value. Example: runtimes/win-x64/lib/netcoreappX.Y/ -->
2929
<BuildOutputTargetFolder>runtimes/$(RuntimeIdentifier)/lib/</BuildOutputTargetFolder>
3030
<!-- We still need the native path to these assets though for the RuntimeList.xml manifest -->
3131
<ManagedAssetsPackagePath>$(BuildOutputTargetFolder)$(DefaultNetCoreTargetFramework)</ManagedAssetsPackagePath>

src/Mvc/Mvc.Analyzers/src/DiagnosticDescriptors.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ public static class DiagnosticDescriptors
4747
new DiagnosticDescriptor(
4848
"MVC1004",
4949
"Rename model bound parameter.",
50-
"Property on type '{0}' has the same name as parameter '{1}'. This may result in incorrect model binding. Consider renaming the parameter or using a model binding attribute to override the name.",
50+
"Property on type '{0}' has the same name as parameter '{1}'. This may result in incorrect model binding. " +
51+
"Consider renaming the parameter or the property to avoid conflicts. If the type '{0}' has a custom type converter or custom model binder, you can suppress this message.",
5152
"Naming",
5253
DiagnosticSeverity.Warning,
5354
isEnabledByDefault: true,

src/Mvc/Mvc.Analyzers/src/TopLevelParameterNameAnalyzer.cs

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,17 @@ internal static bool IsProblematicParameter(in SymbolCache symbolCache, IParamet
8989
return false;
9090
}
9191

92-
if (SpecifiesModelType(symbolCache, parameter))
92+
if (SpecifiesModelType(in symbolCache, parameter))
9393
{
9494
// Ignore parameters that specify a model type.
9595
return false;
9696
}
9797

98+
if (!IsComplexType(parameter.Type))
99+
{
100+
return false;
101+
}
102+
98103
var parameterName = GetName(symbolCache, parameter);
99104

100105
var type = parameter.Type;
@@ -122,6 +127,26 @@ internal static bool IsProblematicParameter(in SymbolCache symbolCache, IParamet
122127
return false;
123128
}
124129

130+
private static bool IsComplexType(ITypeSymbol type)
131+
{
132+
// This analyzer should not apply to simple types. In MVC, a simple type is any type that has a type converter that returns true for TypeConverter.CanConvertFrom(typeof(string)).
133+
// Unfortunately there isn't a Roslyn way of determining if a TypeConverter exists for a given symbol or if the converter allows string conversions.
134+
// https://github.com/dotnet/corefx/blob/v3.0.0-preview8.19405.3/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/ReflectTypeDescriptionProvider.cs#L103-L141
135+
// provides a list of types that have built-in converters.
136+
// We'll use a simpler heuristic in the analyzer: A type is simple if it's a value type or if it's in the "System.*" namespace hierarchy.
137+
138+
var @namespace = type.ContainingNamespace?.ToString();
139+
if (@namespace != null)
140+
{
141+
// Things in the System.* namespace hierarchy don't count as complex types. This workarounds
142+
// the problem of discovering type converters on types in mscorlib.
143+
return @namespace != "System" &&
144+
!@namespace.StartsWith("System.", StringComparison.Ordinal);
145+
}
146+
147+
return true;
148+
}
149+
125150
internal static string GetName(in SymbolCache symbolCache, ISymbol symbol)
126151
{
127152
foreach (var attribute in symbol.GetAttributes(symbolCache.IModelNameProvider))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using System;
2+
3+
namespace Microsoft.AspNetCore.Mvc.Analyzers.TopLevelParameterNameAnalyzerTestFiles
4+
{
5+
public class IsProblematicParameter_ReturnsFalse_ForSimpleTypes
6+
{
7+
public void ActionMethod(DateTime date, DateTime? day, Uri absoluteUri, Version majorRevision, DayOfWeek sunday) { }
8+
}
9+
}

src/Mvc/Mvc.Analyzers/test/TopLevelParameterNameAnalyzerTest.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,30 @@ public async Task IsProblematicParameter_ReturnsFalse_ForParametersWithCustomMod
9595
Assert.False(result);
9696
}
9797

98+
// Test for https://github.com/aspnet/AspNetCore/issues/6945
99+
[Fact]
100+
public async Task IsProblematicParameter_ReturnsFalse_ForSimpleTypes()
101+
{
102+
var testName = nameof(IsProblematicParameter_ReturnsFalse_ForSimpleTypes);
103+
var testSource = MvcTestSource.Read(GetType().Name, testName);
104+
var project = DiagnosticProject.Create(GetType().Assembly, new[] { testSource.Source });
105+
106+
var compilation = await project.GetCompilationAsync();
107+
108+
var modelType = compilation.GetTypeByMetadataName($"Microsoft.AspNetCore.Mvc.Analyzers.TopLevelParameterNameAnalyzerTestFiles.{testName}");
109+
var method = (IMethodSymbol)modelType.GetMembers("ActionMethod").First();
110+
111+
Assert.True(TopLevelParameterNameAnalyzer.SymbolCache.TryCreate(compilation, out var symbolCache));
112+
113+
Assert.Collection(
114+
method.Parameters,
115+
p => Assert.False(TopLevelParameterNameAnalyzer.IsProblematicParameter(symbolCache, p)),
116+
p => Assert.False(TopLevelParameterNameAnalyzer.IsProblematicParameter(symbolCache, p)),
117+
p => Assert.False(TopLevelParameterNameAnalyzer.IsProblematicParameter(symbolCache, p)),
118+
p => Assert.False(TopLevelParameterNameAnalyzer.IsProblematicParameter(symbolCache, p)),
119+
p => Assert.False(TopLevelParameterNameAnalyzer.IsProblematicParameter(symbolCache, p)));
120+
}
121+
98122
[Fact]
99123
public async Task IsProblematicParameter_IgnoresStaticProperties()
100124
{

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Areas/Identity/Pages/Shared/_LoginPartial.cshtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @User.Identity.Name!</a>
1111
</li>
1212
<li class="nav-item">
13-
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/LogOut">Logout</a>
13+
<form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="/" method="post">
14+
<button type="submit" class="nav-link btn btn-link text-dark">Logout</button>
15+
</form>
1416
</li>
1517
}
1618
else

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Shared/MainLayout.Auth.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div class="main">
88
<div class="top-row px-4">
99
<LoginDisplay />
10-
<a href="https://docs.microsoft.com/en-us/aspnet/" target="_blank">About</a>
10+
<a href="https://docs.microsoft.com/aspnet/" target="_blank">About</a>
1111
</div>
1212

1313
<div class="content px-4">

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Shared/MainLayout.NoAuth.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<div class="main">
88
<div class="top-row px-4">
9-
<a href="https://docs.microsoft.com/en-us/aspnet/" target="_blank">About</a>
9+
<a href="https://docs.microsoft.com/aspnet/" target="_blank">About</a>
1010
</div>
1111

1212
<div class="content px-4">

src/ProjectTemplates/test/BlazorServerTemplateTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public async Task BlazorServerTemplateWorks_NoAuth()
3636
Assert.True(0 == publishResult.ExitCode, ErrorMessages.GetFailedProcessMessage("publish", Project, publishResult));
3737

3838
// Run dotnet build after publish. The reason is that one uses Config = Debug and the other uses Config = Release
39-
// The output from publish will go into bin/Release/netcoreapp3.1/publish and won't be affected by calling build
39+
// The output from publish will go into bin/Release/netcoreappX.Y/publish and won't be affected by calling build
4040
// later, while the opposite is not true.
4141

4242
var buildResult = await Project.RunDotNetBuildAsync();
@@ -93,7 +93,7 @@ public async Task BlazorServerTemplateWorks_IndividualAuth(bool useLocalDB)
9393
Assert.True(0 == publishResult.ExitCode, ErrorMessages.GetFailedProcessMessage("publish", Project, publishResult));
9494

9595
// Run dotnet build after publish. The reason is that one uses Config = Debug and the other uses Config = Release
96-
// The output from publish will go into bin/Release/netcoreapp3.1/publish and won't be affected by calling build
96+
// The output from publish will go into bin/Release/netcoreappX.Y/publish and won't be affected by calling build
9797
// later, while the opposite is not true.
9898

9999
var buildResult = await Project.RunDotNetBuildAsync();

0 commit comments

Comments
 (0)