本文整理汇总了C#中ILibraryManager.GetReferencingLibraries方法的典型用法代码示例。如果您正苦于以下问题:C# ILibraryManager.GetReferencingLibraries方法的具体用法?C# ILibraryManager.GetReferencingLibraries怎么用?C# ILibraryManager.GetReferencingLibraries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILibraryManager
的用法示例。
在下文中一共展示了ILibraryManager.GetReferencingLibraries方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Configure
public void Configure(IApplicationBuilder app, IServiceProvider serviceProvider, ILibraryManager manager,
IOmnisharpEnvironment env, ILoggerFactory loggerFactory, ISharedTextWriter writer, IOptions<OmniSharpOptions> optionsAccessor)
{
var assemblies = manager.GetReferencingLibraries("OmniSharp.Abstractions")
.SelectMany(libraryInformation => libraryInformation.LoadableAssemblies)
.Concat(
manager.GetReferencingLibraries("OmniSharp.Roslyn")
.SelectMany(libraryInformation => libraryInformation.LoadableAssemblies)
)
.Select(assemblyName => Assembly.Load(assemblyName));
PluginHost = ConfigureMef(serviceProvider, optionsAccessor.Options, assemblies);
Workspace = PluginHost.GetExport<OmnisharpWorkspace>();
Func<string, LogLevel, bool> logFilter = (category, type) =>
(category.StartsWith("OmniSharp", StringComparison.OrdinalIgnoreCase) || string.Equals(category, typeof(ErrorHandlerMiddleware).FullName, StringComparison.OrdinalIgnoreCase))
&& env.TraceType <= type;
if (env.TransportType == TransportType.Stdio)
{
loggerFactory.AddStdio(writer, logFilter);
}
else
{
loggerFactory.AddConsole(logFilter);
}
var logger = loggerFactory.CreateLogger<Startup>();
app.UseRequestLogging();
app.UseErrorHandler("/error");
app.UseMiddleware<EndpointMiddleware>();
app.UseMiddleware<StatusMiddleware>();
app.UseMiddleware<StopServerMiddleware>();
if (env.TransportType == TransportType.Stdio)
{
logger.LogInformation($"Omnisharp server running using stdio at location '{env.Path}' on host {env.HostPID}.");
}
else
{
logger.LogInformation($"Omnisharp server running on port '{env.Port}' at location '{env.Path}' on host {env.HostPID}.");
}
// Forward workspace events
PluginHost.GetExport<ProjectEventForwarder>();
foreach (var projectSystem in PluginHost.GetExports<IProjectSystem>())
{
try
{
projectSystem.Initalize(Configuration.GetSubKey(projectSystem.Key));
}
catch (Exception e)
{
//if a project system throws an unhandled exception
//it should not crash the entire server
logger.LogError($"The project system '{projectSystem.GetType().Name}' threw an exception.", e);
}
}
// Mark the workspace as initialized
Workspace.Initialized = true;
logger.LogInformation("Solution has finished loading");
}