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
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable enable

using System;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable enable

using System;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable enable

using System;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable enable

using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable enable

using System;
using System.Text;
using System.Collections.Generic;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable enable
using System;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable enable

using Microsoft.Win32.SafeHandles;
using System;
using System.Diagnostics;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable enable
#if REGISTRY_ASSEMBLY
using Microsoft.Win32.SafeHandles;
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ internal static partial class Crypt32
internal static partial bool CertGetCertificateContextProperty(
SafeCertContextHandle pCertContext,
CertContextPropId dwPropId,
byte[] pvData,
byte[]? pvData,
ref int pcbData);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable enable
using Microsoft.Win32.SafeHandles;
using System;
using System.Runtime.InteropServices;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable enable
using System;
using System.Runtime.InteropServices;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@

namespace Microsoft.Win32.SafeHandles
{
#nullable disable
/// <summary>
/// SafeHandle for the CERT_CONTEXT structure defined by crypt32.
/// </summary>
internal class SafeCertContextHandle : SafeCrypt32Handle<SafeCertContextHandle>
{
private SafeCertContextHandle _parent;
private SafeCertContextHandle? _parent;

public SafeCertContextHandle() { }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable enable
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
Expand Down
2 changes: 0 additions & 2 deletions src/libraries/Common/src/System/CodeDom/CodeObject.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable enable

using System.Collections;
using System.Collections.Specialized;

Expand Down
2 changes: 0 additions & 2 deletions src/libraries/Common/src/System/CodeDom/CodeTypeReference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
using System.Diagnostics;
using System.Globalization;

#nullable enable

#if CODEDOM
namespace System.CodeDom
#else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable enable
using System.Diagnostics;
using System.Globalization;

Expand Down
1 change: 0 additions & 1 deletion src/libraries/Common/src/System/Drawing/ColorTable.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable enable
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable enable
using System.Runtime.CompilerServices;

namespace System
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable enable

using System.Diagnostics.CodeAnalysis;

namespace System.Runtime.InteropServices.Marshalling
Expand Down
1 change: 0 additions & 1 deletion src/libraries/Common/src/System/SR.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable enable
using System.Resources;

namespace System
Expand Down
2 changes: 0 additions & 2 deletions src/libraries/Common/src/System/Security/IdentityHelper.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable enable

using System.Diagnostics;
using System.IO;
using System.Reflection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable enable
using System.Buffers;
using System.Collections;
using System.Collections.Generic;
Expand Down
1 change: 0 additions & 1 deletion src/libraries/Common/tests/System/IO/ByteLoggingStream.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable enable
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
Expand Down
1 change: 0 additions & 1 deletion src/libraries/Common/tests/System/IO/ConnectedStreams.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable enable
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
Expand Down
1 change: 0 additions & 1 deletion src/libraries/Common/tests/System/IO/DelayStream.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable enable
using System.IO;
using System.Threading;
using System.Threading.Tasks;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
using Xunit.Abstractions;
using Xunit.Sdk;

#nullable enable

namespace TestUtilities;

// Based on https://github.com/xunit/xunit/blob/v2/src/xunit.execution/Sdk/DefaultTestCaseOrderer.cs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
using Xunit.Abstractions;
using Xunit.Sdk;

#nullable enable

namespace TestUtilities;

public class RandomTestCollectionOrderer : ITestCollectionOrderer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable enable
using System.Globalization;

namespace System.Tests
Expand Down
5 changes: 3 additions & 2 deletions src/libraries/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@
<!-- Enable documentation file generation by the compiler for all libraries except for vbproj. -->
<GenerateDocumentationFile Condition="'$(IsSourceProject)' == 'true' and '$(MSBuildProjectExtension)' != '.vbproj'">true</GenerateDocumentationFile>
<CLSCompliant Condition="'$(CLSCompliant)' == '' and '$(IsTestProject)' != 'true' and '$(IsTestSupportProject)' != 'true'">true</CLSCompliant>
<!-- Nullability is enabled by default except for test projects. -->
<Nullable Condition="'$(Nullable)' == ''">enable</Nullable>
<!-- Nullability is enabled by default except for test projects, which instead default to annotations. -->
<Nullable Condition="'$(Nullable)' == '' and '$(IsTestProject)' != 'true'">enable</Nullable>
<Nullable Condition="'$(Nullable)' == '' and '$(IsTestProject)' == 'true'">annotations</Nullable>
</PropertyGroup>
<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<EditorConfigFiles Remove="$(RepositoryEngineeringDir)CodeAnalysis.src.globalconfig" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
<Nullable>disable</Nullable>
<NoWarn>$(NoWarn);nullable</NoWarn>
Comment thread
stephentoub marked this conversation as resolved.
<EnableDefaultItems>true</EnableDefaultItems>
<CLSCompliant>false</CLSCompliant>
<IsTrimmable>false</IsTrimmable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
using System.Threading;
using System.Threading.Tasks;

#nullable enable

namespace Microsoft.Extensions.Hosting
{
internal sealed class HostFactoryResolver
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -958,9 +958,8 @@ public async Task AddHttpClient_MessageHandler_SingletonDependency()
client.Service,
request.Properties[nameof(SingletonService)]);
#else
#nullable enable
request.Options.TryGetValue(new HttpRequestOptionsKey<SingletonService>(nameof(SingletonService)), out SingletonService? optService);
#nullable disable

Assert.Same(
services.GetRequiredService<SingletonService>(),
optService);
Expand Down Expand Up @@ -1006,9 +1005,7 @@ public async Task AddHttpClient_MessageHandler_Scope_SingletonDependency()
client.Service,
request.Properties[nameof(SingletonService)]);
#else
#nullable enable
request.Options.TryGetValue(new HttpRequestOptionsKey<SingletonService>(nameof(SingletonService)), out SingletonService? optService);
#nullable disable

Assert.Same(
services.GetRequiredService<SingletonService>(),
Expand Down Expand Up @@ -1080,9 +1077,8 @@ public async Task AddHttpClient_MessageHandler_Scope_ScopedDependency()
client.Service,
request.Properties[nameof(ScopedService)]);
#else
#nullable enable
request.Options.TryGetValue(new HttpRequestOptionsKey<ScopedService>(nameof(ScopedService)), out ScopedService? optService);
#nullable disable

Assert.NotSame(
scope.ServiceProvider.GetRequiredService<ScopedService>(),
optService);
Expand Down Expand Up @@ -1127,9 +1123,8 @@ public async Task AddHttpClient_MessageHandler_TransientDependency()
client.Service,
request.Properties[nameof(TransientService)]);
#else
#nullable enable
request.Options.TryGetValue(new HttpRequestOptionsKey<TransientService>(nameof(TransientService)), out TransientService? optService);
#nullable disable

Assert.NotSame(
services.GetRequiredService<TransientService>(),
optService);
Expand Down Expand Up @@ -1171,9 +1166,8 @@ public async Task AddHttpClient_MessageHandler_Scope_TransientDependency()
client.Service,
request.Properties[nameof(TransientService)]);
#else
#nullable enable
request.Options.TryGetValue(new HttpRequestOptionsKey<TransientService>(nameof(TransientService)), out TransientService? optService);
#nullable disable
request.Options.TryGetValue(new HttpRequestOptionsKey<TransientService>(nameof(TransientService)), out TransientService? optService);

Assert.NotSame(
services.GetRequiredService<TransientService>(),
optService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<TargetFrameworks>$(NetCoreAppCurrent);net48</TargetFrameworks>
<Nullable>disable</Nullable> <!-- Disable nullable attributes as some tests depend on them not being present. -->
<NoWarn>$(NoWarn);nullable</NoWarn>
Comment thread
krwq marked this conversation as resolved.
</PropertyGroup>
<ItemGroup>
<Compile Include="System\ComponentModel\DataAnnotations\AssociatedMetadataTypeTypeDescriptionProviderTests.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.1</TargetFrameworks>
<Nullable>disable</Nullable>
<NoWarn>$(NoWarn);nullable</NoWarn>
<IsTrimmable>false</IsTrimmable>
<IsPackable>true</IsPackable>
<AddNETFrameworkPlaceholderFileToPackage>true</AddNETFrameworkPlaceholderFileToPackage>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<Nullable>disable</Nullable> <!-- Disable nullable attributes as some tests depend on them not being present. -->
<NoWarn>$(NoWarn);nullable</NoWarn>
</PropertyGroup>
<ItemGroup>
<Compile Include="InternalCalls.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
<Nullable>disable</Nullable>
<NoWarn>$(NoWarn);nullable</NoWarn>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<IsPackable>true</IsPackable>
<PackageDescription>Provides common attributes used by System.Composition types.
Expand All @@ -27,4 +28,4 @@ System.Composition.Convention.AttributedModelProvider</PackageDescription>
<Compile Include="System\Composition\SharedAttribute.cs" />
<Compile Include="System\Composition\SharingBoundaryAttribute.cs" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
<Nullable>disable</Nullable>
<NoWarn>$(NoWarn);nullable</NoWarn>
<IsTrimmable>false</IsTrimmable>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<IsPackable>true</IsPackable>
Expand Down Expand Up @@ -37,4 +38,4 @@ System.Composition.Convention.ParameterImportConventionBuilder</PackageDescripti
<ItemGroup>
<ProjectReference Include="$(LibrariesProjectRoot)System.Composition.AttributedModel\src\System.Composition.AttributedModel.csproj" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
<Nullable>disable</Nullable>
<NoWarn>$(NoWarn);nullable</NoWarn>
<IsTrimmable>false</IsTrimmable>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<IsPackable>true</IsPackable>
Expand Down Expand Up @@ -47,4 +48,4 @@ System.Composition.Hosting.CompositionHost</PackageDescription>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
<Reference Include="System.ComponentModel.Composition" />
</ItemGroup>
</Project>
</Project>
Loading