-1

I'm writing a Visual Studio editor extension. In my solution has two projects: the main VSIX Project (first) and the class library project (second). In the second project has several dependencies that exported for MEF and used in the first project. But in runtime MEF can't resolve dependencies that placed in the second project. How I can resolve this issue?

In other cases (simple is - console app) I would do something like this:

var assemplies = AppDomain.CurrentDomain.GetAssemblies()
    .Where(x => x.Location.Contains(AppDomain.CurrentDomain.BaseDirectory));

var compositionHost = new ContainerConfiguration()
    .WithAssemblies(assemplies)
    .CreateContainer();
var compositionContext = compositionHost.GetExport<CompositionContext>();
var exporter = new Export<CompositionContext>(compositionContext, () => { });

var someService = exporter.Value.GetExport<ISomeService>("First");

But how to resolve this issue for Visual Studio editor extension I can't understand

Andrei
  • 11
  • 2

1 Answers1

0

This problem is resolved. If someone is interested need just to add assets of 'Microsoft.VisualStudio.MefComponent' type for necessary assemblies to vsixmanifest.

Andrei
  • 11
  • 2