且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

实体框架ExecuteStoreQuery在已部署的系统上失败

更新时间:2023-11-04 18:42:40

根据绑定结果,您似乎没有在应用程序中部署Microsoft.Practices.Unity.DLL.好像是从Microsoft.Practices.EnterpriseLibrary.Common引用的,这就是为什么您没有直接引用的原因.

Based on your bind result, it looks like you are not deploying Microsoft.Practices.Unity.DLL with your application. And it looks like this is referenced from Microsoft.Practices.EnterpriseLibrary.Common, which is why you don't have a direct reference.

这是MSDN文章描述企业库具有的各种依赖关系.

Here is the MSDN article that describes the various dependencies that the Enterprise Library has.

更新

我刚刚使用ildasm.exe(C:\ Program Files(x86)\ Microsoft SDKs \ Windows \ v7.0A \ Bin)检查了System.Data.Entity的直接依赖关系,它肯定没有引用企业库.如果有的话,我会感到非常惊讶,因为它们通常不会在系统DLL和可选产品DLL之间建立依赖关系(正是出于这个原因).

I just checked the direct dependencies of System.Data.Entity using ildasm.exe (C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin) and it definitely does not reference the enterprise library. I would have been extremely surprised if it had, because they generally don't create dependencies between System DLLs and optional product DLLs (just for this reason).

您是否正在拉入可能包含此内容的其他DLL/引用?如果不确定,可以使用ildasm.exe,导航到DLL,然后打开它的清单.有点难以理解,但是您正在寻找类似的参考文献:

Are you pulling in other DLLs/references that may include this? If you aren't sure, you can use ildasm.exe, navigate to the DLL, then open it's manifest. It's a little hard to read, but you are looking for references like:

module extern 'System.Data.dll, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

.assembly extern System.Data