0
当尝试使用CreateTransient工厂装载机创建ObjectContext的,我一直得到一个错误:EF努力测试库抛出“TargetInvocationException”
"TargetInvocationException was unhandled by user code"
与内部异常:
"The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid"
var loader = new CsvDataLoader(@"C:\MyProject\MyProject.Tests\Data\Info.csv");
using (var context = ObjectContextFactory.CreateTransient<MyEntities>(loader))
{
...
}
我可以创建一个标准的上下文就好了,我可以创建一个没有加载器的Transient ObjectContext,但我无法加载一个csv文件。 csv由努力导出工具生成。