0

I am working on Portable Class Library(PCL) and trying to achieve MEF in that. I used System.Composition from Nuget. When i build and package for vsix (Extension for Visual Studio) it doesn't package and place those dll's to extension folder (C:\Users\UserName\AppData\Local\Microsoft\VisualStudio\14.0Exp\Extensions\ExtensionName\AppName\versionofYourApp). When i manually place those library in this folder it works fine. Can some one suggest a good solution to this problem. I am writing it for Roslyn Analyzers and creating a nuget package. Again i am facing the same issue, even if i am packaging those library together.

shekhar Kumar
  • 409
  • 4
  • 13
  • Visual Studio ships with a copy of System.Composition, which is why we don't package them with you. What are you really trying to do? Did you start with our analyzer template? – Jason Malinowski Apr 13 '16 at 17:12
  • yes, i used the VS Template for roslyn analyzer. I am trying to achieve Mef in the Analyzer for my custom functions like reading rules remotely placed at common place. Since the Analyzer is pcl so i had to create Core and implementation library which is PCL.By using MEF i am loading implementation library from core library. – shekhar Kumar Apr 14 '16 at 14:06

2 Answers2

0

Set Copy Local to true in the VSIX's reference to the MEF DLLs.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
0

I found a solution, thought of sharing. You are welcome to correct and suggest. For Vsix extension i added those library as an asset(VisualStudio.Assembly) from local.

And for packages, Assembly.Load("AssemblyName") was trying to load library from all possible locations like " C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\PrivateAssemblies" and many. So i placed it there and it was getting loaded. I know this is not the best solution. You are most welcome to suggest.

shekhar Kumar
  • 409
  • 4
  • 13