mef

System.Security.Permissions.FileIOPermission when using MEF to load dll's

元气小坏坏 提交于 2020-01-04 18:56:49
问题 I am trying to load some dll's into a MEF DirectoryCatalog within an ASP.NET MVC application: var catalog = new DirectoryCatalog(HttpRuntime.BinDirectory, "Toptable.Mobile.*.dll"); When I run the app through the Cassini web server (i.e. F5) everything runs fine however when hosted in IIS(7) I get the following exception: [SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken

.net Mef with Enterprise Library 5.0

倾然丶 夕夏残阳落幕 提交于 2020-01-04 15:58:55
问题 I am wanting to use mef with the Logging and Exception Blocks of Enterprise Library 5.0. What I am doing is I have a plugin defined that MEF is looking for in a directory. It then imports it for me. However I am using logging and exception handling in the plugin also and I would like to be able to insert the instance of the LogWriter and ExceptionWriter via mef. The example shows you how to do it with unity which won't work since I am using mef to get the plugin and instantiate it. thanks 回答1

.net Mef with Enterprise Library 5.0

半城伤御伤魂 提交于 2020-01-04 15:58:18
问题 I am wanting to use mef with the Logging and Exception Blocks of Enterprise Library 5.0. What I am doing is I have a plugin defined that MEF is looking for in a directory. It then imports it for me. However I am using logging and exception handling in the plugin also and I would like to be able to insert the instance of the LogWriter and ExceptionWriter via mef. The example shows you how to do it with unity which won't work since I am using mef to get the plugin and instantiate it. thanks 回答1

So we've got MEF working with MVC4, how about the convention based model?

假如想象 提交于 2020-01-04 06:27:06
问题 After much digging about I figured it's possible to use MEF for DI in MVC4, below SO link gives a couple of examples: How to integrate MEF with ASP.NET MVC 4 and ASP.NET Web API They work fine, but I'm wondering how to eliminate the need of explicitly "Import" and "Export" the obvious like your controllers in the MVC 4 app? There are some suggestions on the web, some top programming minds' blogs. But I had little success in replicating their success stories. Just to name a couple: http://mef

How can MEF resolve dependencies of assemblies that don't live at the root of the application?

丶灬走出姿态 提交于 2020-01-04 05:25:37
问题 I have written my application to be a class library that is launched by a win32 MFC application. Each of my views is a separate assembly that is located with the base class library that is located in a sub-directory of the hosted MFC application. My question is, how can I get MEF to resolve the dependencies of my exported classes using the assemblies from this sub-directory instead of the root directory? This is what I want: ParentFolder myapp.exe SubFolder myMvvmWindow.dll myMvvmSubWindow

instance of class held by composition container in mef

末鹿安然 提交于 2020-01-04 05:25:27
问题 I understand that a MEF CompositionContainer creates and keeps instances of classes. I don't know under what circumstances a CompositionContainer has a class instance in its bowels. Can anybody list operations performed on the CompositionContainer or methods of the CompositionContainer class that cause the CompositionContainer to store an instance of a class within the CompositionContainer. Is it possible to view class instances held within a CompositionContainer in the debugger or any other

VS2010 syntax coloring: how to obtain the previous classification type

 ̄綄美尐妖づ 提交于 2020-01-04 03:49:09
问题 I'm trying to play with the new syntax coloring capabilities of VS2010 based on Noah Richards' diff coloring sample. The goal is to create syntax coloring for SpecFlow (http://www.specflow.org). In my case, finding the syntax elements are fairly complex and not line-level. Therefore, when I implement the GetClassificationSpans I don't want to re-parse the entire file, but rather take the state of the beginning of the changed text and parsing the content from that point on. I thought that I

VS2010 syntax coloring: how to obtain the previous classification type

三世轮回 提交于 2020-01-04 03:49:07
问题 I'm trying to play with the new syntax coloring capabilities of VS2010 based on Noah Richards' diff coloring sample. The goal is to create syntax coloring for SpecFlow (http://www.specflow.org). In my case, finding the syntax elements are fairly complex and not line-level. Therefore, when I implement the GetClassificationSpans I don't want to re-parse the entire file, but rather take the state of the beginning of the changed text and parsing the content from that point on. I thought that I

Where did the ExportFactory<T> from desktop MEF go?

杀马特。学长 韩版系。学妹 提交于 2020-01-04 02:52:06
问题 I can't find it!? 回答1: ExportFactory<T> is not part of MEF for the desktop (yet - as of now, it's only released for Silverlight). It looks like it will be included in MEF 2. In the meantime, Glenn Block posted a version of the Composition.Initialization assembly ported to MEF for desktop development, and placed it on his SkyDrive. Alternatively, you can use the Preview 1 release of MEF2, which includes this. 来源: https://stackoverflow.com/questions/3762075/where-did-the-exportfactoryt-from

Questions on MEF strategy and structure

那年仲夏 提交于 2020-01-03 17:31:06
问题 I am tasked with modularizing a C# app that is a rewrite of a very large Delphi app (the DB has 249 tables!). Business constraints proscribe a complete redesign for .NET and better overall architecture, so we are basically just incrementally rewriting module for module of the Delphi app in C#. Until finished, the suite will comprise a mixture of pending rewrites, and C# app modules I want to integrate using MEF. The app concerns itself with Time-and-Attendance and Access-Control, and has