弄清.NET中复杂的文件类型()

在一个工程里以(.csproj.user),     (.csproj),     (.sln),     (.suo),     (.projdata),     (.scc)为后缀的文件都是些什么文件,有些什么用?查询了相关资料,作了如下总结:

解决方案文件(.sln   和   .suo)

Visual   Studio   .NET   采用两种文件类型(.sln   和   .suo)来存储特定于解决方案的设置。这些文件总称为解决方案文件,为解决方案资源管理器提供显示管理文件的图形接口所需的信息,从而使您每次继续开发任务时,都能够全身心地投入到项目和最终目标中,不会因开发环境而分散精力。   
    

扩展名名称说明    
  .sln   Visual   Studio.Solution   通过为环境提供对项目、项目项和解决方案项在磁盘上位置的引用,可将它们组织到解决方案中。    
  .suo   解决方案用户选项   记录所有将与解决方案建立关联的选项,以便在每次打开时,它都包含您所做的自定义设置。

 

以下是一篇老外写的,原文如下:

Make sense out of the confusing world of .NET file types

Takeaway: The .NET Framework's various file types can be a bit overwhelming when you're browsing a project's directory. Learn more about .NET and Visual Studio .NET's different files and their extensions.

 

Do you ever visit a public Web site and encounter a familiar file extension in the URL and immediately recognize what was used to develop the site? Most developers can relate to this situation. While HTML is the Internet standard, you may encounter .asp and wonder why the site developers are using old technology; if you spot .aspx, it may make you speculate on what version of ASP.NET the developers are using.

A recent conversation with a new .NET developer made me contemplate the many different file types for .NET and Visual Studio .NET (VS.NET). As a result, here is an overview of the various file types, with corresponding details on where and how they are used.

File types for VS.NET

Let's take a look at the files utilized by VS.NET, which is by far the most popular IDE for .NET development. The following list provides information about common files used by VS.NET (this list only covers C# and VB.NET):

  • .SLN: The VS.NET solution file. It includes information on what projects are included in the solution, as well as global build settings access via the solution properties window.
  • .SUO: The VS.NET solution user options file. It stores user-specific settings for the solution. The source control integration package in VS.NET uses this file to store enlistment translation tables for Web projects, the offline statuses of projects, and other settings used for project bindings.
  • .CSPROJ: A VS.NET C# project file. It contains project details such as references and includes, as well as name, version, guid, and so forth.
  • .CSPROJ.USER: The user options for a C# project.
  • .VBPROJ: A VS.NET VB.NET project file.
  • .VBPROJ.USER: The user options for a VB.NET project.

Common development files

Whether developing a Web site, Windows service, or Windows application, you may use the following file types:

  • .vb: File containing VB.NET source code.
  • .cs: File containing C# source code.
  • .xsd: XML schema definition file, a data definition standard for XML. You may use these files to work with data sets as well as classes.
  • .mdf: An empty SQL database for local data.
  • .xml: An XML file and a data standard.
  • .xslt: An XSLT file—a standard for transforming XML documents.
  • .cd: A class diagram file.
  • .js: A file containing JavaScript code.
  • .vbs: A file containing VBScript code.
  • .wsf: A file containing script that is run as a Windows program.
  • .config: An application configuration file that may be used to store application settings. ASP.NET uses this file to configure the Web settings for a Web project; it uses a name of Web.config, which you cannot change.
  • .resx: A file used to edit and define application resources.
  • .ico: An image file for creating a custom icon.
  • .rpt: A Crystal Reports file that may be published to a Web or Windows form.
  • .txt: A simple text file.

While you may use these files regardless of the project type, there are specific file types for certain projects. For instance, you'll use the following file types in Web development projects.

File types for ASP.NET

 

ASP.NET development uses specific file types depending on the resource used. The following list provides a good representation of the file types that you may encounter during ASP.NET development:

  • .aspx: A Web form that may include a code-behind file (.vb/.cs depending on the code used).
  • .asax: This file allows you to write code to handle global ASP.NET application-level events. The file has a name of global.asax, which you cannot change.
  • .ashx: A page for implementing a generic handler.
  • .asmx: An ASP.NET Web service; it may include a corresponding code-behind file as well that includes its code.
  • .htm: A standard HTML page.
  • .css: A Cascading Style Sheet that may be used within the site.
  • .sitemap: A Web application's site map.
  • .skin: A file used to define an ASP.NET theme that may be used in the site.
  • .browser: A browser definition file.
  • .disco: An optional file that acts as a discovery mechanism for the XML Web service. The .disco file is not automatically created for an XML Web service.
  • .ascx: A Web user control.

You may utilize other files that are not on this list depending on whether an application is compiled or how it is deployed.

Other files

If you choose to compile you application, an .exe file is created in the default bin subdirectory of the project's main directory. Along with the .exe file, a .pdb file is also included. A .pdb file holds debugging and project state information that allows incremental linking of a Debug configuration of your program. It is created during compilation, but you may disable it. Another file you may encounter is an .act file used by Application Center Test applications.

翻译

当你浏览一个工程目录时,总会感觉到.NET Framework的文件类型有点扑朔迷离。本文将让你对.NET和Visual Studio .NET的不同文件及其扩展有更深入的了解。

当你访问公共站点时看到URL中熟悉的文件扩展时,你一定立即认出该站点开发所使用的工具。虽然HTML是因特网的标准,然而你会经常碰到.asp并奇怪为何开发者使用这一古老的技术。如果你发现.aspx,你一定猜想程序员开发时使用的ASP.NET版本号。

最近与一位.NET开发人员的交流中让我想到,.NET与Visual Studio .NET(VS.NET)之间许多文件类型的差别。由此,这里概括了不同文件类型的作用,尤其给出它们不同场合时使用细节。

VS.NET的文件类型

现在让我们看看VS.NET使用的文件,VS.NET是当前最为流行的.NET开发的IDE。以下列表提供了有关VS.NET使用的通用文件(只涉及到C#和VB.NET):

  • .SLN: VS.NET 方案文件,包括:包含在解决方案中的项目信息,以及通过属性窗口访问全局构建设置。
  • .SUO: VS.NET方案用户选项文件。它用于存储特定用户的设置。VS.NET中的源控制集成包使用这一文件存储Web项目的转换表、项目的离线状态、以及其它项目构建的设置。
  • .CSPROJ:一个 VS.NET C#项目文件,它包括项目细节,比如参考内容、名称、版本等等 。
  • .CSPROJ.USER: C#项目的用户选项。
  • .VBPROJ:一个VS.NET VB.NET项目文件。
  • .VBPROJ.USER: VB.NET 项目的用户选项。

普通开发文件

当开发一个Web站点,Windows服务,或者Windows程序时,你可能会使用到以下的文件类型:

  • .vb:包含VB.NET 源代码的文件。
  • .cs:包含C#源代码的文件
  • .xsd: XML schema文件,即XML的数据定义标准。你可以使用这些文件处理数据集与类。
  • .mdf:一个本地数据的空SQL数据库。
  • .xml:一个XML文件与数据标准。
  • .xslt:一个XSLT文件,即转换XML文档的标准。
  • .cd:一个类图表文件。
  • .js:一个包含JavaScript代码的文件。
  • .vbs:一个包含VBScript代码的文件。
  • .wsf:一个包含可运行在Windows程序脚本的文件。
  • .config:一个可使用存储程序设置的程序配置文件。ASP.NET使用这一文件来配置Web设置,它使用到一个你无法更改的Web.config 文件。
  • .resx:用于编辑和指定程序来源的文件。
  • .ico:一个用于建立习惯图样的图象文件。
  • .rpt:可发布到Web或Windows窗体的Crystal Reports文件。
  • .txt:一个简单的文本文件。

然而你可以在不必考虑项目类型的情况下使用到这些文件。特定的项目有其对应的特定文件类型。例如,你可以在Web开发项目中使用以下文件类型。 

ASP.NET的文件类型

ASP.NET使用特定的文件类型。以下列表提供了文件类型说明,这些文件类型在ASP.NET开发中你都会遇到。

  • .aspx:包含代码分离(code-behind) 文件的Web窗体。
  • .asax:这一文件允许你编写代码以处理全局ASP.NET 程序事件。文件中包括一个无法更改的global.asax文件。
  • .ashx:执行一个通用句柄的页面。
  • .asmx:一个ASP.NET Web服务,包括相应的代码分离文件。
  • .htm:一个标准的HTML页。
  • .css:一种在站点上使用的层叠式列表。
  • .sitemap:一种Web程序的站点地图。
  • .skin:用于指定ASP.NETA theme 的文件。
  • .browser: 浏览器定义文件。
  • .disco:一种可选择的文件。
  • .ascx: Web用户控件。

你也可以使用列表中没有的其它文件,这取决于程序被编译与配置的方式。 

其它文件

如果你编译程序,在程序主路径的默认bin文件中将生成一个.exe文件。同时,也生成一个.pdb文件。这一.pdb文件包括编译与项目状态的信息。在编译过程中,这些文件自动生成,但你也可以在编译过程中对其控制而不让其生成。在编译过程你还会碰到另一文件,即被Application Center Test使用的.act文件。

现在,你已经对.NET Framework的文件类型有所了解。熟悉这些特定文件作用的优点是,如果文件丢失,你将可以重新生成这一文件。

本文作者Tony Patton的职业生涯始于应用程序开发员,并已经获得了Java、VB、Lotus和XML的认证,知识面非常宽广。

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值