小编iKo*_*roi的帖子

无法找到类型或命名空间名称'...'(您是否缺少using指令或程序集引用?)

这项工作适用于我转移到这个应用程序的另一个应用程序.我已经被困在这里好几个小时了,谷歌没有太多的MEF.是的,导入了System.ComponentModel.Composition.dll.但仍然无法摆脱这个错误.

我有这个为我的包括:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.ComponentModel.Composition;
using JSNet;
Run Code Online (Sandbox Code Playgroud)

受影响的代码:

var catalog = new AggregatingComposablePartCatalog();
var mainAssemblyCatalog = new AttributedAssemblyPartCatalog(this.GetType().Assembly);
var jsNetCatalog = new AttributedAssemblyPartCatalog(typeof(Effect).Assembly);            
//var addInEffects = new DirectoryPartCatalog("Effects"); 

catalog.Catalogs.Add(mainAssemblyCatalog);
catalog.Catalogs.Add(jsNetCatalog);
//catalog.Catalogs.Add(addInEffects);
var container = new CompositionContainer(catalog);
Run Code Online (Sandbox Code Playgroud)

错误:

Error 1: The type or namespace name 'AggregatingComposablePartCatalog' could not be found (are you missing a using directive or an assembly reference?) 

Error 2: The type or namespace name 'AttributedAssemblyPartCatalog' could not be found (are you …
Run Code Online (Sandbox Code Playgroud)

c# mef

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

c# ×1

mef ×1