Skip to content

Commit 1972d82

Browse files
committed
Add .NET 8 target
1 parent 25a7308 commit 1972d82

34 files changed

+152
-80
lines changed

.editorconfig

+7-2
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ dotnet_diagnostic.CA1305.severity = none # CA1305: Specify IFormatProvide
5757
dotnet_diagnostic.CA1307.severity = suggestion # CA1307: Specify StringComparison for clarity
5858
dotnet_diagnostic.CA1309.severity = suggestion # CA1309: Use ordinal string comparison
5959
dotnet_diagnostic.CA1310.severity = warning # CA1310: Specify StringComparison for correctness
60+
dotnet_diagnostic.CA1510.severity = none # CA1510: Use ArgumentNullException throw helper
61+
dotnet_diagnostic.CA1512.severity = none # CA1512: Use ArgumentOutOfRangeException throw helper
62+
dotnet_diagnostic.CA1513.severity = none # CA1513: Use ObjectDisposedException throw helper
6063
dotnet_diagnostic.CA1707.severity = none # CA1707: Identifiers should not contain underscores
6164
dotnet_diagnostic.CA1708.severity = none # CA1708: Identifiers should differ by more than case
6265
dotnet_diagnostic.CA1710.severity = none # CA1710: Identifiers should have correct suffix
@@ -70,7 +73,6 @@ dotnet_diagnostic.CA1805.severity = suggestion # CA1805: Do not initialize unne
7073
dotnet_diagnostic.CA1806.severity = none # CA1806: Do not ignore method results
7174
dotnet_diagnostic.CA1816.severity = suggestion # CA1816: Dispose methods should call SuppressFinalize
7275
dotnet_diagnostic.CA1822.severity = none # CA1822: Mark members as static
73-
dotnet_diagnostic.CA1825.severity = none # CA1825: Avoid zero-length array allocations
7476
dotnet_diagnostic.CA1830.severity = suggestion # CA1830: Prefer strongly-typed Append and Insert method overloads on StringBuilder
7577
dotnet_diagnostic.CA1834.severity = suggestion # CA1834: Consider using 'StringBuilder.Append(char)' when applicable
7678
dotnet_diagnostic.CA1837.severity = suggestion # CA1837: Use 'Environment.ProcessId'
@@ -79,9 +81,9 @@ dotnet_diagnostic.CA1845.severity = none # CA1845: Use span-based 'string
7981
dotnet_diagnostic.CA1846.severity = none # CA1846: Prefer 'AsSpan' over 'Substring'
8082
dotnet_diagnostic.CA1847.severity = none # CA1847: Use char literal for a single character lookup
8183
dotnet_diagnostic.CA1852.severity = suggestion # CA1852: Seal internal types
82-
dotnet_diagnostic.CA1854.severity = suggestion # CA1854: Prefer the 'IDictionary.TryGetValue(TKey, out TValue)' method
8384
dotnet_diagnostic.CA1859.severity = suggestion # CA1859: Use concrete types when possible for improved performance
8485
dotnet_diagnostic.CA1861.severity = suggestion # CA1861: Avoid constant arrays as arguments
86+
dotnet_diagnostic.CA1863.severity = none # CA1863: Use 'CompositeFormat'
8587
dotnet_diagnostic.CA2101.severity = suggestion # CA2101: Specify marshaling for P/Invoke string arguments
8688
dotnet_diagnostic.CA2201.severity = none # CA2201: Do not raise reserved exception types
8789
dotnet_diagnostic.CA2208.severity = suggestion # CA2208: Instantiate argument exceptions correctly
@@ -94,3 +96,6 @@ dotnet_diagnostic.CA5350.severity = suggestion # CA5350: Do Not Use Weak Crypto
9496
dotnet_diagnostic.CA5351.severity = suggestion # CA5351: Do Not Use Broken Cryptographic Algorithms
9597
dotnet_diagnostic.CA5359.severity = suggestion # CA5359: Do Not Disable Certificate Validation
9698
dotnet_diagnostic.CA5372.severity = suggestion # CA5372: Use XmlReader For XPathDocument
99+
100+
dotnet_diagnostic.SYSLIB1045.severity = suggestion # SYSLIB1045: Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time
101+
dotnet_diagnostic.SYSLIB1054.severity = suggestion # SYSLIB1054: Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time

.github/workflows/main.yml

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ jobs:
2626
uses: actions/setup-dotnet@v1
2727
with:
2828
dotnet-version: '8.0.x'
29-
include-prerelease: true
3029
- name: Build
3130
run: pwsh make.ps1
3231
- name: Package

Build.proj

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
Outputs="$(PackageDir)\DynamicLanguageRuntime.$(PackageVersion).zip">
109109
<ItemGroup>
110110
<ZipFiles Include="$(StageDir)\**\*.dll;$(StageDir)\**\*.xml;$(StageDir)\README.md;$(StageDir)\LICENSE"
111-
Exclude="$(StageDir)\netcoreapp3.1\*;$(StageDir)\net7.0*\*;$(StageDir)\net8.0*\*" />
111+
Exclude="$(StageDir)\netcoreapp3.1\*;$(StageDir)\net7.0*\*;$(StageDir)\net8.0*\*;$(StageDir)\net9.0*\*" />
112112
</ItemGroup>
113113
<Message Text="$(ZipFiles)" />
114114
<Zip Files="@(ZipFiles)" ZipFileName="$(PackageDir)\DynamicLanguageRuntime.$(PackageVersion).zip" WorkingDirectory="$(StageDir)"/>

Build/net8.0.props

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<IsFullFramework>false</IsFullFramework>
5+
</PropertyGroup>
6+
7+
<PropertyGroup>
8+
<Features>$(Features);FEATURE_APARTMENTSTATE</Features>
9+
<Features>$(Features);FEATURE_ASSEMBLY_GETFORWARDEDTYPES</Features>
10+
<Features>$(Features);FEATURE_ASSEMBLY_RESOLVE</Features>
11+
<Features>$(Features);FEATURE_ASSEMBLYBUILDER_DEFINEDYNAMICASSEMBLY</Features>
12+
<Features>$(Features);FEATURE_CODEDOM</Features>
13+
<Features>$(Features);FEATURE_COM</Features>
14+
<Features>$(Features);FEATURE_CONFIGURATION</Features>
15+
<Features>$(Features);FEATURE_CUSTOM_TYPE_DESCRIPTOR</Features>
16+
<Features>$(Features);FEATURE_EXCEPTION_STATE</Features>
17+
<Features>$(Features);FEATURE_FILESYSTEM</Features>
18+
<Features>$(Features);FEATURE_FULL_CRYPTO</Features>
19+
<Features>$(Features);FEATURE_FULL_NET</Features>
20+
<Features>$(Features);FEATURE_LCG</Features>
21+
<Features>$(Features);FEATURE_LOADWITHPARTIALNAME</Features>
22+
<Features>$(Features);FEATURE_METADATA_READER</Features>
23+
<Features>$(Features);FEATURE_MMAP</Features>
24+
<Features>$(Features);FEATURE_NATIVE</Features>
25+
<Features>$(Features);FEATURE_PIPES</Features>
26+
<Features>$(Features);FEATURE_PROCESS</Features>
27+
<Features>$(Features);FEATURE_REFEMIT</Features>
28+
<Features>$(Features);FEATURE_REGISTRY</Features>
29+
<Features>$(Features);FEATURE_SECURITY_RULES</Features>
30+
<Features>$(Features);FEATURE_STACK_TRACE</Features>
31+
<Features>$(Features);FEATURE_SYNC_SOCKETS</Features>
32+
<Features>$(Features);FEATURE_THREAD</Features>
33+
<Features>$(Features);FEATURE_TYPE_EQUIVALENCE</Features>
34+
<Features>$(Features);FEATURE_TYPECONVERTER</Features>
35+
<Features>$(Features);FEATURE_XMLDOC</Features>
36+
</PropertyGroup>
37+
</Project>

Dlr.sln

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{60056F49
3737
Build\After.targets = Build\After.targets
3838
Build\net462.props = Build\net462.props
3939
Build\net6.0.props = Build\net6.0.props
40+
Build\net8.0.props = Build\net8.0.props
4041
Build\netstandard2.0.props = Build\netstandard2.0.props
4142
Build\steps.yml = Build\steps.yml
4243
EndProjectSection

Package/nuget/DynamicLanguageRuntime.nuspec

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
<group targetFramework="net6.0">
2727
<dependency id="System.CodeDom" version="6.0.0" />
2828
</group>
29+
<group targetFramework="net8.0">
30+
<dependency id="System.CodeDom" version="8.0.0" />
31+
</group>
2932
</dependencies>
3033
</metadata>
3134
<files>

Src/Microsoft.Dynamic/Actions/Calls/ArgumentBinding.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace Microsoft.Scripting.Actions.Calls {
88
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes")] // TODO
99
public struct ArgumentBinding {
10-
private static readonly int[] _EmptyBinding = new int[0];
10+
private static readonly int[] _EmptyBinding = System.Array.Empty<int>();
1111

1212
private readonly int _positionalArgCount;
1313
private readonly int[] _binding; // immutable

Src/Microsoft.Dynamic/Actions/MemberTracker.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace Microsoft.Scripting.Actions {
2424
/// </summary>
2525
public abstract class MemberTracker {
2626
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly")]
27-
public static readonly MemberTracker[] EmptyTrackers = new MemberTracker[0];
27+
public static readonly MemberTracker[] EmptyTrackers = Array.Empty<MemberTracker>();
2828

2929
private static readonly Dictionary<MemberKey, MemberTracker> _trackers = new Dictionary<MemberKey, MemberTracker>();
3030

Src/Microsoft.Dynamic/Actions/NamespaceTracker.cs

+10-12
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ internal NamespaceTracker GetOrMakeChildPackage(string childName, Assembly assem
5454

5555
if (_dict.TryGetValue(childName, out MemberTracker ret)) {
5656
// If we have a module, then we add the assembly to the InnerModule
57-
// If it's not a module, we'll wipe it out below, eg "def System(): pass" then
57+
// If it's not a module, we'll wipe it out below, eg "def System(): pass" then
5858
// "import System" will result in the namespace being visible.
5959
if (ret is NamespaceTracker package) {
6060
if (!package._packageAssemblies.Contains(assem)) {
@@ -102,10 +102,11 @@ internal void AddTypeName(string typeName, Assembly assem) {
102102
Assert.NotNull(typeName, assem);
103103
Debug.Assert(typeName.IndexOf('.') == -1); // This is the simple name, not the full name
104104

105-
if (!_typeNames.ContainsKey(assem)) {
106-
_typeNames[assem] = new TypeNames(assem, _fullName);
105+
if (!_typeNames.TryGetValue(assem, out TypeNames typeNames)) {
106+
typeNames = new TypeNames(assem, _fullName);
107+
_typeNames[assem] = typeNames;
107108
}
108-
_typeNames[assem].AddTypeName(typeName);
109+
typeNames.AddTypeName(typeName);
109110

110111
string normalizedTypeName = ReflectionUtils.GetNormalizedTypeName(typeName);
111112
if (_dict.ContainsKey(normalizedTypeName)) {
@@ -194,9 +195,9 @@ private NamespaceTracker GetOrMakePackageHierarchy(Assembly assem, string fullNa
194195
}
195196
/// <summary>
196197
/// As a fallback, so if the type does exist in any assembly. This would happen if a new type was added
197-
/// that was not in the hardcoded list of types.
198+
/// that was not in the hardcoded list of types.
198199
/// This code is not accurate because:
199-
/// 1. We dont deal with generic types (TypeCollision).
200+
/// 1. We dont deal with generic types (TypeCollision).
200201
/// 2. Previous calls to GetCustomMemberNames (eg. "from foo import *" in Python) would not have included this type.
201202
/// 3. This does not deal with new namespaces added to the assembly
202203
/// </summary>
@@ -215,7 +216,7 @@ private MemberTracker CheckForUnlistedType(string nameString) {
215216
continue;
216217
}
217218

218-
// We dont use TypeCollision.UpdateTypeEntity here because we do not handle generic type names
219+
// We dont use TypeCollision.UpdateTypeEntity here because we do not handle generic type names
219220
return TypeTracker.GetTypeTracker(type);
220221
}
221222

@@ -309,7 +310,7 @@ private IList AddKeys(IList res) {
309310
}
310311
}
311312
}
312-
313+
313314
return res;
314315
}
315316

@@ -405,10 +406,7 @@ internal void AddTypeName(string typeName) {
405406
if (normalizedName == typeName) {
406407
_simpleTypeNames.Add(typeName);
407408
} else {
408-
List<string> actualNames;
409-
if (_genericTypeNames.ContainsKey(normalizedName)) {
410-
actualNames = _genericTypeNames[normalizedName];
411-
} else {
409+
if (!_genericTypeNames.TryGetValue(normalizedName, out List<string> actualNames)) {
412410
actualNames = new List<string>();
413411
_genericTypeNames[normalizedName] = actualNames;
414412
}

Src/Microsoft.Dynamic/ComInterop/ComInterop.cs

+4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ internal interface IDispatchForReflection {
2525
InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
2626
Guid("00020400-0000-0000-C000-000000000046"),
2727
]
28+
#pragma warning disable SYSLIB1096 // Convert to 'GeneratedComInterface'
2829
internal interface IDispatch {
30+
#pragma warning restore SYSLIB1096 // Convert to 'GeneratedComInterface'
2931

3032
[PreserveSig]
3133
int TryGetTypeInfoCount(out uint pctinfo);
@@ -75,7 +77,9 @@ internal enum IDispatchMethodIndices {
7577
InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
7678
Guid("B196B283-BAB4-101A-B69C-00AA00341D07")
7779
]
80+
#pragma warning disable SYSLIB1096 // Convert to 'GeneratedComInterface'
7881
internal interface IProvideClassInfo {
82+
#pragma warning restore SYSLIB1096 // Convert to 'GeneratedComInterface'
7983
void GetClassInfo(out IntPtr info);
8084
}
8185

Src/Microsoft.Dynamic/ComInterop/ComParamDesc.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ internal ComParamDesc(ref ELEMDESC elemDesc, string name) {
6060
break;
6161
}
6262

63-
TYPEDESC childTypeDesc = (TYPEDESC)Marshal.PtrToStructure(typeDesc.lpValue, typeof(TYPEDESC));
63+
TYPEDESC childTypeDesc = Marshal.PtrToStructure<TYPEDESC>(typeDesc.lpValue);
6464
_vt = (VarEnum)childTypeDesc.vt;
6565
typeDesc = childTypeDesc;
6666
}

Src/Microsoft.Dynamic/ComInterop/ComRuntimeHelpers.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ internal static ComTypes.TYPEATTR GetTypeAttrForTypeInfo(ComTypes.ITypeInfo type
186186
}
187187

188188
try {
189-
return (ComTypes.TYPEATTR)Marshal.PtrToStructure(pAttrs, typeof(ComTypes.TYPEATTR));
189+
return Marshal.PtrToStructure<ComTypes.TYPEATTR>(pAttrs);
190190
} finally {
191191
typeInfo.ReleaseTypeAttr(pAttrs);
192192
}
@@ -203,7 +203,7 @@ internal static ComTypes.TYPELIBATTR GetTypeAttrForTypeLib(ComTypes.ITypeLib typ
203203
}
204204

205205
try {
206-
return (ComTypes.TYPELIBATTR)Marshal.PtrToStructure(pAttrs, typeof(ComTypes.TYPELIBATTR));
206+
return Marshal.PtrToStructure<ComTypes.TYPELIBATTR>(pAttrs);
207207
} finally {
208208
typeLib.ReleaseTLibAttr(pAttrs);
209209
}
@@ -541,7 +541,7 @@ private static IUnknownReleaseDelegate Create_IUnknownRelease() {
541541
method.Emit(OpCodes.Ldarg_0);
542542

543543
// functionPtr = *(IntPtr*)(*(interfacePointer) + VTABLE_OFFSET)
544-
int iunknownReleaseOffset = ((int)IDispatchMethodIndices.IUnknown_Release) * Marshal.SizeOf(typeof(IntPtr));
544+
int iunknownReleaseOffset = ((int)IDispatchMethodIndices.IUnknown_Release) * Marshal.SizeOf<IntPtr>();
545545
method.Emit(OpCodes.Ldarg_0);
546546
method.Emit(OpCodes.Ldind_I);
547547
method.Emit(OpCodes.Ldc_I4, iunknownReleaseOffset);
@@ -653,7 +653,7 @@ private static IDispatchInvokeDelegate Create_IDispatchInvoke(bool returnResult)
653653
EmitLoadArg(method, argErrIndex);
654654

655655
// functionPtr = *(IntPtr*)(*(dispatchPointer) + VTABLE_OFFSET)
656-
int idispatchInvokeOffset = ((int)IDispatchMethodIndices.IDispatch_Invoke) * Marshal.SizeOf(typeof(IntPtr));
656+
int idispatchInvokeOffset = ((int)IDispatchMethodIndices.IDispatch_Invoke) * Marshal.SizeOf<IntPtr>();
657657
EmitLoadArg(method, dispatchPointerIndex);
658658
method.Emit(OpCodes.Ldind_I);
659659
method.Emit(OpCodes.Ldc_I4, idispatchInvokeOffset);

Src/Microsoft.Dynamic/ComInterop/ComTypeEnumDesc.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ internal ComTypeEnumDesc(ComTypes.ITypeInfo typeInfo, ComTypeLibDesc typeLibDesc
4040
ComTypes.VARDESC varDesc;
4141

4242
try {
43-
varDesc = (ComTypes.VARDESC)Marshal.PtrToStructure(p, typeof(ComTypes.VARDESC));
43+
varDesc = Marshal.PtrToStructure<ComTypes.VARDESC>(p);
4444

4545
if (varDesc.varkind == ComTypes.VARKIND.VAR_CONST) {
4646
memberValues[i] = Marshal.GetObjectForNativeVariant(varDesc.desc.lpvarValue);

Src/Microsoft.Dynamic/ComInterop/ExcepInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ internal struct ExcepInfo {
3131
#if DEBUG
3232
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2207:InitializeValueTypeStaticFieldsInline")]
3333
static ExcepInfo() {
34-
Debug.Assert(Marshal.SizeOf(typeof(ExcepInfo)) == Marshal.SizeOf(typeof(ComTypes.EXCEPINFO)));
34+
Debug.Assert(Marshal.SizeOf<ExcepInfo>() == Marshal.SizeOf<ComTypes.EXCEPINFO>());
3535
}
3636
#endif
3737

@@ -99,4 +99,4 @@ internal Exception GetException() {
9999
}
100100
}
101101

102-
#endif
102+
#endif

Src/Microsoft.Dynamic/ComInterop/IDispatchComObject.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ private static void GetFuncDescForDescIndex(ComTypes.ITypeInfo typeInfo, int fun
335335
throw Error.CannotRetrieveTypeInformation();
336336
}
337337

338-
funcDesc = (ComTypes.FUNCDESC)Marshal.PtrToStructure(pFuncDesc, typeof(ComTypes.FUNCDESC));
338+
funcDesc = Marshal.PtrToStructure<ComTypes.FUNCDESC>(pFuncDesc);
339339
funcDescHandle = pFuncDesc;
340340
}
341341

Src/Microsoft.Dynamic/ComInterop/Variant.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ internal struct Variant {
3434
static Variant() {
3535
// Variant size is the size of 4 pointers (16 bytes) on a 32-bit processor,
3636
// and 3 pointers (24 bytes) on a 64-bit processor.
37-
int intPtrSize = Marshal.SizeOf(typeof(IntPtr));
38-
int variantSize = Marshal.SizeOf(typeof(Variant));
37+
int intPtrSize = Marshal.SizeOf<IntPtr>();
38+
int variantSize = Marshal.SizeOf<Variant>();
3939
if (intPtrSize == 4) {
4040
Debug.Assert(variantSize == (4 * intPtrSize));
4141
} else {

Src/Microsoft.Dynamic/Debugging/ThreadLocal.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace Microsoft.Scripting.Debugging {
1111
internal class ThreadLocal<T> {
1212
private StorageInfo[] _stores; // array of storage indexed by managed thread ID
13-
private static readonly StorageInfo[] Updating = new StorageInfo[0]; // a marker used when updating the array
13+
private static readonly StorageInfo[] Updating = Array.Empty<StorageInfo>(); // a marker used when updating the array
1414

1515
internal T Value {
1616
get {

Src/Microsoft.Dynamic/Hosting/Shell/ConsoleHostOptionsParser.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ private void ParseOption(string arg, out string name, out string value) {
110110
}
111111

112112
if (name.StartsWith("--", StringComparison.Ordinal)) name = name.Substring("--".Length);
113-
else if (name.StartsWith("-", StringComparison.Ordinal) && name.Length > 1) name = name.Substring("-".Length);
114-
else if (name.StartsWith("/", StringComparison.Ordinal) && name.Length > 1) name = name.Substring("/".Length);
113+
else if (name.StartsWith('-') && name.Length > 1) name = name.Substring("-".Length);
114+
else if (name.StartsWith('/') && name.Length > 1) name = name.Substring("/".Length);
115115
else {
116116
value = name;
117117
name = null;

Src/Microsoft.Dynamic/Interpreter/LightCompiler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public sealed class LightCompiler {
164164

165165
private readonly LightCompiler _parent;
166166

167-
private static readonly LocalDefinition[] EmptyLocals = new LocalDefinition[0];
167+
private static readonly LocalDefinition[] EmptyLocals = Array.Empty<LocalDefinition>();
168168

169169
internal LightCompiler(int compilationThreshold) {
170170
Instructions = new InstructionList();

Src/Microsoft.Dynamic/Microsoft.Dynamic.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net462;netstandard2.0;net6.0</TargetFrameworks>
4+
<TargetFrameworks>net462;netstandard2.0;net6.0;net8.0</TargetFrameworks>
55
<RootNamespace>Microsoft.Scripting</RootNamespace>
66
<BaseAddress>859832320</BaseAddress>
77
<GenerateDocumentationFile>true</GenerateDocumentationFile>

Src/Microsoft.Dynamic/Runtime/SavableScriptCode.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public static ScriptCode[] LoadFromAssembly(ScriptDomainManager runtime, Assembl
173173
// get the type which has our cached code...
174174
Type t = assembly.GetType("DLRCachedCode");
175175
if (t == null) {
176-
return new ScriptCode[0];
176+
return Array.Empty<ScriptCode>();
177177
}
178178

179179
List<ScriptCode> codes = new List<ScriptCode>();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the Apache 2.0 license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
#if !FEATURE_SERIALIZATION
6+
7+
using System;
8+
using System.Diagnostics;
9+
10+
namespace Microsoft.Scripting {
11+
[Conditional("STUB")]
12+
internal class SerializableAttribute : Attribute {
13+
}
14+
15+
[Conditional("STUB")]
16+
internal class NonSerializedAttribute : Attribute {
17+
}
18+
19+
namespace Runtime {
20+
internal interface ISerializable {
21+
}
22+
23+
internal interface IDeserializationCallback {
24+
}
25+
}
26+
27+
internal class SerializationException : Exception {
28+
}
29+
}
30+
31+
#endif

0 commit comments

Comments
 (0)