From 5038c369db16a23312612073ce7b36ab4b1931aa Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 12 Feb 2015 14:44:38 -0800 Subject: [PATCH 1/3] Using IServiceManifest from Microsoft.Framework.Runtime.Interfaces --- .../IApplicationLifetime.cs | 2 -- .../IConfigureHostingEnvironment.cs | 1 - .../IHostingEnvironment.cs | 2 -- .../IServerFactory.cs | 2 -- .../project.json | 1 - src/Microsoft.AspNet.Hosting/IServiceManifest.cs | 16 ---------------- src/Microsoft.AspNet.Hosting/project.json | 1 + 7 files changed, 1 insertion(+), 24 deletions(-) rename src/{Microsoft.AspNet.Hosting => Microsoft.AspNet.Hosting.Interfaces}/IConfigureHostingEnvironment.cs (94%) delete mode 100644 src/Microsoft.AspNet.Hosting/IServiceManifest.cs diff --git a/src/Microsoft.AspNet.Hosting.Interfaces/IApplicationLifetime.cs b/src/Microsoft.AspNet.Hosting.Interfaces/IApplicationLifetime.cs index df20556da1..755a415103 100644 --- a/src/Microsoft.AspNet.Hosting.Interfaces/IApplicationLifetime.cs +++ b/src/Microsoft.AspNet.Hosting.Interfaces/IApplicationLifetime.cs @@ -2,14 +2,12 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Threading; -using Microsoft.Framework.Runtime; namespace Microsoft.AspNet.Hosting { /// /// Allows consumers to perform cleanup during a graceful shutdown. /// - [AssemblyNeutral] public interface IApplicationLifetime { /// diff --git a/src/Microsoft.AspNet.Hosting/IConfigureHostingEnvironment.cs b/src/Microsoft.AspNet.Hosting.Interfaces/IConfigureHostingEnvironment.cs similarity index 94% rename from src/Microsoft.AspNet.Hosting/IConfigureHostingEnvironment.cs rename to src/Microsoft.AspNet.Hosting.Interfaces/IConfigureHostingEnvironment.cs index 715d55b687..6ea92fde03 100644 --- a/src/Microsoft.AspNet.Hosting/IConfigureHostingEnvironment.cs +++ b/src/Microsoft.AspNet.Hosting.Interfaces/IConfigureHostingEnvironment.cs @@ -5,7 +5,6 @@ using Microsoft.Framework.Runtime; namespace Microsoft.AspNet.Hosting { - [AssemblyNeutral] public interface IConfigureHostingEnvironment { void Configure(IHostingEnvironment hostingEnv); diff --git a/src/Microsoft.AspNet.Hosting.Interfaces/IHostingEnvironment.cs b/src/Microsoft.AspNet.Hosting.Interfaces/IHostingEnvironment.cs index 8f5966e332..c946e5d3ff 100644 --- a/src/Microsoft.AspNet.Hosting.Interfaces/IHostingEnvironment.cs +++ b/src/Microsoft.AspNet.Hosting.Interfaces/IHostingEnvironment.cs @@ -2,11 +2,9 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNet.FileProviders; -using Microsoft.Framework.Runtime; namespace Microsoft.AspNet.Hosting { - [AssemblyNeutral] public interface IHostingEnvironment { string EnvironmentName { get; set; } diff --git a/src/Microsoft.AspNet.Hosting.Interfaces/IServerFactory.cs b/src/Microsoft.AspNet.Hosting.Interfaces/IServerFactory.cs index 94cb26ece7..979730e5de 100644 --- a/src/Microsoft.AspNet.Hosting.Interfaces/IServerFactory.cs +++ b/src/Microsoft.AspNet.Hosting.Interfaces/IServerFactory.cs @@ -5,11 +5,9 @@ using System; using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.Framework.ConfigurationModel; -using Microsoft.Framework.Runtime; namespace Microsoft.AspNet.Hosting.Server { - [AssemblyNeutral] public interface IServerFactory { IServerInformation Initialize(IConfiguration configuration); diff --git a/src/Microsoft.AspNet.Hosting.Interfaces/project.json b/src/Microsoft.AspNet.Hosting.Interfaces/project.json index 21b82874ae..9e5b132ac8 100644 --- a/src/Microsoft.AspNet.Hosting.Interfaces/project.json +++ b/src/Microsoft.AspNet.Hosting.Interfaces/project.json @@ -3,7 +3,6 @@ "dependencies": { "Microsoft.AspNet.Http": "1.0.0-*", "Microsoft.AspNet.FileProviders.Interfaces": "1.0.0-*", - "Microsoft.Framework.Runtime.Interfaces": "1.0.0-*", "Microsoft.Framework.ConfigurationModel": "1.0.0-*" }, diff --git a/src/Microsoft.AspNet.Hosting/IServiceManifest.cs b/src/Microsoft.AspNet.Hosting/IServiceManifest.cs deleted file mode 100644 index 3810fdc06c..0000000000 --- a/src/Microsoft.AspNet.Hosting/IServiceManifest.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; - -namespace Microsoft.Framework.DependencyInjection.ServiceLookup -{ -#if ASPNET50 || ASPNETCORE50 - [Microsoft.Framework.Runtime.AssemblyNeutral] -#endif - public interface IServiceManifest - { - IEnumerable Services { get; } - } -} diff --git a/src/Microsoft.AspNet.Hosting/project.json b/src/Microsoft.AspNet.Hosting/project.json index 2696a48923..f4deb14aca 100644 --- a/src/Microsoft.AspNet.Hosting/project.json +++ b/src/Microsoft.AspNet.Hosting/project.json @@ -3,6 +3,7 @@ "description": "ASP.NET 5 core hosting infrastructure and startup logic for web applications.", "dependencies": { "Microsoft.AspNet.Hosting.Interfaces": "1.0.0-*", + "Microsoft.Framework.Runtime.Interfaces": "1.0.0-*", "Microsoft.AspNet.FileProviders": "1.0.0-*", "Microsoft.AspNet.Http.Core": "1.0.0-*", "Microsoft.Framework.Logging": "1.0.0-*", From a48f76da7c4687e3372b02ef945ad70fad55f7fc Mon Sep 17 00:00:00 2001 From: Brice Lambson Date: Thu, 12 Feb 2015 15:48:49 -0800 Subject: [PATCH 2/3] Update IServiceProvider references --- src/Microsoft.AspNet.Hosting/HostingServices.cs | 2 +- test/Microsoft.AspNet.Hosting.Tests/HostingServicesFacts.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.AspNet.Hosting/HostingServices.cs b/src/Microsoft.AspNet.Hosting/HostingServices.cs index b717bb7050..46b0f94703 100644 --- a/src/Microsoft.AspNet.Hosting/HostingServices.cs +++ b/src/Microsoft.AspNet.Hosting/HostingServices.cs @@ -6,8 +6,8 @@ using System.Collections.Generic; using System.Linq; using Microsoft.Framework.ConfigurationModel; using Microsoft.Framework.DependencyInjection; -using Microsoft.Framework.DependencyInjection.ServiceLookup; using Microsoft.Framework.Logging; +using Microsoft.Framework.Runtime; using Microsoft.Framework.Runtime.Infrastructure; namespace Microsoft.AspNet.Hosting diff --git a/test/Microsoft.AspNet.Hosting.Tests/HostingServicesFacts.cs b/test/Microsoft.AspNet.Hosting.Tests/HostingServicesFacts.cs index 65aa6faecd..4fe3e36006 100644 --- a/test/Microsoft.AspNet.Hosting.Tests/HostingServicesFacts.cs +++ b/test/Microsoft.AspNet.Hosting.Tests/HostingServicesFacts.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using Microsoft.AspNet.Hosting.Fakes; using Microsoft.Framework.DependencyInjection; using Microsoft.Framework.DependencyInjection.Fallback; -using Microsoft.Framework.DependencyInjection.ServiceLookup; +using Microsoft.Framework.Runtime; using Xunit; namespace Microsoft.AspNet.Hosting.Tests From 66b98e2ff3bfdc2ec3fb47cac69a166d556dd2aa Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 12 Feb 2015 16:05:09 -0800 Subject: [PATCH 3/3] Reacting to IServiceManifest namespace rename --- test/Microsoft.AspNet.Hosting.Tests/HostingServicesFacts.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.AspNet.Hosting.Tests/HostingServicesFacts.cs b/test/Microsoft.AspNet.Hosting.Tests/HostingServicesFacts.cs index 4fe3e36006..5e6e733da8 100644 --- a/test/Microsoft.AspNet.Hosting.Tests/HostingServicesFacts.cs +++ b/test/Microsoft.AspNet.Hosting.Tests/HostingServicesFacts.cs @@ -84,11 +84,12 @@ namespace Microsoft.AspNet.Hosting.Tests fallbackServices.AddTransient(); // Act - var exp = Assert.Throws(() => HostingServices.Create(fallbackServices.BuildServiceProvider())); + var exception = Assert.Throws(() => HostingServices.Create(fallbackServices.BuildServiceProvider())); // Assert - Assert.True(exp.Message.Contains("No service for type 'Microsoft.Framework.DependencyInjection.ServiceLookup.IServiceManifest'")); + Assert.Equal($"No service for type '{typeof(IServiceManifest).FullName}' has been registered.", + exception.Message); } private class ServiceManifest : IServiceManifest