Class 企业图书馆5.0don';不显示名称空间Microsoft.Practices.EnterpriseLibrary.Data
我在企业库4.0中使用VisualStudio2008。它工作正常,并显示名称空间Microsoft.Practices.EnterpriseLibrary.Data。现在我安装了VS2010和企业库5.0(因为4.0不支持VS2010) 但问题是企业库5.0没有显示Microsoft.Practices.EnterpriseLibrary.Data。在5.0 thriugh中是否还有另一个命名空间,我可以访问Microsoft.Practices.EnterpriseLibrary.Data命名空间下的数据库类Class 企业图书馆5.0don';不显示名称空间Microsoft.Practices.EnterpriseLibrary.Data,class,ado.net,namespaces,enterprise-library,enterprise-library-5,Class,Ado.net,Namespaces,Enterprise Library,Enterprise Library 5,我在企业库4.0中使用VisualStudio2008。它工作正常,并显示名称空间Microsoft.Practices.EnterpriseLibrary.Data。现在我安装了VS2010和企业库5.0(因为4.0不支持VS2010) 但问题是企业库5.0没有显示Microsoft.Practices.EnterpriseLibrary.Data。在5.0 thriugh中是否还有另一个命名空间,我可以访问Microsoft.Practices.EnterpriseLibrary.Data命
请让我知道。您的目标可能是.NET Framework客户端配置文件。数据访问块依赖于System.Data.Oracle,需要完整的.NET Framework。如果有人在将基于DAAB的应用程序移动到.NET4时遇到此问题,entlib5将附带可通过C:\Program Files(x86)安装的源代码\Microsoft企业库5.0\src\Enterprise Library 5.0-源代码.msi 运行该msi并接受默认设置会在文档区域下创建一个
EntLib50Src
文件夹。如果进入EntLib50Src\Blocks\Data
并打开Data.2010.sln
,则可以将目标框架更改为.NET framework 4 Client Profile
这将创建一系列与System.Data.Oracle
依赖项相关的错误。删除对它的引用,然后排除项目的Oracle
部分,并注释掉公共代码中的任何Oracle
引用
如果随后使用强名称签名重新编译,则可以将输出程序集(Microsoft.Practices.EnterpriseLibrary.Common.dll
和Microsoft.Practices.EnterpriseLibrary.Data.dll
)与.NET Framework 4客户端配置文件一起使用。您必须从例如C:\Program Files(x86)\Microsoft Enterprise Library 5.0\Bin
区域分发Microsoft.Practices.Unity.dll
,但这与客户端配置文件兼容
请注意,如果您的应用程序中不需要Oracle支持,则上述方法有效。我的没有,只有SQL Server和VistaDB。以上内容应适用于任何与ADO.NET兼容的非Oracle db