Fixes netstandard references

This commit is contained in:
Shannon
2020-01-29 15:29:28 +11:00
parent 5ed900f276
commit c4b9a62e3b
8 changed files with 26 additions and 18 deletions
@@ -244,11 +244,11 @@ namespace Umbraco.Core.Composing.LightInject
{ }
/// <inheritdoc />
public void EnablePerWebRequestScope()
public virtual void EnablePerWebRequestScope()
{
if (!(Container.ScopeManagerProvider is MixedLightInjectScopeManagerProvider smp))
throw new Exception("Container.ScopeManagerProvider is not MixedLightInjectScopeManagerProvider.");
smp.EnablePerWebRequestScope();
smp.EnablePerWebRequestScope(new PerLogicalCallContextScopeManagerProvider());
}
private class AssemblyScanner : IAssemblyScanner
@@ -1,5 +1,4 @@
using LightInject;
using LightInject.Web;
namespace Umbraco.Core.Composing.LightInject
{
@@ -29,10 +28,10 @@ namespace Umbraco.Core.Composing.LightInject
_provider = new PerThreadScopeManagerProvider();
}
public void EnablePerWebRequestScope()
public void EnablePerWebRequestScope(IScopeManagerProvider perRequestScopeProvider)
{
if (_provider is PerWebRequestScopeManagerProvider) return;
_provider = new PerWebRequestScopeManagerProvider();
if (perRequestScopeProvider.GetType().IsAssignableFrom(_provider.GetType())) return;
_provider = perRequestScopeProvider;
}
public IScopeManager GetScopeManager(IServiceFactory factory)
@@ -8,9 +8,7 @@
<ItemGroup>
<PackageReference Include="LightInject" Version="6.2.0" />
<PackageReference Include="LightInject.Annotation" Version="1.1.0" />
<PackageReference Include="LightInject.Web" Version="2.0.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.Owin" Version="4.0.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-19554-01" />
<PackageReference Include="MiniProfiler.Shared" Version="4.1.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
+2 -8
View File
@@ -1,16 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Web;
using Microsoft.AspNet.SignalR;
using Microsoft.Owin.Logging;
using Owin;
using Umbraco.Core.Configuration;
using Umbraco.Core.Logging;
using Umbraco.Web.Composing;
using Umbraco.Web.SignalR;
using Umbraco.Web.Logging;
namespace Umbraco.Web
{
@@ -1,6 +1,7 @@
using System;
using System.Web.Http;
using LightInject;
using LightInject.Web;
using Umbraco.Core.Composing.LightInject;
namespace Umbraco.Web.Composing.LightInject
@@ -23,6 +24,16 @@ namespace Umbraco.Web.Composing.LightInject
public new static LightInjectContainer Create()
=> new LightInjectContainer(CreateServiceContainer());
/// <summary>
/// Overridden to supply the .Net Framework based PerWebRequestScopeManagerProvider
/// </summary>
public override void EnablePerWebRequestScope()
{
if (!(Container.ScopeManagerProvider is MixedLightInjectScopeManagerProvider smp))
throw new Exception("Container.ScopeManagerProvider is not MixedLightInjectScopeManagerProvider.");
smp.EnablePerWebRequestScope(new PerWebRequestScopeManagerProvider());
}
/// <inheritdoc />
public override void ConfigureForWeb()
{
@@ -1,7 +1,8 @@
using System;
using System.Diagnostics;
using Umbraco.Core.Logging;
namespace Umbraco.Core.Logging
namespace Umbraco.Web.Logging
{
internal class OwinLogger : Microsoft.Owin.Logging.ILogger
{
@@ -2,7 +2,7 @@
using Microsoft.Owin.Logging;
using Umbraco.Composing;
namespace Umbraco.Core.Logging
namespace Umbraco.Web.Logging
{
public class OwinLoggerFactory : ILoggerFactory
{
+5
View File
@@ -70,6 +70,9 @@
<PackageReference Include="LightInject" Version="5.4.0" />
<PackageReference Include="LightInject.Annotation" Version="1.1.0" />
<PackageReference Include="LightInject.Mvc" Version="2.0.0" />
<PackageReference Include="LightInject.Web">
<Version>2.0.0</Version>
</PackageReference>
<PackageReference Include="LightInject.WebApi" Version="2.0.0" />
<PackageReference Include="Markdown" Version="2.2.1" />
<PackageReference Include="Microsoft.AspNet.Identity.Owin" Version="2.2.2" />
@@ -165,6 +168,8 @@
<Compile Include="HttpContextExtensions.cs" />
<Compile Include="IUmbracoContextFactory.cs" />
<Compile Include="Install\ChangesMonitor.cs" />
<Compile Include="Logging\OwinLogger.cs" />
<Compile Include="Logging\OwinLoggerFactory.cs" />
<Compile Include="Logging\WebProfiler.cs" />
<Compile Include="Logging\WebProfilerComponent.cs" />
<Compile Include="Logging\WebProfilerComposer.cs" />