简体   繁体   English

Visual Studio的解决方案资源管理器

[英]Solution explorer of visual studio

In solution explorer of asp.net application we are adding something in References section for eg:in our project there are sample.Dal,sample.exeption ,system.core etc 在asp.net应用程序的解决方案资源管理器中,我们在“引用”部分添加了一些内容,例如:在我们的项目中,有sample.Dal,sample.exeption,system.core等

What is actually References means,,,can we add by 'using' statement 引用实际上是什么意思,可以通过“ using”语句添加

Using is used for namespace resolution. using用于名称空间解析。 For example: 例如:

using System.Data;

lets you access the DataSet class without typing in the fully qualified name; 使您无需输入标准名称即可访问DataSet类; System.Data.DataSet. System.Data.DataSet。

This doesn't however tell the compiler what assembly (DLL) the DataSet class lies in. So you need to tell it. 但是,这不会告诉编译器DataSet类所在的程序集(DLL)。因此,您需要告诉它。 So you refer to System.Data.dll by adding it to the references section in solution explorer. 因此,您可以通过将System.Data.dll添加到解决方案资源管理器中的“引用”部分来对其进行引用。

Yes, once you reference another project or assembly, it's namespaces and types are available for use in the project that references them (you must reference the project or assembly before you can use the types within it). 是的,一旦您引用了另一个项目或程序集,它的名称空间和类型就可以在引用它们的项目中使用(您必须先引用该项目或程序集,然后才能在其中使用类型)。

You can either use using declarations or fully-qualified type declarations to access the types, as in: 您可以使用using声明或完全限定的类型声明来访问类型,如下所示:

// Example1: The using keyword.
using System;

void Example1()
{
   Int32 myExample;
   // etc.
}

// Example2: Fully-qualified type.
void Example2()
{
   System.Int32 myExample;
   // etc.
}

Note: I have used C# here. 注意:我在这里使用过C#。

A reference references assemblies required for the current project. reference引用了当前项目所需的程序集。 Where using statements reference namespaces for the current file. using语句的地方引用当前文件的名称空间。

And yes, a referenced namespace must exist in one of the referenced assemblies. 是的,一个引用的名称空间必须存在于一个引用的程序集中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Visual Studio 解决方案资源管理器中禁用区分大小写 - disable case sensitive in visual studio solution explorer Visual Studio 2008解决方案资源管理器在尝试运行时会发疯 - Visual Studio 2008 Solution Explorer going crazy when trying to run Visual Studio未在解决方案资源管理器中显示我的.aspx文件 - Visual Studio not showing my .aspx file in Solution Explorer 解释解决方案资源管理器ASP.NET Visual Studio 2012 - Explaining the Solution Explorer ASP.NET Visual studio 2012 在Visual Studio解决方案资源管理器中显示这两个图标的ASP.NET网站之间的功能区别是什么? - What is the functional difference between ASP.NET websites displaying these two icons in Visual Studio solution explorer? Visual Studio 2015中的解决方案资源管理器菜单缺少jspm软件包和config.js - Solution explorer menu in Visual Studio 2015 is missing jspm packages and config.js Visual Studio“重建解决方案”错误 - Visual Studio 'Rebuild Solution' Errors 通用Visual Studio解决方案模板 - Generic Visual studio solution template 在Visual Studio 2005中复制解决方案 - Copy a solution in visual studio 2005 如何在visual studio中打开field explorer - How to open field explorer in visual studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM