简体   繁体   English

命名空间“Microsoft”中不存在类型或命名空间名称“Practices”

[英]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:

  • run the self-extracting executable EnterpriseLibrary6-binaries.exe 运行自解压可执行文件EnterpriseLibrary6-binaries.exe
  • run download script in PowerShell: 在PowerShell中运行下载脚本:
    • start an Administrator command prompt 启动管理员命令提示符
    • navigate to the directory containing install-packages.ps1 导航到包含install-packages.ps1的目录
    • use the command 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.

相关问题 类型或名称空间名称“ Practices”在名称空间“ Microsoft”中不存在(您是否缺少程序集引用?) - The type or namespace name 'Practices' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) 名称空间名称“ Practices”不存在 - namespace name 'Practices' does not exist 命名空间“Microsoft.VisualBasic”中不存在类型或命名空间名称“FileIO” - The type or namespace name 'FileIO' does not exist in the namespace 'Microsoft.VisualBasic' 类型或名称空间名称“ DirectX”在名称空间“ Microsoft” Windows 8.1中不存在 - The type or namespace name 'DirectX' does not exist in the namespace 'Microsoft' Windows 8.1 命名空间“Microsoft”中不存在类型或命名空间名称“设备” - The type or namespace name 'Devices' does not exist in the namespace 'Microsoft' 命名空间“Microsoft”中不存在类型或命名空间名称“Bot”? - The type or namespace name 'Bot' does not exist in the namespace 'Microsoft'? 类型或名称空间名称“ FriendlyUrls”在名称空间“ Microsoft.AspNet”中不存在 - The type or namespace name 'FriendlyUrls' does not exist in the namespace 'Microsoft.AspNet' 命名空间“Microsoft”中不存在类型或命名空间名称“Reporting” - The type or namespace name 'Reporting' does not exist in the namespace 'Microsoft' 命名空间“Microsoft”中不存在类型或命名空间名称“TeamFoundation” - The type or namespace name 'TeamFoundation' does not exist in the namespace 'Microsoft' 命名空间“Microsoft”中不存在类型或命名空间名称“Azure” - The type or namespace name 'Azure' does not exist in the namespace 'Microsoft'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM