Updated missed ifdefs in netstandard conversion

This commit is contained in:
Pranav K 2016-03-01 16:03:05 -08:00
parent 33d1aea8ea
commit e9b766fe80
7 changed files with 15 additions and 12 deletions

View File

@ -4,7 +4,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
#if DOTNET5_4
#if NETSTANDARD1_3
using System.Reflection;
#endif
using System.Threading.Tasks;

View File

@ -4,7 +4,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
#if DOTNET5_4
#if NETSTANDARD1_3
using System.Reflection;
#endif
using Microsoft.AspNetCore.Mvc.Core;

View File

@ -3,7 +3,7 @@
using System;
using System.Collections.ObjectModel;
#if DOTNET5_4
#if NETSTANDARD1_3
using System.Reflection;
#endif
using Microsoft.AspNetCore.Mvc.Core;

View File

@ -4,7 +4,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
#if DOTNET5_4
#if NETSTANDARD1_3
using System.Reflection;
#endif
using System.Threading.Tasks;

View File

@ -9,7 +9,7 @@ using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.PortableExecutable;
#if DOTNET5_6
#if NETSTANDARD1_5
using System.Runtime.Loader;
#endif
using System.Text;
@ -36,7 +36,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Internal
private readonly ILibraryExporter _libraryExporter;
private readonly RazorViewEngineOptions _options;
private readonly Lazy<List<MetadataReference>> _applicationReferences;
#if DOTNET5_6
#if NETSTANDARD1_5
private readonly RazorLoadContext _razorLoadContext;
#endif
@ -58,7 +58,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Internal
_options = optionsAccessor.Value;
_applicationReferences = new Lazy<List<MetadataReference>>(GetApplicationReferences);
#if DOTNET5_6
#if NETSTANDARD1_5
_razorLoadContext = new RazorLoadContext();
#endif
}
@ -149,7 +149,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Internal
private Assembly LoadStream(MemoryStream ms, MemoryStream assemblySymbols)
{
#if DOTNET5_6
#if NETSTANDARD1_5
return _razorLoadContext.Load(ms, assemblySymbols);
#else
return Assembly.Load(ms.ToArray(), assemblySymbols?.ToArray());
@ -244,7 +244,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Internal
return metadata.GetReference(filePath: path);
}
#if DOTNET5_6
#if NETSTANDARD1_5
private class RazorLoadContext : AssemblyLoadContext
{
protected override Assembly Load(AssemblyName assemblyName)

View File

@ -20,8 +20,11 @@
},
"frameworks": {
"net451": {},
"dotnet5.6": {
"imports": "portable-net451+win8"
"netstandard1.5": {
"imports": [
"portable-net451+win8",
"dotnet5.6"
]
}
}
}

View File

@ -5,7 +5,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
#if DOTNET5_6
#if NETSTANDARD1_5
using System.Reflection;
#endif
using Microsoft.AspNetCore.Mvc.ModelBinding;