Merge pull request #376 from aspnet/rel/2.0.0-preview1
Change TFM to netcoreapp2.0
This commit is contained in:
commit
cce449d6df
|
|
@ -2,7 +2,7 @@
|
|||
<PropertyGroup>
|
||||
<AspNetCoreVersion>2.0.0-*</AspNetCoreVersion>
|
||||
<CoreFxVersion>4.3.0</CoreFxVersion>
|
||||
<InternalAspNetCoreSdkVersion>2.0.0-*</InternalAspNetCoreSdkVersion>
|
||||
<InternalAspNetCoreSdkVersion>2.1.0-*</InternalAspNetCoreSdkVersion>
|
||||
<MoqVersion>4.7.1</MoqVersion>
|
||||
<NETStandardImplicitPackageVersion>$(BundledNETStandardPackageVersion)</NETStandardImplicitPackageVersion>
|
||||
<TestSdkVersion>15.0.0</TestSdkVersion>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<Import Project="..\..\build\dependencies.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net46;netcoreapp2.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<Import Project="..\..\build\dependencies.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net46;netcoreapp2.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<Import Project="..\..\build\dependencies.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net46;netcoreapp2.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<Import Project="..\..\build\dependencies.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net46;netcoreapp2.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<Import Project="..\..\build\dependencies.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net46;netcoreapp2.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<Import Project="..\..\build\dependencies.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net46;netcoreapp2.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<Import Project="..\..\build\dependencies.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net46;netcoreapp2.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -6,34 +6,19 @@ using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Utilities;
|
|||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
#if NETSTANDARD1_3
|
||||
using System.Threading;
|
||||
#else
|
||||
using System.Runtime.Remoting;
|
||||
using System.Runtime.Remoting.Messaging;
|
||||
#endif
|
||||
|
||||
namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
|
||||
{
|
||||
public class DataStoreErrorLogger : ILogger
|
||||
{
|
||||
#if NETSTANDARD1_3
|
||||
private static readonly AsyncLocal<DataStoreErrorLog> _log = new AsyncLocal<DataStoreErrorLog>();
|
||||
#else
|
||||
private static readonly string ContextName = "__DataStoreErrorLog" + AppDomain.CurrentDomain.Id;
|
||||
#endif
|
||||
|
||||
public virtual DataStoreErrorLog LastError
|
||||
{
|
||||
get
|
||||
{
|
||||
#if NETSTANDARD1_3
|
||||
return _log.Value;
|
||||
#else
|
||||
var handle = CallContext.LogicalGetData(ContextName) as ObjectHandle;
|
||||
|
||||
return handle?.Unwrap() as DataStoreErrorLog;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -44,11 +29,7 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
|
|||
// it will not be available to code outside of the current async context.
|
||||
// We create it ahead of time so that any cloning just clones the reference
|
||||
// to the object that will hold any errors.
|
||||
#if NETSTANDARD1_3
|
||||
_log.Value = new DataStoreErrorLog();
|
||||
#else
|
||||
CallContext.LogicalSetData(ContextName, new ObjectHandle(new DataStoreErrorLog()));
|
||||
#endif
|
||||
}
|
||||
|
||||
public virtual void Log<TState>(LogLevel logLevel, EventId eventId, [CanBeNull] TState state, [CanBeNull] Exception exception, [CanBeNull] Func<TState, Exception, string> formatter)
|
||||
|
|
|
|||
|
|
@ -69,12 +69,6 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
|
|||
|
||||
try
|
||||
{
|
||||
#if !NETSTANDARD1_3
|
||||
// TODO This probably isn't the correct place for this workaround, it
|
||||
// needs to be called before anything is written to CallContext
|
||||
// http://msdn.microsoft.com/en-us/library/dn458353(v=vs.110).aspx
|
||||
System.Configuration.ConfigurationManager.GetSection("system.xml/xmlReader");
|
||||
#endif
|
||||
_loggerProvider.Logger.StartLoggingForCurrentCallContext();
|
||||
|
||||
await _next(context);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,10 +0,0 @@
|
|||
[
|
||||
{
|
||||
"TypeId": "public class Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Views.DatabaseErrorPage : Microsoft.AspNetCore.DiagnosticsViewPage.Views.BaseView",
|
||||
"Kind": "Removal"
|
||||
},
|
||||
{
|
||||
"TypeId": "public class Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Views.DatabaseErrorPageModel",
|
||||
"Kind": "Removal"
|
||||
}
|
||||
]
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,30 +0,0 @@
|
|||
[
|
||||
{
|
||||
"TypeId": "public class Microsoft.AspNetCore.Diagnostics.Views.CompilationErrorPage : Microsoft.AspNetCore.DiagnosticsViewPage.Views.BaseView",
|
||||
"Kind": "Removal"
|
||||
},
|
||||
{
|
||||
"TypeId": "public class Microsoft.AspNetCore.Diagnostics.Views.CompilationErrorPageModel",
|
||||
"Kind": "Removal"
|
||||
},
|
||||
{
|
||||
"TypeId": "public class Microsoft.AspNetCore.Diagnostics.Views.ErrorDetails",
|
||||
"Kind": "Removal"
|
||||
},
|
||||
{
|
||||
"TypeId": "public class Microsoft.AspNetCore.Diagnostics.Views.ErrorPage : Microsoft.AspNetCore.DiagnosticsViewPage.Views.BaseView",
|
||||
"Kind": "Removal"
|
||||
},
|
||||
{
|
||||
"TypeId": "public class Microsoft.AspNetCore.Diagnostics.Views.ErrorPageModel",
|
||||
"Kind": "Removal"
|
||||
},
|
||||
{
|
||||
"TypeId": "public class Microsoft.AspNetCore.Diagnostics.Views.StackFrame",
|
||||
"Kind": "Removal"
|
||||
},
|
||||
{
|
||||
"TypeId": "public class Microsoft.AspNetCore.Diagnostics.Views.StackFrameInfo",
|
||||
"Kind": "Removal"
|
||||
}
|
||||
]
|
||||
|
|
@ -1,218 +0,0 @@
|
|||
{
|
||||
"AssemblyIdentity": "Microsoft.AspNetCore.MiddlewareAnalysis, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60",
|
||||
"Types": [
|
||||
{
|
||||
"Name": "Microsoft.Extensions.DependencyInjection.AnalysisServiceCollectionExtensions",
|
||||
"Visibility": "Public",
|
||||
"Kind": "Class",
|
||||
"Abstract": true,
|
||||
"Static": true,
|
||||
"Sealed": true,
|
||||
"ImplementedInterfaces": [],
|
||||
"Members": [
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "AddMiddlewareAnalysis",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "services",
|
||||
"Type": "Microsoft.Extensions.DependencyInjection.IServiceCollection"
|
||||
}
|
||||
],
|
||||
"ReturnType": "Microsoft.Extensions.DependencyInjection.IServiceCollection",
|
||||
"Static": true,
|
||||
"Extension": true,
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
}
|
||||
],
|
||||
"GenericParameters": []
|
||||
},
|
||||
{
|
||||
"Name": "Microsoft.AspNetCore.MiddlewareAnalysis.AnalysisBuilder",
|
||||
"Visibility": "Public",
|
||||
"Kind": "Class",
|
||||
"ImplementedInterfaces": [
|
||||
"Microsoft.AspNetCore.Builder.IApplicationBuilder"
|
||||
],
|
||||
"Members": [
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "get_ApplicationServices",
|
||||
"Parameters": [],
|
||||
"ReturnType": "System.IServiceProvider",
|
||||
"Sealed": true,
|
||||
"Virtual": true,
|
||||
"ImplementedInterface": "Microsoft.AspNetCore.Builder.IApplicationBuilder",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "set_ApplicationServices",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "value",
|
||||
"Type": "System.IServiceProvider"
|
||||
}
|
||||
],
|
||||
"ReturnType": "System.Void",
|
||||
"Sealed": true,
|
||||
"Virtual": true,
|
||||
"ImplementedInterface": "Microsoft.AspNetCore.Builder.IApplicationBuilder",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "get_Properties",
|
||||
"Parameters": [],
|
||||
"ReturnType": "System.Collections.Generic.IDictionary<System.String, System.Object>",
|
||||
"Sealed": true,
|
||||
"Virtual": true,
|
||||
"ImplementedInterface": "Microsoft.AspNetCore.Builder.IApplicationBuilder",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "get_ServerFeatures",
|
||||
"Parameters": [],
|
||||
"ReturnType": "Microsoft.AspNetCore.Http.Features.IFeatureCollection",
|
||||
"Sealed": true,
|
||||
"Virtual": true,
|
||||
"ImplementedInterface": "Microsoft.AspNetCore.Builder.IApplicationBuilder",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "Build",
|
||||
"Parameters": [],
|
||||
"ReturnType": "Microsoft.AspNetCore.Http.RequestDelegate",
|
||||
"Sealed": true,
|
||||
"Virtual": true,
|
||||
"ImplementedInterface": "Microsoft.AspNetCore.Builder.IApplicationBuilder",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "New",
|
||||
"Parameters": [],
|
||||
"ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder",
|
||||
"Sealed": true,
|
||||
"Virtual": true,
|
||||
"ImplementedInterface": "Microsoft.AspNetCore.Builder.IApplicationBuilder",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "Use",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "middleware",
|
||||
"Type": "System.Func<Microsoft.AspNetCore.Http.RequestDelegate, Microsoft.AspNetCore.Http.RequestDelegate>"
|
||||
}
|
||||
],
|
||||
"ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder",
|
||||
"Sealed": true,
|
||||
"Virtual": true,
|
||||
"ImplementedInterface": "Microsoft.AspNetCore.Builder.IApplicationBuilder",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Constructor",
|
||||
"Name": ".ctor",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "inner",
|
||||
"Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder"
|
||||
}
|
||||
],
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
}
|
||||
],
|
||||
"GenericParameters": []
|
||||
},
|
||||
{
|
||||
"Name": "Microsoft.AspNetCore.MiddlewareAnalysis.AnalysisMiddleware",
|
||||
"Visibility": "Public",
|
||||
"Kind": "Class",
|
||||
"ImplementedInterfaces": [],
|
||||
"Members": [
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "Invoke",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "httpContext",
|
||||
"Type": "Microsoft.AspNetCore.Http.HttpContext"
|
||||
}
|
||||
],
|
||||
"ReturnType": "System.Threading.Tasks.Task",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Constructor",
|
||||
"Name": ".ctor",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "next",
|
||||
"Type": "Microsoft.AspNetCore.Http.RequestDelegate"
|
||||
},
|
||||
{
|
||||
"Name": "diagnosticSource",
|
||||
"Type": "System.Diagnostics.DiagnosticSource"
|
||||
},
|
||||
{
|
||||
"Name": "middlewareName",
|
||||
"Type": "System.String"
|
||||
}
|
||||
],
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
}
|
||||
],
|
||||
"GenericParameters": []
|
||||
},
|
||||
{
|
||||
"Name": "Microsoft.AspNetCore.MiddlewareAnalysis.AnalysisStartupFilter",
|
||||
"Visibility": "Public",
|
||||
"Kind": "Class",
|
||||
"ImplementedInterfaces": [
|
||||
"Microsoft.AspNetCore.Hosting.IStartupFilter"
|
||||
],
|
||||
"Members": [
|
||||
{
|
||||
"Kind": "Method",
|
||||
"Name": "Configure",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "next",
|
||||
"Type": "System.Action<Microsoft.AspNetCore.Builder.IApplicationBuilder>"
|
||||
}
|
||||
],
|
||||
"ReturnType": "System.Action<Microsoft.AspNetCore.Builder.IApplicationBuilder>",
|
||||
"Sealed": true,
|
||||
"Virtual": true,
|
||||
"ImplementedInterface": "Microsoft.AspNetCore.Hosting.IStartupFilter",
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
},
|
||||
{
|
||||
"Kind": "Constructor",
|
||||
"Name": ".ctor",
|
||||
"Parameters": [],
|
||||
"Visibility": "Public",
|
||||
"GenericParameter": []
|
||||
}
|
||||
],
|
||||
"GenericParameters": []
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -3,10 +3,7 @@
|
|||
<Import Project="..\..\build\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<!-- Mitigation for long path issues -->
|
||||
<AssemblyName>Diagnostics.EFCore.FunctionalTests</AssemblyName>
|
||||
</PropertyGroup>
|
||||
|
|
|
|||
|
|
@ -53,9 +53,7 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests
|
|||
[ConditionalFact]
|
||||
[OSSkipCondition(OperatingSystems.Linux)]
|
||||
[OSSkipCondition(OperatingSystems.MacOSX)]
|
||||
#if NETCOREAPP2_0
|
||||
[OSSkipCondition(OperatingSystems.Windows, WindowsVersions.Win7, WindowsVersions.Win2008R2)]
|
||||
#endif
|
||||
public async Task Migration_request_default_path()
|
||||
{
|
||||
await Migration_request(useCustomPath: false);
|
||||
|
|
@ -64,9 +62,7 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests
|
|||
[ConditionalFact]
|
||||
[OSSkipCondition(OperatingSystems.Linux)]
|
||||
[OSSkipCondition(OperatingSystems.MacOSX)]
|
||||
#if NETCOREAPP2_0
|
||||
[OSSkipCondition(OperatingSystems.Windows, WindowsVersions.Win7, WindowsVersions.Win2008R2)]
|
||||
#endif
|
||||
public async Task Migration_request_custom_path()
|
||||
{
|
||||
await Migration_request(useCustomPath: true);
|
||||
|
|
@ -199,9 +195,7 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests
|
|||
[ConditionalFact]
|
||||
[OSSkipCondition(OperatingSystems.Linux)]
|
||||
[OSSkipCondition(OperatingSystems.MacOSX)]
|
||||
#if NETCOREAPP2_0
|
||||
[OSSkipCondition(OperatingSystems.Windows, WindowsVersions.Win7, WindowsVersions.Win2008R2)]
|
||||
#endif
|
||||
public async Task Exception_while_applying_migrations()
|
||||
{
|
||||
using (var database = SqlServerTestStore.CreateScratch())
|
||||
|
|
|
|||
|
|
@ -21,9 +21,7 @@ namespace Microsoft.AspNetCore.Diagnostics.FunctionalTests
|
|||
[ConditionalFact]
|
||||
[OSSkipCondition(OperatingSystems.Linux)]
|
||||
[OSSkipCondition(OperatingSystems.MacOSX)]
|
||||
#if NETCOREAPP2_0
|
||||
[OSSkipCondition(OperatingSystems.Windows, WindowsVersions.Win7, WindowsVersions.Win2008R2)]
|
||||
#endif
|
||||
public async Task DatabaseErrorPage_ShowsError()
|
||||
{
|
||||
// Arrange
|
||||
|
|
|
|||
|
|
@ -3,12 +3,9 @@
|
|||
<Import Project="..\..\build\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<SignAssembly>false</SignAssembly>
|
||||
<PublicSign>false</PublicSign>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
|
||||
<!-- Mitigation for long path issues -->
|
||||
<AssemblyName>Diagnostics.FunctionalTests</AssemblyName>
|
||||
</PropertyGroup>
|
||||
|
|
|
|||
|
|
@ -1,50 +0,0 @@
|
|||
using System;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests
|
||||
{
|
||||
#if NET46
|
||||
public class DataStoreErrorLoggerTest
|
||||
{
|
||||
private const string _name = "test";
|
||||
|
||||
private static DataStoreErrorLogger SetUp(Func<string, LogLevel, bool> filter = null, string name = null)
|
||||
{
|
||||
// Arrange
|
||||
var provider = new DataStoreErrorLoggerProvider();
|
||||
var logger = (DataStoreErrorLogger)provider.CreateLogger(name ?? _name);
|
||||
|
||||
return logger;
|
||||
}
|
||||
|
||||
private static void DomainFunc()
|
||||
{
|
||||
var logger = SetUp();
|
||||
logger.StartLoggingForCurrentCallContext();
|
||||
logger.LogInformation(0, "Test");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ScopeWithChangingAppDomains_DoesNotAccessUnloadedAppDomain()
|
||||
{
|
||||
// Arrange
|
||||
var logger = SetUp();
|
||||
var setupInfo = new AppDomainSetup
|
||||
{
|
||||
ApplicationBase = AppDomain.CurrentDomain.BaseDirectory
|
||||
};
|
||||
var domain = AppDomain.CreateDomain("newDomain", null, setupInfo);
|
||||
|
||||
// Act
|
||||
logger.StartLoggingForCurrentCallContext();
|
||||
domain.DoCallBack(DomainFunc);
|
||||
AppDomain.Unload(domain);
|
||||
logger.LogInformation(0, "Testing");
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(logger.LastError);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
@ -3,8 +3,7 @@
|
|||
<Import Project="..\..\build\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -305,45 +305,6 @@ namespace Microsoft.AspNetCore.Diagnostics.Tests
|
|||
Assert.Empty(store.GetActivities());
|
||||
}
|
||||
|
||||
#if NET46
|
||||
private static void DomainFunc()
|
||||
{
|
||||
var t = SetUp();
|
||||
var logger = t.Item1;
|
||||
using (logger.BeginScope("newDomain scope"))
|
||||
{
|
||||
logger.LogInformation("Test");
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ScopeWithChangingAppDomains_DoesNotAccessUnloadedAppDomain()
|
||||
{
|
||||
// Arrange
|
||||
var t = SetUp();
|
||||
var logger = t.Item1;
|
||||
var store = t.Item2;
|
||||
var setupInfo = new AppDomainSetup
|
||||
{
|
||||
ApplicationBase = AppDomain.CurrentDomain.BaseDirectory
|
||||
};
|
||||
var domain = AppDomain.CreateDomain("newDomain", null, setupInfo);
|
||||
|
||||
// Act
|
||||
domain.DoCallBack(DomainFunc);
|
||||
AppDomain.Unload(domain);
|
||||
using (logger.BeginScope("Scope1"))
|
||||
{
|
||||
logger.LogInformation("Testing");
|
||||
}
|
||||
|
||||
Assert.Equal(1, store.Count());
|
||||
}
|
||||
#elif NETCOREAPP2_0
|
||||
#else
|
||||
#error Target framework needs to be updated
|
||||
#endif
|
||||
|
||||
private List<LogInfo> NodeLogs(ScopeNode node, List<LogInfo> logs)
|
||||
{
|
||||
if (node != null)
|
||||
|
|
|
|||
|
|
@ -3,10 +3,7 @@
|
|||
<Import Project="..\..\build\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
@ -32,10 +29,6 @@
|
|||
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)'=='net46'">
|
||||
<PackageReference Include="System.Security.Claims" Version="$(CoreFxVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
|
||||
</ItemGroup>
|
||||
|
|
|
|||
|
|
@ -3,10 +3,7 @@
|
|||
<Import Project="..\..\build\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
Loading…
Reference in New Issue