From dcb83a47c937ee642b2db460af436d8aa9c64c2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lozier?= Date: Mon, 3 Oct 2022 20:39:13 -0400 Subject: [PATCH 1/3] Add net6.0 to package --- Build.proj | 2 +- Dlr.sln | 5 +++-- Package/nuget/DynamicLanguageRuntime.nuspec | 9 ++++++--- Src/Microsoft.Dynamic/Actions/EventTracker.cs | 6 ++++++ .../ComInterop/ComEventSink.netcoreapp.cs | 2 ++ .../ComInterop/ComEventSinksContainer.cs | 2 ++ Src/Microsoft.Dynamic/ComInterop/ComObject.cs | 2 ++ .../ComInterop/ComRuntimeHelpers.cs | 2 ++ .../ComInterop/ComTypeClassDesc.cs | 5 ++++- .../ComInterop/ComTypeEnumDesc.cs | 6 ++++-- .../ComInterop/DispatchArgBuilder.cs | 4 +++- .../ComInterop/IDispatchComObject.cs | 9 ++++++--- Src/Microsoft.Dynamic/ComInterop/Variant.cs | 12 ++++++++---- .../Hosting/Shell/BasicConsole.cs | 2 ++ .../Hosting/Shell/CommandLine.cs | 4 ++++ .../Hosting/Shell/ConsoleHost.cs | 2 ++ .../Interpreter/Interpreter.cs | 2 ++ .../Microsoft.Dynamic.csproj | 2 +- .../Microsoft.Scripting.csproj | 19 +++++++++++++++---- 19 files changed, 75 insertions(+), 22 deletions(-) diff --git a/Build.proj b/Build.proj index fb6bc6eb..6a5e08b6 100644 --- a/Build.proj +++ b/Build.proj @@ -108,7 +108,7 @@ Outputs="$(PackageDir)\DynamicLanguageRuntime.$(PackageVersion).zip"> + Exclude="$(StageDir)\netcoreapp2.1\**\*;$(StageDir)\net7.0*\**\*" /> diff --git a/Dlr.sln b/Dlr.sln index 72de8fd8..091f0495 100644 --- a/Dlr.sln +++ b/Dlr.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.28827.37 +# Visual Studio Version 17 +VisualStudioVersion = 17.3.32811.315 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{9C454D45-326F-4EA1-8177-64341267A17F}" EndProject @@ -36,6 +36,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{60056F49 ProjectSection(SolutionItems) = preProject Build\After.targets = Build\After.targets Build\net452.props = Build\net452.props + Build\net6.0.props = Build\net6.0.props Build\netcoreapp3.1.props = Build\netcoreapp3.1.props Build\netstandard2.0.props = Build\netstandard2.0.props Build\steps.yml = Build\steps.yml diff --git a/Package/nuget/DynamicLanguageRuntime.nuspec b/Package/nuget/DynamicLanguageRuntime.nuspec index 0cae9682..ea55cd3f 100644 --- a/Package/nuget/DynamicLanguageRuntime.nuspec +++ b/Package/nuget/DynamicLanguageRuntime.nuspec @@ -27,12 +27,15 @@ + + + - - - + + + diff --git a/Src/Microsoft.Dynamic/Actions/EventTracker.cs b/Src/Microsoft.Dynamic/Actions/EventTracker.cs index 50c3eb73..f8b02a75 100644 --- a/Src/Microsoft.Dynamic/Actions/EventTracker.cs +++ b/Src/Microsoft.Dynamic/Actions/EventTracker.cs @@ -177,6 +177,9 @@ private HandlerList GetHandlerList(object instance) { } #if FEATURE_COM + +#pragma warning disable CA1416 // Validate platform compatibility + /// /// Gets the stub list for a COM Object. For COM objects we store the stub list /// directly on the object using the Marshal APIs. This allows us to not have @@ -200,6 +203,9 @@ private HandlerList GetComHandlerList(object instance) { return hl; } + +#pragma warning restore CA1416 // Validate platform compatibility + #endif /// diff --git a/Src/Microsoft.Dynamic/ComInterop/ComEventSink.netcoreapp.cs b/Src/Microsoft.Dynamic/ComInterop/ComEventSink.netcoreapp.cs index 2d9e6c97..e7fb2d42 100644 --- a/Src/Microsoft.Dynamic/ComInterop/ComEventSink.netcoreapp.cs +++ b/Src/Microsoft.Dynamic/ComInterop/ComEventSink.netcoreapp.cs @@ -3,6 +3,8 @@ #if FEATURE_COM +#pragma warning disable CA1416 // Validate platform compatibility + using System; using System.Collections.Generic; using System.Diagnostics; diff --git a/Src/Microsoft.Dynamic/ComInterop/ComEventSinksContainer.cs b/Src/Microsoft.Dynamic/ComInterop/ComEventSinksContainer.cs index c7bdf994..a2e9dfe8 100644 --- a/Src/Microsoft.Dynamic/ComInterop/ComEventSinksContainer.cs +++ b/Src/Microsoft.Dynamic/ComInterop/ComEventSinksContainer.cs @@ -4,6 +4,8 @@ #if FEATURE_COM +#pragma warning disable CA1416 // Validate platform compatibility + using System; using System.Collections.Generic; using System.Runtime.InteropServices; diff --git a/Src/Microsoft.Dynamic/ComInterop/ComObject.cs b/Src/Microsoft.Dynamic/ComInterop/ComObject.cs index 4e5d4b11..8e48a8fd 100644 --- a/Src/Microsoft.Dynamic/ComInterop/ComObject.cs +++ b/Src/Microsoft.Dynamic/ComInterop/ComObject.cs @@ -4,6 +4,8 @@ #if FEATURE_COM +#pragma warning disable CA1416 // Validate platform compatibility + using System; using System.Collections.Generic; using System.Diagnostics; diff --git a/Src/Microsoft.Dynamic/ComInterop/ComRuntimeHelpers.cs b/Src/Microsoft.Dynamic/ComInterop/ComRuntimeHelpers.cs index 7611af11..9ac8902a 100644 --- a/Src/Microsoft.Dynamic/ComInterop/ComRuntimeHelpers.cs +++ b/Src/Microsoft.Dynamic/ComInterop/ComRuntimeHelpers.cs @@ -4,6 +4,8 @@ #if FEATURE_COM +#pragma warning disable CA1416 // Validate platform compatibility + using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; diff --git a/Src/Microsoft.Dynamic/ComInterop/ComTypeClassDesc.cs b/Src/Microsoft.Dynamic/ComInterop/ComTypeClassDesc.cs index 8b0aeb95..35c562a9 100644 --- a/Src/Microsoft.Dynamic/ComInterop/ComTypeClassDesc.cs +++ b/Src/Microsoft.Dynamic/ComInterop/ComTypeClassDesc.cs @@ -3,11 +3,14 @@ // See the LICENSE file in the project root for more information. #if FEATURE_COM -using System.Linq.Expressions; + +#pragma warning disable CA1416 // Validate platform compatibility using System; using System.Collections.Generic; using System.Dynamic; +using System.Linq.Expressions; + using ComTypes = System.Runtime.InteropServices.ComTypes; namespace Microsoft.Scripting.ComInterop { diff --git a/Src/Microsoft.Dynamic/ComInterop/ComTypeEnumDesc.cs b/Src/Microsoft.Dynamic/ComInterop/ComTypeEnumDesc.cs index ffd8d13d..0983ae83 100644 --- a/Src/Microsoft.Dynamic/ComInterop/ComTypeEnumDesc.cs +++ b/Src/Microsoft.Dynamic/ComInterop/ComTypeEnumDesc.cs @@ -4,12 +4,14 @@ #if FEATURE_COM -using System.Linq.Expressions; +#pragma warning disable CA1416 // Validate platform compatibility using System; -using System.Runtime.InteropServices; using System.Dynamic; using System.Globalization; +using System.Linq.Expressions; +using System.Runtime.InteropServices; + using ComTypes = System.Runtime.InteropServices.ComTypes; namespace Microsoft.Scripting.ComInterop { diff --git a/Src/Microsoft.Dynamic/ComInterop/DispatchArgBuilder.cs b/Src/Microsoft.Dynamic/ComInterop/DispatchArgBuilder.cs index 00269c1c..d9bebdfb 100644 --- a/Src/Microsoft.Dynamic/ComInterop/DispatchArgBuilder.cs +++ b/Src/Microsoft.Dynamic/ComInterop/DispatchArgBuilder.cs @@ -3,7 +3,9 @@ // See the LICENSE file in the project root for more information. #if FEATURE_COM -#pragma warning disable 612, 618 + +#pragma warning disable CA1416 // Validate platform compatibility +#pragma warning disable CS0618 // Type or member is obsolete using System; using System.Linq.Expressions; diff --git a/Src/Microsoft.Dynamic/ComInterop/IDispatchComObject.cs b/Src/Microsoft.Dynamic/ComInterop/IDispatchComObject.cs index 87650f15..f2d7bada 100644 --- a/Src/Microsoft.Dynamic/ComInterop/IDispatchComObject.cs +++ b/Src/Microsoft.Dynamic/ComInterop/IDispatchComObject.cs @@ -3,22 +3,25 @@ // See the LICENSE file in the project root for more information. #if FEATURE_COM -using System.Linq.Expressions; + +#pragma warning disable CA1416 // Validate platform compatibility using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; +using System.Dynamic; using System.Globalization; +using System.Linq.Expressions; using System.Reflection; using System.Runtime.InteropServices; using System.Security; using System.Security.Permissions; -using ComTypes = System.Runtime.InteropServices.ComTypes; -using System.Dynamic; using Microsoft.Scripting.Utils; +using ComTypes = System.Runtime.InteropServices.ComTypes; + namespace Microsoft.Scripting.ComInterop { /// diff --git a/Src/Microsoft.Dynamic/ComInterop/Variant.cs b/Src/Microsoft.Dynamic/ComInterop/Variant.cs index b69b3f32..cc6a6894 100644 --- a/Src/Microsoft.Dynamic/ComInterop/Variant.cs +++ b/Src/Microsoft.Dynamic/ComInterop/Variant.cs @@ -3,19 +3,21 @@ // See the LICENSE file in the project root for more information. #if FEATURE_COM -#pragma warning disable 618 + +#pragma warning disable CA1416 // Validate platform compatibility using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; +using System.Reflection; +using System.Reflection.Emit; using System.Runtime.InteropServices; using System.Security; using System.Security.Permissions; -using Microsoft.Scripting.Utils; -using System.Reflection; + using Microsoft.Scripting.Generation; -using System.Reflection.Emit; +using Microsoft.Scripting.Utils; namespace Microsoft.Scripting.ComInterop { @@ -895,7 +897,9 @@ unsafe internal void CopyFromIndirect(object value) { break; case VarEnum.VT_ERROR: +#pragma warning disable CS0618 // Type or member is obsolete *(int*)_typeUnion._unionTypes._byref = ((ErrorWrapper)value).ErrorCode; +#pragma warning restore CS0618 // Type or member is obsolete break; case VarEnum.VT_I8: diff --git a/Src/Microsoft.Dynamic/Hosting/Shell/BasicConsole.cs b/Src/Microsoft.Dynamic/Hosting/Shell/BasicConsole.cs index 8b92f58d..4e6587bf 100644 --- a/Src/Microsoft.Dynamic/Hosting/Shell/BasicConsole.cs +++ b/Src/Microsoft.Dynamic/Hosting/Shell/BasicConsole.cs @@ -54,7 +54,9 @@ public BasicConsole(bool colorful) { if (e.SpecialKey == ConsoleSpecialKey.ControlC) { e.Cancel = true; CtrlCEvent.Set(); +#pragma warning disable SYSLIB0006 // Type or member is obsolete CreatingThread.Abort(new KeyboardInterruptException("")); +#pragma warning restore SYSLIB0006 // Type or member is obsolete } }; diff --git a/Src/Microsoft.Dynamic/Hosting/Shell/CommandLine.cs b/Src/Microsoft.Dynamic/Hosting/Shell/CommandLine.cs index e9c9e8f9..6596edbd 100644 --- a/Src/Microsoft.Dynamic/Hosting/Shell/CommandLine.cs +++ b/Src/Microsoft.Dynamic/Hosting/Shell/CommandLine.cs @@ -102,7 +102,9 @@ public void Run(ScriptEngine engine, IConsole console, ConsoleOptions options) { #if FEATURE_EXCEPTION_STATE } catch (System.Threading.ThreadAbortException tae) { if (tae.ExceptionState is KeyboardInterruptException) { +#pragma warning disable SYSLIB0006 // Type or member is obsolete Thread.ResetAbort(); +#pragma warning restore SYSLIB0006 // Type or member is obsolete _exitCode = -1; } else { throw; @@ -282,7 +284,9 @@ protected virtual void UnhandledException(Exception e) { } catch (ThreadAbortException tae) { if (tae.ExceptionState is KeyboardInterruptException pki) { UnhandledException(tae); +#pragma warning disable SYSLIB0006 // Type or member is obsolete Thread.ResetAbort(); +#pragma warning restore SYSLIB0006 // Type or member is obsolete } else { throw; } diff --git a/Src/Microsoft.Dynamic/Hosting/Shell/ConsoleHost.cs b/Src/Microsoft.Dynamic/Hosting/Shell/ConsoleHost.cs index 64d66f6c..78992ba7 100644 --- a/Src/Microsoft.Dynamic/Hosting/Shell/ConsoleHost.cs +++ b/Src/Microsoft.Dynamic/Hosting/Shell/ConsoleHost.cs @@ -288,7 +288,9 @@ private void Execute() { #if FEATURE_APARTMENTSTATE if (_consoleOptions.IsMta) { Thread thread = new Thread(ExecuteInternal); +#pragma warning disable CA1416 // Validate platform compatibility thread.SetApartmentState(ApartmentState.MTA); +#pragma warning restore CA1416 // Validate platform compatibility thread.Start(); thread.Join(); return; diff --git a/Src/Microsoft.Dynamic/Interpreter/Interpreter.cs b/Src/Microsoft.Dynamic/Interpreter/Interpreter.cs index 423eee2c..9da6d7bf 100644 --- a/Src/Microsoft.Dynamic/Interpreter/Interpreter.cs +++ b/Src/Microsoft.Dynamic/Interpreter/Interpreter.cs @@ -178,12 +178,14 @@ internal static void AbortThreadIfRequested(InterpretedFrame frame, int targetLa if ((currentThread.ThreadState & System.Threading.ThreadState.AbortRequested) != 0) { Debug.Assert(_anyAbortException != null); +#pragma warning disable SYSLIB0006 // Type or member is obsolete #if FEATURE_EXCEPTION_STATE // The current abort reason needs to be preserved. currentThread.Abort(_anyAbortException.ExceptionState); #else currentThread.Abort(); #endif +#pragma warning restore SYSLIB0006 // Type or member is obsolete } } } diff --git a/Src/Microsoft.Dynamic/Microsoft.Dynamic.csproj b/Src/Microsoft.Dynamic/Microsoft.Dynamic.csproj index 58b376d5..d1e2fc25 100644 --- a/Src/Microsoft.Dynamic/Microsoft.Dynamic.csproj +++ b/Src/Microsoft.Dynamic/Microsoft.Dynamic.csproj @@ -1,7 +1,7 @@  - net452;netstandard2.0;netcoreapp3.1 + net452;netstandard2.0;netcoreapp3.1;net6.0 Microsoft.Scripting 859832320 true diff --git a/Src/Microsoft.Scripting/Microsoft.Scripting.csproj b/Src/Microsoft.Scripting/Microsoft.Scripting.csproj index d7fd3c77..3604afae 100644 --- a/Src/Microsoft.Scripting/Microsoft.Scripting.csproj +++ b/Src/Microsoft.Scripting/Microsoft.Scripting.csproj @@ -1,7 +1,7 @@  - net452;netstandard2.0;netcoreapp3.1 + net452;netstandard2.0;netcoreapp3.1;net6.0 857735168 true @@ -10,15 +10,26 @@ - + + + all + + + + + + all - - + + + all + + From 0478af9e132254621dc63bec75e677a1212d3fed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lozier?= Date: Mon, 3 Oct 2022 20:39:36 -0400 Subject: [PATCH 2/3] Update NuGet packages --- Src/Microsoft.Dynamic/Microsoft.Dynamic.csproj | 2 +- .../Microsoft.Scripting.Metadata.csproj | 2 +- Src/Microsoft.Scripting/Microsoft.Scripting.csproj | 2 +- Tests/Metadata/Metadata.csproj | 6 +++--- Tests/Microsoft.Dynamic.Test/Microsoft.Dynamic.Test.csproj | 6 +++--- .../Microsoft.Scripting.Test.csproj | 6 +++--- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Src/Microsoft.Dynamic/Microsoft.Dynamic.csproj b/Src/Microsoft.Dynamic/Microsoft.Dynamic.csproj index d1e2fc25..b43afc1b 100644 --- a/Src/Microsoft.Dynamic/Microsoft.Dynamic.csproj +++ b/Src/Microsoft.Dynamic/Microsoft.Dynamic.csproj @@ -25,7 +25,7 @@ - + diff --git a/Src/Microsoft.Scripting.Metadata/Microsoft.Scripting.Metadata.csproj b/Src/Microsoft.Scripting.Metadata/Microsoft.Scripting.Metadata.csproj index 6eb3593e..7f8aa3cb 100644 --- a/Src/Microsoft.Scripting.Metadata/Microsoft.Scripting.Metadata.csproj +++ b/Src/Microsoft.Scripting.Metadata/Microsoft.Scripting.Metadata.csproj @@ -13,7 +13,7 @@ - + diff --git a/Src/Microsoft.Scripting/Microsoft.Scripting.csproj b/Src/Microsoft.Scripting/Microsoft.Scripting.csproj index 3604afae..69a990c1 100644 --- a/Src/Microsoft.Scripting/Microsoft.Scripting.csproj +++ b/Src/Microsoft.Scripting/Microsoft.Scripting.csproj @@ -33,7 +33,7 @@ - + diff --git a/Tests/Metadata/Metadata.csproj b/Tests/Metadata/Metadata.csproj index 4e8c9d08..2291ace4 100644 --- a/Tests/Metadata/Metadata.csproj +++ b/Tests/Metadata/Metadata.csproj @@ -16,9 +16,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/Microsoft.Dynamic.Test/Microsoft.Dynamic.Test.csproj b/Tests/Microsoft.Dynamic.Test/Microsoft.Dynamic.Test.csproj index 7cab1c4d..16c12eee 100644 --- a/Tests/Microsoft.Dynamic.Test/Microsoft.Dynamic.Test.csproj +++ b/Tests/Microsoft.Dynamic.Test/Microsoft.Dynamic.Test.csproj @@ -7,9 +7,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/Microsoft.Scripting.Test/Microsoft.Scripting.Test.csproj b/Tests/Microsoft.Scripting.Test/Microsoft.Scripting.Test.csproj index 9079ed8e..eecd6254 100644 --- a/Tests/Microsoft.Scripting.Test/Microsoft.Scripting.Test.csproj +++ b/Tests/Microsoft.Scripting.Test/Microsoft.Scripting.Test.csproj @@ -7,9 +7,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive From c05f714d00026b4921dc4e3872ee3444a0b636c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lozier?= Date: Mon, 3 Oct 2022 20:45:19 -0400 Subject: [PATCH 3/3] Add missing file --- Build/net6.0.props | 51 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Build/net6.0.props diff --git a/Build/net6.0.props b/Build/net6.0.props new file mode 100644 index 00000000..e76840d3 --- /dev/null +++ b/Build/net6.0.props @@ -0,0 +1,51 @@ + + + + false + + + + $(Features);FEATURE_APARTMENTSTATE + $(Features);FEATURE_APPLICATIONEXCEPTION + $(Features);FEATURE_ASSEMBLY_CODEBASE + $(Features);FEATURE_ASSEMBLY_GETFORWARDEDTYPES + $(Features);FEATURE_ASSEMBLY_LOCATION + $(Features);FEATURE_ASSEMBLY_RESOLVE + $(Features);FEATURE_ASSEMBLYBUILDER_DEFINEDYNAMICASSEMBLY + $(Features);FEATURE_BASIC_CONSOLE + $(Features);FEATURE_CODEDOM + $(Features);FEATURE_COM + $(Features);FEATURE_CONFIGURATION + $(Features);FEATURE_CUSTOM_TYPE_DESCRIPTOR + $(Features);FEATURE_DBNULL + $(Features);FEATURE_DRIVENOTFOUNDEXCEPTION + $(Features);FEATURE_DYNAMIC_EXPRESSION_VISITOR + $(Features);FEATURE_EXCEPTION_STATE + $(Features);FEATURE_FILESYSTEM + $(Features);FEATURE_FULL_CONSOLE + $(Features);FEATURE_FULL_CRYPTO + $(Features);FEATURE_FULL_NET + $(Features);FEATURE_ICLONEABLE + $(Features);FEATURE_LCG + $(Features);FEATURE_LOADWITHPARTIALNAME + $(Features);FEATURE_METADATA_READER + $(Features);FEATURE_MMAP + $(Features);FEATURE_NATIVE + $(Features);FEATURE_OS_SERVICEPACK + $(Features);FEATURE_PIPES + $(Features);FEATURE_PROCESS + $(Features);FEATURE_REFEMIT + $(Features);FEATURE_REGISTRY + $(Features);FEATURE_SECURITY_RULES + $(Features);FEATURE_SERIALIZATION + $(Features);FEATURE_SORTKEY + $(Features);FEATURE_STACK_TRACE + $(Features);FEATURE_SYNC_SOCKETS + $(Features);FEATURE_THREAD + $(Features);FEATURE_TYPE_EQUIVALENCE + $(Features);FEATURE_TYPECONVERTER + $(Features);FEATURE_WARNING_EXCEPTION + $(Features);FEATURE_WIN32EXCEPTION + $(Features);FEATURE_XMLDOC + +