我有一个项目A,它引用了项目B。项目B引用了EntityFramework nuget包(6.1.3)。此包安装两个dll : EntityFramework和EntityFrameork.SqlServer。没有从项目A中引用EntityFramework。
当我构建项目A时,在bin文件夹中有项目B dll和EntityFramework dll。但是没有EntityFramework.SqlServer动态链接库。正因为如此,我的项目进行得不好。
为什么某些项目B依赖项被复制到主项目构建文件夹中,而不是所有依赖项?(两者都将“复制本地”属性设置为true)
对不起,我不是以英语为母语的人。
发布于 2015-08-30 12:19:58
这是因为您的项目中没有使用EntityFrameork.SqlServer
的代码,所以VS认为不存在依赖关系,也不复制它。我用这个解决办法:
public class MyContext : DbContext
{
//workaround to force sqlserver dll to copy
private static SqlProviderServices instance = SqlProviderServices.Instance;
}
您还可以从EntityFrameork.SqlServer
项目添加对A
的引用,并为其设置CopyLocal
true。
https://stackoverflow.com/questions/32300687
复制相似问题