Updated missed ifdefs in netstandard conversion
This commit is contained in:
parent
33d1aea8ea
commit
e9b766fe80
|
|
@ -4,7 +4,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
#if DOTNET5_4
|
#if NETSTANDARD1_3
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
#endif
|
#endif
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
#if DOTNET5_4
|
#if NETSTANDARD1_3
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
#endif
|
#endif
|
||||||
using Microsoft.AspNetCore.Mvc.Core;
|
using Microsoft.AspNetCore.Mvc.Core;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
#if DOTNET5_4
|
#if NETSTANDARD1_3
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
#endif
|
#endif
|
||||||
using Microsoft.AspNetCore.Mvc.Core;
|
using Microsoft.AspNetCore.Mvc.Core;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
#if DOTNET5_4
|
#if NETSTANDARD1_3
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
#endif
|
#endif
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Reflection.PortableExecutable;
|
using System.Reflection.PortableExecutable;
|
||||||
#if DOTNET5_6
|
#if NETSTANDARD1_5
|
||||||
using System.Runtime.Loader;
|
using System.Runtime.Loader;
|
||||||
#endif
|
#endif
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
@ -36,7 +36,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Internal
|
||||||
private readonly ILibraryExporter _libraryExporter;
|
private readonly ILibraryExporter _libraryExporter;
|
||||||
private readonly RazorViewEngineOptions _options;
|
private readonly RazorViewEngineOptions _options;
|
||||||
private readonly Lazy<List<MetadataReference>> _applicationReferences;
|
private readonly Lazy<List<MetadataReference>> _applicationReferences;
|
||||||
#if DOTNET5_6
|
#if NETSTANDARD1_5
|
||||||
private readonly RazorLoadContext _razorLoadContext;
|
private readonly RazorLoadContext _razorLoadContext;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -58,7 +58,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Internal
|
||||||
_options = optionsAccessor.Value;
|
_options = optionsAccessor.Value;
|
||||||
_applicationReferences = new Lazy<List<MetadataReference>>(GetApplicationReferences);
|
_applicationReferences = new Lazy<List<MetadataReference>>(GetApplicationReferences);
|
||||||
|
|
||||||
#if DOTNET5_6
|
#if NETSTANDARD1_5
|
||||||
_razorLoadContext = new RazorLoadContext();
|
_razorLoadContext = new RazorLoadContext();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
@ -149,7 +149,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Internal
|
||||||
|
|
||||||
private Assembly LoadStream(MemoryStream ms, MemoryStream assemblySymbols)
|
private Assembly LoadStream(MemoryStream ms, MemoryStream assemblySymbols)
|
||||||
{
|
{
|
||||||
#if DOTNET5_6
|
#if NETSTANDARD1_5
|
||||||
return _razorLoadContext.Load(ms, assemblySymbols);
|
return _razorLoadContext.Load(ms, assemblySymbols);
|
||||||
#else
|
#else
|
||||||
return Assembly.Load(ms.ToArray(), assemblySymbols?.ToArray());
|
return Assembly.Load(ms.ToArray(), assemblySymbols?.ToArray());
|
||||||
|
|
@ -244,7 +244,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Internal
|
||||||
|
|
||||||
return metadata.GetReference(filePath: path);
|
return metadata.GetReference(filePath: path);
|
||||||
}
|
}
|
||||||
#if DOTNET5_6
|
#if NETSTANDARD1_5
|
||||||
private class RazorLoadContext : AssemblyLoadContext
|
private class RazorLoadContext : AssemblyLoadContext
|
||||||
{
|
{
|
||||||
protected override Assembly Load(AssemblyName assemblyName)
|
protected override Assembly Load(AssemblyName assemblyName)
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,11 @@
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"net451": {},
|
"net451": {},
|
||||||
"dotnet5.6": {
|
"netstandard1.5": {
|
||||||
"imports": "portable-net451+win8"
|
"imports": [
|
||||||
|
"portable-net451+win8",
|
||||||
|
"dotnet5.6"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5,7 +5,7 @@ using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
#if DOTNET5_6
|
#if NETSTANDARD1_5
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
#endif
|
#endif
|
||||||
using Microsoft.AspNetCore.Mvc.ModelBinding;
|
using Microsoft.AspNetCore.Mvc.ModelBinding;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue