forked from aspnet/AspNetWebStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWebHostAssembliesResolver.cs
More file actions
26 lines (24 loc) · 1013 Bytes
/
WebHostAssembliesResolver.cs
File metadata and controls
26 lines (24 loc) · 1013 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web.Compilation;
using System.Web.Http.Dispatcher;
namespace System.Web.Http.WebHost
{
/// <summary>
/// Provides an implementation of <see cref="IAssembliesResolver"/> using <see cref="BuildManager"/>.
/// </summary>
internal sealed class WebHostAssembliesResolver : IAssembliesResolver
{
/// <summary>
/// Returns a list of assemblies that will be searched for types that implement IHttpController, such as ApiController.
/// </summary>
/// <returns>An <see cref="ICollection{Assembly}" /> of assemblies.</returns>
ICollection<Assembly> IAssembliesResolver.GetAssemblies()
{
return BuildManager.GetReferencedAssemblies().OfType<Assembly>().ToList();
}
}
}