[EntLib]解决The type or namespace name 'Data' does not exist in the namespace 'Microsoft.Practices.EnterpriseLibrary' 的错误
2011-03-01 11:45
1311 查看
在使用EnterpriseLibrary的Data Access Application Block时,需要添加Microsoft.Practices.EnterpriseLibrary.Common
Microsoft.Practices.EnterpriseLibrary.Data
Microsoft.Practices.ServiceLocation
Microsoft.Practices.Unity
四个Dll的引用
但使用VS2010编译时还是会报错:The type or namespace name 'Data' does not exist in the namespace 'Microsoft.Practices.EnterpriseLibrary' (are you missing an assembly reference?)
解决方法:
在官方codeplex的discussions中找到:
To short circuit digging through that other thread - the Data block only works if you target the full .NET framework. By default, client projects in VS 2010 target the .NET Client profile. Go into your project properties and change your target framework to .NET Framework 4.0 instead of client profile and it should work.
即Visual Studio 2010在编译时默认在客户端使用.NET Client框架,而上面丢失的引用位于完整的.NET Framework 4.0中,所以在项目属性中将Target framework设置为.NET Framework 4再执行编译即可。
Microsoft.Practices.EnterpriseLibrary.Data
Microsoft.Practices.ServiceLocation
Microsoft.Practices.Unity
四个Dll的引用
但使用VS2010编译时还是会报错:The type or namespace name 'Data' does not exist in the namespace 'Microsoft.Practices.EnterpriseLibrary' (are you missing an assembly reference?)
解决方法:
在官方codeplex的discussions中找到:
To short circuit digging through that other thread - the Data block only works if you target the full .NET framework. By default, client projects in VS 2010 target the .NET Client profile. Go into your project properties and change your target framework to .NET Framework 4.0 instead of client profile and it should work.
即Visual Studio 2010在编译时默认在客户端使用.NET Client框架,而上面丢失的引用位于完整的.NET Framework 4.0中,所以在项目属性中将Target framework设置为.NET Framework 4再执行编译即可。
相关文章推荐
- 解决The type or namespace name \'XXXX\' does not exist in the namespace \'XXXXXXXXX\' 的错误
- Error:The type or namespace name 'Office' does not exist in the namespace 'Microsoft' 解决方法
- CS0234 The type or namespace name 'Mvc' does not exist in the namespace 'Microsoft.AspNet' (are you
- The type or namespace name 'Zhaopin' does not exist in the namespace 'LMSoft' 问题的解决
- CS0234: The type or namespace name 'Linq' does not exist in the namespace 'System.Data'
- The type or namespace name 'Windows' does not exist in the namespace....
- The type or namespace name 'Windows' does not exist in the class or namespace 'System'
- Unity3d——报错 The type or namespace name `Ports' does not exist in the namespace `System.IO'
- Compiler Error Message: CS0234: The type or namespace name 'BorderDetails' does not exist in the class or namespace 'Infragistics.WebUI.Shared' (are you missing an assembly reference?)
- WCF分布式开发常见错误(4):The type or namespace name 'DataContract' could not be found DataContract找不到
- 如何解决 The name ControlID does not exist in the current context 错误!
- The type or namespace name 'Service' does not exist 异常处理
- Unity使用FXMaker导致发布时报“The type or namespace name `UnityEditor' could not be found” 解决备忘
- Microsoft.Practices.Unity使用配置文件总是报错The type name or alias could not be resolved.
- 解决办法:The name 'Response' does not exist in the current context
- 错误码: 1630 FUNCTION count does not exist. Check the 'Function Name Parsing and Resolution' section in
- java.lang.UnsatisfiedLinkError,(A file or directory in the path name does not exist.
- The name does not exist in the namespace error in XAML
- 关于编写WPF UserControl时提示The name 'InitializeComponent' does not exist in the current contextr的解决!
- .net4 wpf App 使用log4net 错误:The type or namespace name 'log4net' could not be found (are you missing a using directive or an assembly reference?)