[英]The type or namespace name 'Practices' does not exist in the namespace 'Microsoft'
I am using Microsoft Visual Studio 2005 for c# I have the following namespace on my code 我正在使用Microsoft Visual Studio 2005进行c#我的代码上有以下命名空间
using Microsoft.Practices.EnterpriseLibrary;
using Microsoft.Practices.EnterpriseLibrary.AppSettings;
using Microsoft.Practices.EnterpriseLibrary.Data;
and I keep on getting this error: 我继续得到这个错误:
-The type or namespace name 'Practices' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) - 命名空间“Microsoft”中不存在类型或命名空间名称“实践”(您是否缺少程序集引用?)
What should I do? 我该怎么办?
Thanks in advance. 提前致谢。 :)
:)
As well as referencing the DLLs from the project, also make sure that the Target Framework in the project properties are at least as high as the Microsoft Enterprise Library version: 除了从项目引用DLL之外,还要确保项目属性中的Target Framework至少与Microsoft Enterprise Library版本一样高:
Also make sure it's not set to Client Profile (eg .NET Framework 3.5 Client Profile) otherwise you will also get the same error. 还要确保它没有设置为客户端配置文件(例如.NET Framework 3.5 Client Profile),否则您也会收到相同的错误。
As an aside, to download the Enterprise Library 6.0: 另外,要下载Enterprise Library 6.0:
EnterpriseLibrary6-binaries.exe
EnterpriseLibrary6-binaries.exe
install-packages.ps1
install-packages.ps1
的目录 powershell -ExecutionPolicy ByPass -File install-packages.ps1
powershell -ExecutionPolicy ByPass -File install-packages.ps1
For 5.0, you can download the MSI and use Universal Extractor if you don't want to install the DLLs. 对于5.0,如果您不想安装DLL,可以下载MSI并使用Universal Extractor 。
You should add a reference to the enterprise library from your project. 您应该从项目中添加对企业库的引用。 You can download the dlls here: http://msdn.microsoft.com/en-us/library/ff648951.aspx
你可以在这里下载dll: http : //msdn.microsoft.com/en-us/library/ff648951.aspx
当我将“目标框架”从“.Net Framework 4 Client Profile”更改为“.Net Framework 4”时,我解决了同样的问题。
Visual Studio 2005 only supports raw .NET 2.0 projects. Visual Studio 2005仅支持原始.NET 2.0项目。
You can see from this page that right now only a few releases are active, 您可以在此页面中看到,现在只有少数版本处于活动状态,
- Enterprise Library 6 - April 2013
企业图书馆6 - 2013年4月
- Enterprise Library 5.0 - April 2010
企业库5.0 - 2010年4月
- Enterprise Library 5.0 Integration Pack for Windows Azure - November 2011
适用于Windows Azure的Enterprise Library 5.0 Integration Pack - 2011年11月
- Enterprise Library 5.0 Integration Pack for Silverlight - May 2011
适用于Silverlight的Enterprise Library 5.0集成包 - 2011年5月
- Enterprise Library 4.1 - October 2008
企业图书馆4.1 - 2008年10月
Even for 4.1, Visual Studio 2008 and above is required . 即使对于4.1, 也需要Visual Studio 2008及更高版本 。
The last release supporting Visual Studio is the 3.1 release which is 6 years old. 支持Visual Studio的最后一个版本是6.1版 ,已有6年历史。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.