Update to .NET 5 preview 8 (#13530)

This commit is contained in:
Robert Holt 2020-08-31 10:38:05 -07:00 committed by GitHub
parent 3543491909
commit 6a37eb9313
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 62 additions and 56 deletions

View file

@ -1,8 +1,8 @@
{
"sdk": {
"channel": "release/5.0.1xx-preview7",
"packageVersionPattern": "5.0.0-preview.7",
"sdkImageVersion": "5.0.100-preview.7",
"nextChannel": "net5/preview7"
"channel": "release/5.0.1xx-preview8",
"packageVersionPattern": "5.0.0-preview.8",
"sdkImageVersion": "5.0.100-preview.8",
"nextChannel": "net5/preview8"
}
}

View file

@ -3105,12 +3105,12 @@
<Component Id="cmpC0FFB3F4FB30438082D2DC0F4E4BF12D">
<File Id="fil8FEEEB3B27DF40148EB85CE6AE1A420B" KeyPath="yes" Source="$(var.ProductSourcePath)\Microsoft.DiaSymReader.Native.$(var.FileArchitecture).dll" />
</Component>
<Component Id="cmpF65478926051451688800150DBAEE4BC">
<File Id="fil99692697F55D4B1B9D28FDBD439A11BA" KeyPath="yes" Source="$(var.ProductSourcePath)\mscordaccore_$(var.FileArchitecture)_$(var.FileArchitecture)_5.0.20.36411.dll" />
</Component>
<Component Id="cmp5485813EC16244898CB9A944AC2BC5E9">
<File Id="fil6EA784763CF94299BC6E75DF068F05A3" KeyPath="yes" Source="$(var.ProductSourcePath)\Microsoft.PowerShell.Pager.dll" />
</Component>
<Component Id="cmp9AFE828DDCCC4A0E83C4D7476B353023">
<File Id="filBE5924015B7147E5BE1D6CDEB8AFB6C3" KeyPath="yes" Source="$(var.ProductSourcePath)\mscordaccore_$(var.FileArchitecture)_$(var.FileArchitecture)_5.0.20.40711.dll" />
</Component>
</DirectoryRef>
</Fragment>
<Fragment>
@ -4112,8 +4112,8 @@
<ComponentRef Id="cmp72C41225E0B4457C8CB5F4C5FE6E3187" />
<ComponentRef Id="cmp0BD7D15E0377407FA4C43BFE89F0C12E" />
<ComponentRef Id="cmpC0FFB3F4FB30438082D2DC0F4E4BF12D" />
<ComponentRef Id="cmpF65478926051451688800150DBAEE4BC" />
<ComponentRef Id="cmp5485813EC16244898CB9A944AC2BC5E9" />
<ComponentRef Id="cmp9AFE828DDCCC4A0E83C4D7476B353023" />
</ComponentGroup>
</Fragment>
</Wix>

View file

@ -1,5 +1,5 @@
{
"sdk": {
"version": "5.0.100-preview.7.20366.15"
"version": "5.0.100-preview.8.20417.9"
}
}

View file

@ -40,10 +40,14 @@ namespace Microsoft.Management.UI.Internal
FilterRule copy = null;
try
{
#pragma warning disable MSLIB0003
formatter.Serialize(ms, rule);
#pragma warning restore MSLIB0003
ms.Position = 0;
#pragma warning disable MSLIB0003
copy = (FilterRule)formatter.Deserialize(ms);
#pragma warning restore MSLIB0003
}
finally
{

View file

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop" ToolsVersion="15.0">
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="..\..\PowerShell.Common.props" />
<PropertyGroup>
<Description>Assembly containing WPF code for Out-GridView, HelpWindow, and Show-Command</Description>
@ -6,6 +6,8 @@
<RootNamespace>Microsoft.Management.UI.Internal</RootNamespace>
<AssemblyName>Microsoft.PowerShell.GraphicalHost</AssemblyName>
<UseWPF>True</UseWPF>
<TargetPlatformIdentifier>Windows</TargetPlatformIdentifier>
<TargetPlatformVersion>7.0</TargetPlatformVersion>
</PropertyGroup>
<PropertyGroup>

View file

@ -47,7 +47,7 @@
<ItemGroup>
<!-- the following package(s) are from https://github.com/dotnet/corefx -->
<PackageReference Include="System.ServiceProcess.ServiceController" Version="5.0.0-preview.7.20364.11" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="5.0.0-preview.8.20365.6" />
</ItemGroup>
</Project>

View file

@ -784,8 +784,10 @@ namespace Microsoft.PowerShell.Commands
// The buffer length must be +1, last position is for a null string terminator.
int userNameLength = 257;
int domainNameLength = 16;
#pragma warning disable CA2014
Span<char> userNameStr = stackalloc char[userNameLength];
Span<char> domainNameStr = stackalloc char[domainNameLength];
#pragma warning restore CA2014
Win32Native.SID_NAME_USE accountType;
// userNameLength and domainNameLength will be set to actual lengths.

View file

@ -32,8 +32,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.7.0" />
<PackageReference Include="System.Threading.AccessControl" Version="5.0.0-preview.7.20364.11" />
<PackageReference Include="System.Drawing.Common" Version="5.0.0-preview.7.20364.11" />
<PackageReference Include="System.Threading.AccessControl" Version="5.0.0-preview.8.20365.6" />
<PackageReference Include="System.Drawing.Common" Version="5.0.0-preview.8.20365.6" />
<PackageReference Include="NJsonSchema" Version="10.1.24" />
</ItemGroup>

View file

@ -2576,7 +2576,9 @@ namespace Microsoft.PowerShell
{
var endOfLine = Environment.NewLine.AsSpan();
var endOfLineLength = endOfLine.Length;
#pragma warning disable CA2014
Span<char> outBufferLine = stackalloc char[outBuffer.Length + endOfLineLength];
#pragma warning restore CA2014
outBuffer.CopyTo(outBufferLine);
endOfLine.CopyTo(outBufferLine.Slice(outBufferLine.Length - endOfLineLength));
WriteConsole(consoleHandle, outBufferLine);

View file

@ -305,7 +305,9 @@ namespace Microsoft.PowerShell
ConsoleKeyInfo keyInfo = Console.ReadKey(true);
#else
const int CharactersToRead = 1;
#pragma warning disable CA2014
Span<char> inputBuffer = stackalloc char[CharactersToRead + 1];
#pragma warning restore CA2014
string key = ConsoleControl.ReadConsole(handle, initialContentLength: 0, inputBuffer, charactersToRead: CharactersToRead, endOnTab: false, out _);
#endif

View file

@ -8,7 +8,7 @@
<ItemGroup>
<!-- the following package(s) are from https://github.com/dotnet/corefx -->
<PackageReference Include="System.Diagnostics.EventLog" Version="5.0.0-preview.7.20364.11" />
<PackageReference Include="System.Diagnostics.EventLog" Version="5.0.0-preview.8.20365.6" />
</ItemGroup>
</Project>

View file

@ -18,9 +18,9 @@
<!-- the following package(s) are from https://github.com/dotnet/fxdac -->
<PackageReference Include="System.Data.SqlClient" Version="4.8.1" />
<!-- the following package(s) are from https://github.com/dotnet/corefx -->
<PackageReference Include="System.IO.Packaging" Version="5.0.0-preview.7.20364.11" />
<PackageReference Include="System.Net.Http.WinHttpHandler" Version="5.0.0-preview.7.20364.11" />
<PackageReference Include="System.Text.Encodings.Web" Version="5.0.0-preview.7.20364.11" />
<PackageReference Include="System.IO.Packaging" Version="5.0.0-preview.8.20365.6" />
<PackageReference Include="System.Net.Http.WinHttpHandler" Version="5.0.0-preview.8.20365.6" />
<PackageReference Include="System.Text.Encodings.Web" Version="5.0.0-preview.8.20365.6" />
<!-- the following package(s) are from https://github.com/dotnet/wcf -->
<PackageReference Include="System.ServiceModel.Duplex" Version="4.7.0" />
<PackageReference Include="System.ServiceModel.Http" Version="4.7.0" />
@ -30,7 +30,7 @@
<PackageReference Include="System.Private.ServiceModel" Version="4.7.0" />
<!-- the source could not be found for the following package(s) -->
<PackageReference Include="Microsoft.NETCore.Windows.ApiSets" Version="1.0.1" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="5.0.0-preview.7.20364.11" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="5.0.0-preview.8.20365.6" />
</ItemGroup>
</Project>

View file

@ -9,7 +9,7 @@
<ProjectReference Include="..\System.Management.Automation\System.Management.Automation.csproj" />
<ProjectReference Include="..\Microsoft.WSMan.Runtime\Microsoft.WSMan.Runtime.csproj" />
<!-- the following package(s) are from https://github.com/dotnet/corefx -->
<PackageReference Include="System.ServiceProcess.ServiceController" Version="5.0.0-preview.7.20364.11" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="5.0.0-preview.8.20365.6" />
</ItemGroup>
<PropertyGroup>

View file

@ -16,16 +16,16 @@
<!-- the Application Insights package -->
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.14.0" />
<!-- the following package(s) are from https://github.com/dotnet/corefx -->
<PackageReference Include="Microsoft.Win32.Registry.AccessControl" Version="5.0.0-preview.7.20364.11" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0-preview.7.20364.11" />
<PackageReference Include="System.DirectoryServices" Version="5.0.0-preview.7.20364.11" />
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0-preview.7.20364.11" />
<PackageReference Include="System.Management" Version="5.0.0-preview.7.20364.11" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.0.0-preview.7.20364.11" />
<PackageReference Include="System.Security.AccessControl" Version="5.0.0-preview.7.20364.11" />
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="5.0.0-preview.7.20364.11" />
<PackageReference Include="System.Security.Permissions" Version="5.0.0-preview.7.20364.11" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="5.0.0-preview.7.20364.11" />
<PackageReference Include="Microsoft.Win32.Registry.AccessControl" Version="5.0.0-preview.8.20365.6" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0-preview.8.20365.6" />
<PackageReference Include="System.DirectoryServices" Version="5.0.0-preview.8.20365.6" />
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0-preview.8.20365.6" />
<PackageReference Include="System.Management" Version="5.0.0-preview.8.20365.6" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.0.0-preview.8.20365.6" />
<PackageReference Include="System.Security.AccessControl" Version="5.0.0-preview.8.20365.6" />
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="5.0.0-preview.8.20365.6" />
<PackageReference Include="System.Security.Permissions" Version="5.0.0-preview.8.20365.6" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="5.0.0-preview.8.20365.6" />
<!-- the following package(s) are from the powershell org -->
<PackageReference Include="Microsoft.Management.Infrastructure" Version="2.0.0" />
<PackageReference Include="Microsoft.PowerShell.Native" Version="7.0.0" />

View file

@ -107,7 +107,9 @@ namespace System.Management.Automation.Remoting
BinaryFormatter formatter = new BinaryFormatter();
using (MemoryStream stream = new MemoryStream())
{
#pragma warning disable MSLIB0003
formatter.Serialize(stream, TimeZoneInfo.Local);
#pragma warning restore MSLIB0003
stream.Seek(0, SeekOrigin.Begin);
byte[] result = new byte[stream.Length];
stream.Read(result, 0, (int)stream.Length);

View file

@ -7617,9 +7617,9 @@ namespace Microsoft.PowerShell.Commands
set
{
#pragma warning disable 612, 618
if (value == System.Text.Encoding.UTF7)
#pragma warning restore 612, 618
// Check for UTF-7 by checking for code page 65000
// See: https://docs.microsoft.com/en-us/dotnet/core/compatibility/corefx#utf-7-code-paths-are-obsolete
if (value != null && value.CodePage == 65000)
{
_provider.WriteWarning(PathUtilsStrings.Utf7EncodingObsolete);
}

View file

@ -38,7 +38,9 @@ namespace System.Management.Automation
{ Default, ClrFacade.GetDefaultEncoding() },
{ OEM, ClrFacade.GetOEMEncoding() },
{ Unicode, System.Text.Encoding.Unicode },
#pragma warning disable MSLIB0001
{ Utf7, System.Text.Encoding.UTF7 },
#pragma warning restore MSLIB0001
{ Utf8, ClrFacade.GetDefaultEncoding() },
{ Utf8Bom, System.Text.Encoding.UTF8 },
{ Utf8NoBom, ClrFacade.GetDefaultEncoding() },
@ -95,9 +97,9 @@ namespace System.Management.Automation
/// <param name="encoding">The encoding to check for obsolescence.</param>
internal static void WarnIfObsolete(Cmdlet cmdlet, Encoding encoding)
{
#pragma warning disable 612, 618
if (encoding == System.Text.Encoding.UTF7)
#pragma warning restore 612, 618
// Check for UTF-7 by checking for code page 65000
// See: https://docs.microsoft.com/en-us/dotnet/core/compatibility/corefx#utf-7-code-paths-are-obsolete
if (encoding != null && encoding.CodePage == 65000)
{
cmdlet.WriteWarning(PathUtilsStrings.Utf7EncodingObsolete);
}

View file

@ -11,23 +11,11 @@
<RuntimeIdentifiers>win7-x86;win7-x64</RuntimeIdentifiers>
<RootNamespace>Microsoft.PowerShell</RootNamespace>
<ApplicationManifest>..\..\assets\pwsh.manifest</ApplicationManifest>
<TargetPlatformIdentifier>Windows</TargetPlatformIdentifier>
<TargetPlatformVersion>7.0</TargetPlatformVersion>
</PropertyGroup>
<!-- Have default so this builds in Visual Studio -->
<PropertyGroup Condition = "'$(SDKToUse)' == ''">
<SDKToUse>Microsoft.NET.Sdk.WindowsDesktop</SDKToUse>
</PropertyGroup>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" Condition="'$(SDKToUse)' == 'Microsoft.NET.Sdk' " />
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" Condition="'$(SDKToUse)' == 'Microsoft.NET.Sdk' " />
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk.WindowsDesktop" Condition="'$(SDKToUse)' == 'Microsoft.NET.Sdk.WindowsDesktop' " />
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk.WindowsDesktop" Condition="'$(SDKToUse)' == 'Microsoft.NET.Sdk.WindowsDesktop' " />
<PropertyGroup Condition="'$(SDKToUse)' == 'Microsoft.NET.Sdk.WindowsDesktop' ">
<UseWpf>true</UseWpf>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<ItemGroup>
<Compile Include="..\powershell\Program.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
@ -64,4 +52,6 @@
<ProjectReference Include="..\Microsoft.Management.UI.Internal\Microsoft.PowerShell.GraphicalHost.csproj" Condition="'$(SDKToUse)' == 'Microsoft.NET.Sdk.WindowsDesktop' "/>
</ItemGroup>
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>

View file

@ -12,7 +12,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Windows.Compatibility" Version="5.0.0-preview.7.20364.11" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="5.0.0-preview.8.20365.6" />
</ItemGroup>
</Project>

View file

@ -7,8 +7,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.0-preview.7.20365.19" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="5.0.0-preview.7.20364.11" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.0-preview.8.20364.8" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="5.0.0-preview.8.20365.6" />
</ItemGroup>
<ItemGroup>

View file

@ -14,6 +14,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="System.Security.AccessControl" Version="5.0.0-preview.7.20364.11" />
<PackageReference Include="System.Security.AccessControl" Version="5.0.0-preview.8.20365.6" />
</ItemGroup>
</Project>

View file

@ -9,7 +9,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Management.Infrastructure" Version="2.0.0" />
<PackageReference Include="System.Security.AccessControl" Version="5.0.0-preview.7.20364.11" />
<PackageReference Include="System.Security.Principal.Windows" Version="5.0.0-preview.7.20364.11" />
<PackageReference Include="System.Security.AccessControl" Version="5.0.0-preview.8.20365.6" />
<PackageReference Include="System.Security.Principal.Windows" Version="5.0.0-preview.8.20365.6" />
</ItemGroup>
</Project>