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.
MEF With Portable Class library using Microsoft Composition MEF2 throws file not found exception
223 Views Asked by shekhar Kumar At
2
There are 2 best solutions below
0
shekhar Kumar
On
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.
Related Questions in MEF
- Stiffness matrix for FEA development
- MEF ImportMany does not propagate exceptions and silently fail
- How to register dependencies in Castle Windsor that work the same as MEF's [Export]
- Force loading assemblies in webassembly project - MEF - AvaloniaUI
- Visual Studio intellisense extension
- Unit test mocking base class
- Dynamically loading UserControl in WPF Assembly missing resources
- Why is MEF in dotnet 6 using ImportManynot working based on code that worked in dotnet framework 4.6.2
- How to call the ViewModel in the Command properly with the Mef container?
- Load and execute code from an Azure Blob container from a function app?
- How to use binding redirects when dynamically loading assembly with MEF
- Quartz.NET JobBuilder.Create<> reuses same instance of IJob
- How can MEF AssemblyCatalogs be used with custom AssemblyLoadContexts
- Downgrade issue in MEF DLL hell
- MEF vs. IAsyncDisposable or iterate over all instantiated exports
Related Questions in NUGET-PACKAGE
- Getting error "The located assembly's manifest definition does not match the assembly reference"
- How can I copy plug-in DLLs from a sub folder using NuGet
- How to add nuget package for offline tfs build task
- How to resolve NuGet Transitive Packages with vulnerabilities
- How install MathNet.Symbolics in ASP.NET 4.8
- NuGet package doesn't copy file to destination project
- Azure Devops pipeline to build .NET Framework Artifact multiple projects
- An error occurred while trying to restore packages. Unable to find version 'x.x.xxxx.xxx' of Moq
- Fail to load package dependency at runtime
- Compatibility Problem after Update from Xamarin.Forms to .Net MAUI
- Increasing the Lifespan of OTP Codes in C# Using PureOtp Library
- Project with referenced nuget package is not able to find files
- .net Unit Test Discovery through nuget package
- Could not load file or assembly 'System.Runtime, when creating nuget spec based on the assembly
- Install local NuGet package in Rider
Related Questions in ROSLYN
- Source generators get the referencing project path - retrieve useful value from IncrementalValueProvider<string>
- Roslyn diagnostics reported through CompilationAnalysisContext.ReportDiagnostic do not show up in Visual Studio
- Using Roslyn and .NET Core : how do I resolve "type or namespace name "Forms" does not exist in the namespace 'System.Windows'
- Sharing runtime assembly in C# Roslyn script
- Detecting unused using statements with Roslyn
- Roslyn generated dll can't be referenced
- Memory Leak caused by Roslyn, how do I contain it?
- How to use Roslyn in wpf application
- Roslyn INamedTypeSymbol.ContainingNamespace.Name an empty string
- Add System.Text.Json to incremental source generator
- No CS0184 warning for impossible check
- Enforce Code Cleanup code-style that is not available in editorconfig
- How to execute Roslyn fixers that rely on internal interfaces
- C# runtime compilation complains The type 'Object' is defined in an assembly that is not referenced
- Dotnet build is using old version of IIncrementalGenerator
Related Questions in VSIX
- Is it possible to refresh filters instead of reloading project
- "Visual Studio stopped responding for 12 seconds,uninstalling extension might help" getting this message on installing VSIX and on opening the project
- How to Format xml based files (csproject) in vsix?
- How to add console when debugging VSIX project
- VSIX Show ContextMenu after Multi-File Selection in Two or More Projects
- In VSIX, reading Configuration Properties of CSPROJ throws COMException (method or operation not implemented)
- Reclassify text in span as different IClassifierProvider
- How to add a File in vstemplate in a back folder?
- How do you set the connection for the activewindow (EnvDTE.Window) in a VSIX extension?
- Error in displaying the Extension in SSMS created in Visual Studio (VSIX project) when right clicking any tables
- How to get the top/bottom line numbers of MSVC pane
- How to add file type validation , when trying to add existing item in solution explorer of visual studio experimental instance?
- How to display two custom tool windows in a same place as tabbed format
- How to suppress, VS detects EXE is not in synch with Custom File so give Stop Debugging error box during Edit& Continue
- How to dock a tool window when it open for the first time in vsix?
Related Questions in MEF2
- Plugins in WPF MvvM with MEF 2
- MEF2 Lightweight System.Composition with Metadata
- Create Singleton instance in MEF2
- .net core MEF 2 NonShared Creation Policy
- How to set CreationPolicy singleton in .net-core System.Composition (Mef)
- How free blocked assemblies in MEF2 (System.Composition 1.0.31) in .NET Core
- How can you filter out parts in MEF2?
- Why does MEF2 not apply metadata attributes to all part exports?
- MEF2: importing all the types implementing a specific interface
- MEF With Portable Class library using Microsoft Composition MEF2 throws file not found exception
- Register instance with mef2 in uwp
- How Can I Export a Factory and/or its Method in MEF 2?
- Compose exported value with MEF 2
- how can i mimic the inheritedexport feature in mef2
- Is MEF or MEF2 baked into the .NET Framework?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Set Copy Local to true in the VSIX's reference to the MEF DLLs.