Updating the CSProj files for .NET 6.0 (#209)

* Updating build csproj

* Updating versions

* Updating versions
This commit is contained in:
Matthew Podwysocki 2021-11-18 11:20:07 -05:00 коммит произвёл GitHub
Родитель b8ea0ac57b
Коммит 9bc5379928
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
10 изменённых файлов: 56 добавлений и 13 удалений

Просмотреть файл

@ -145,6 +145,10 @@ indent_size = 2
[*.{props,targets,config,nuspec}]
indent_size = 2
# JSON files
[*.json]
indent_size = 2
# Shell scripts
[*.sh]
end_of_line = lf

Двоичные данные
.github/icons/aznh-icon-128x128.png поставляемый Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 3.1 KiB

Двоичные данные
.github/icons/aznh-icon-512x512.png поставляемый Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 16 KiB

9
global.json Normal file
Просмотреть файл

@ -0,0 +1,9 @@
{
"msbuild-sdks": {
"MSBuild.Sdk.Extras": "3.0.38"
},
"sdk": {
"version": "6.0.100",
"rollForward": "feature"
}
}

Просмотреть файл

@ -33,7 +33,6 @@ namespace Microsoft.Azure.NotificationHubs.DotNetCore.Tests
private const string ContainerName = "ContainerName";
private NamespaceManager _namespaceManager;
private NotificationHubSettings _notificationHubSettings;
private string _notificationHubName;
private readonly Uri _inputFileSasUri;
private readonly Uri _outputContainerSasUri;

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>netcoreapp6.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Просмотреть файл

@ -1189,11 +1189,13 @@ namespace Microsoft.Azure.NotificationHubs.Tests
LoadMockData();
await DeleteAllRegistrationsAndInstallations();
#pragma warning disable 618
var registration = new GcmRegistrationDescription(_configuration["GcmDeviceToken"]);
var createdRegistration = await _hubClient.CreateRegistrationAsync(registration);
var receivedRegistration = await _hubClient.GetRegistrationAsync<GcmRegistrationDescription>(createdRegistration.RegistrationId);
Assert.IsType<GcmRegistrationDescription>(receivedRegistration);
#pragma warning restore 618
RecordTestResults();
}
@ -1235,6 +1237,7 @@ namespace Microsoft.Azure.NotificationHubs.Tests
LoadMockData();
await DeleteAllRegistrationsAndInstallations();
#pragma warning disable 618
var registration = new GcmTemplateRegistrationDescription(_configuration["GcmDeviceToken"], "{\"data\":{\"message\":\"Message\"}}");
registration.TemplateName = "Template Name";
@ -1242,6 +1245,7 @@ namespace Microsoft.Azure.NotificationHubs.Tests
var receivedRegistration = await _hubClient.GetRegistrationAsync<GcmTemplateRegistrationDescription>(createdRegistration.RegistrationId);
Assert.IsType<GcmTemplateRegistrationDescription>(receivedRegistration);
#pragma warning restore 618
RecordTestResults();
}
@ -1251,10 +1255,12 @@ namespace Microsoft.Azure.NotificationHubs.Tests
LoadMockData();
await DeleteAllRegistrationsAndInstallations();
#pragma warning disable 618
var registration = new GcmRegistrationDescription(_configuration["GcmDeviceToken"]);
var createdRegistration = await _hubClient.CreateRegistrationAsync(registration);
Assert.IsType<GcmRegistrationDescription>(createdRegistration);
#pragma warning restore 618
RecordTestResults();
}
@ -1277,12 +1283,14 @@ namespace Microsoft.Azure.NotificationHubs.Tests
LoadMockData();
await DeleteAllRegistrationsAndInstallations();
#pragma warning disable 618
var registration = new GcmTemplateRegistrationDescription(_configuration["GcmDeviceToken"], "{\"data\":{\"message\":\"Message\"}}");
registration.TemplateName = "Template Name";
var createdRegistration = await _hubClient.CreateRegistrationAsync(registration);
Assert.IsType<GcmTemplateRegistrationDescription>(createdRegistration);
#pragma warning restore 618
RecordTestResults();
}
@ -1307,6 +1315,7 @@ namespace Microsoft.Azure.NotificationHubs.Tests
LoadMockData();
await DeleteAllRegistrationsAndInstallations();
#pragma warning disable 618
var registration = new GcmRegistrationDescription(_configuration["GcmDeviceToken"]);
var createdRegistration = await _hubClient.CreateRegistrationAsync(registration);
@ -1315,6 +1324,7 @@ namespace Microsoft.Azure.NotificationHubs.Tests
var updatedRegistration = await _hubClient.CreateOrUpdateRegistrationAsync(createdRegistration);
Assert.IsType<GcmRegistrationDescription>(updatedRegistration);
#pragma warning restore 618
RecordTestResults();
}
@ -1342,6 +1352,7 @@ namespace Microsoft.Azure.NotificationHubs.Tests
LoadMockData();
await DeleteAllRegistrationsAndInstallations();
#pragma warning disable 618
var registration = new GcmTemplateRegistrationDescription(_configuration["GcmDeviceToken"], "{\"data\":{\"message\":\"Message\"}}");
registration.Tags = new HashSet<string>() { "tag1" };
registration.TemplateName = "Template Name";
@ -1352,6 +1363,7 @@ namespace Microsoft.Azure.NotificationHubs.Tests
var updatedRegistration = await _hubClient.CreateOrUpdateRegistrationAsync(createdRegistration);
Assert.IsType<GcmTemplateRegistrationDescription>(updatedRegistration);
#pragma warning restore 618
RecordTestResults();
}
@ -1380,7 +1392,9 @@ namespace Microsoft.Azure.NotificationHubs.Tests
LoadMockData();
await DeleteAllRegistrationsAndInstallations();
#pragma warning disable 618
var gcmRegistration = new GcmRegistrationDescription(_configuration["GcmDeviceToken"]);
#pragma warning restore 618
var fcmRegistration = new FcmRegistrationDescription(_configuration["GcmDeviceToken"]);
await _hubClient.CreateRegistrationAsync(gcmRegistration);
@ -1402,8 +1416,10 @@ namespace Microsoft.Azure.NotificationHubs.Tests
LoadMockData();
await DeleteAllRegistrationsAndInstallations();
#pragma warning disable 618
var gcmTemplateRegistration = new GcmTemplateRegistrationDescription(_configuration["GcmDeviceToken"], "{\"data\":{\"message\":\"Message\"}}");
gcmTemplateRegistration.TemplateName = "Gcm Template Name";
#pragma warning restore 618
var fcmTemplateRegistration = new FcmTemplateRegistrationDescription(_configuration["GcmDeviceToken"], "{\"data\":{\"message\":\"Message\"}}");
fcmTemplateRegistration.TemplateName = "Fcm Template Name";
@ -1427,7 +1443,9 @@ namespace Microsoft.Azure.NotificationHubs.Tests
LoadMockData();
await DeleteAllRegistrationsAndInstallations();
#pragma warning disable 618
var gcmRegistration = new GcmRegistrationDescription(_configuration["GcmDeviceToken"], new[] { "tag1" });
#pragma warning restore 618
var fcmRegistration = new FcmRegistrationDescription(_configuration["GcmDeviceToken"], new[] { "tag1" });
await _hubClient.CreateRegistrationAsync(gcmRegistration);
@ -1448,10 +1466,11 @@ namespace Microsoft.Azure.NotificationHubs.Tests
{
LoadMockData();
await DeleteAllRegistrationsAndInstallations();
#pragma warning disable 618
var gcmTemplateRegistration = new GcmTemplateRegistrationDescription(_configuration["GcmDeviceToken"], "{\"data\":{\"message\":\"Message\"}}");
gcmTemplateRegistration.Tags = new HashSet<string>() { "tag2" };
gcmTemplateRegistration.TemplateName = "Gcm Template Name";
#pragma warning restore 618
var fcmTemplateRegistration = new FcmTemplateRegistrationDescription(_configuration["GcmDeviceToken"], "{\"data\":{\"message\":\"Message\"}}");
fcmTemplateRegistration.Tags = new HashSet<string>() { "tag2" };
@ -1475,8 +1494,9 @@ namespace Microsoft.Azure.NotificationHubs.Tests
{
LoadMockData();
await DeleteAllRegistrationsAndInstallations();
#pragma warning disable 618
var gcmRegistration = new GcmRegistrationDescription(_configuration["GcmDeviceToken"]);
#pragma warning restore 618
var fcmRegistration = new FcmRegistrationDescription(_configuration["GcmDeviceToken"]);
await _hubClient.CreateRegistrationAsync(gcmRegistration);
@ -1497,10 +1517,10 @@ namespace Microsoft.Azure.NotificationHubs.Tests
{
LoadMockData();
await DeleteAllRegistrationsAndInstallations();
#pragma warning disable 618
var gcmTemplateRegistration = new GcmTemplateRegistrationDescription(_configuration["GcmDeviceToken"], "{\"data\":{\"message\":\"Message\"}}");
gcmTemplateRegistration.TemplateName = "Gcm Template Name";
#pragma warning restore 618
var fcmTemplateRegistration = new FcmTemplateRegistrationDescription(_configuration["GcmDeviceToken"], "{\"data\":{\"message\":\"Message\"}}");
fcmTemplateRegistration.TemplateName = "Fcm Template Name";

Просмотреть файл

@ -26,7 +26,8 @@
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="17.0.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.console" Version="2.4.1" />
<PackageReference Include="xunit.runner.msbuild" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />

Просмотреть файл

@ -291,10 +291,14 @@ namespace Microsoft.Azure.NotificationHubs.Messaging
public static string GenerateRandomKey()
{
byte[] key256 = new byte[32];
using (var rngCryptoServiceProvider = new RNGCryptoServiceProvider())
{
rngCryptoServiceProvider.GetBytes(key256);
}
#if NETFRAMEWORK
using var rngCryptoServiceProvider = new RNGCryptoServiceProvider();
rngCryptoServiceProvider.GetBytes(key256);
#else
var rngCryptoServiceProvider = RandomNumberGenerator.Create();
rngCryptoServiceProvider.GetBytes(key256);
#endif
return Convert.ToBase64String(key256);
}

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>netstandard2.1;netstandard2.0;net6.0</TargetFrameworks>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
@ -11,7 +11,8 @@
<Authors>Microsoft</Authors>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://aka.ms/NHNuget</PackageProjectUrl>
<PackageIconUrl>http://go.microsoft.com/fwlink/?LinkID=288890</PackageIconUrl>
<PackageIconUrl>https://raw.githubusercontent.com/Azure/azure-notificationhubs-dotnet/main/.github/icons/aznh-icon-128x128.png</PackageIconUrl>
<PackageIcon>aznh-icon-128x128.png</PackageIcon>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Description>
Use this for Microsoft Azure Notification Hubs back end operations.
@ -26,6 +27,7 @@
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<PackageTags>Microsoft Azure windowsazureofficial NotificationHub Notifications Notification Hub Push Windows Phone iOS Android Baidu Kindle Amazon</PackageTags>
<Version>4.1.0.0</Version>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
@ -40,6 +42,10 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\.github\icons\aznh-icon-128x128.png" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<Compile Update="SRClient.Designer.cs">
<DesignTime>True</DesignTime>