1. Trang chủ
  2. » Công Nghệ Thông Tin

Essential .NET Tools

5 616 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 5
Dung lượng 66,84 KB

Nội dung

Essential .NET Tools

158Chapter 5CHAPTER 5Essential .NET ToolsThe .NET Framework SDK contains many useful programming tools. Here,in an alphabetical list, are those we have found most useful or necessary fordeveloping C# applications. Unless otherwise noted, the tools in this listcan be found either in the \bin directory of your .NET Framework SDKinstallation or in the %SystemRoot%\Microsoft.NET\Framework\VERSIONdirectory (replace VERSION with the framework version). Once the .NETFramework is installed, you can access these tools from any directory. Touse any of these tools, invoke a Command Prompt window and enter thename of the desired tool. For a complete list of the available command-lineswitches for any given tool, enter the tool name (e.g.,csc) and press theReturn or Enter key.ADepends.exe: assembly dependency listAdepends displays all assemblies that a given assembly is dependent on toload. This is a useful C# program found among the samples in the \ToolDevelopers Guide directory beneath the .NET Framework or Visual Stu-dio .NET directory tree. You need to install these samples before you canuse them, because they are not installed by default.Al.exe: assembly linking utilityCreates an assembly manifest from the modules and resources files youname. You can also include Win32 resources files. Here’s an example:al /out:c.dll a.netmodule b.netmoduleCorDbg.exe: runtime debuggerGeneral source-level, command-line debug utility for MSIL programs.Very useful tool for C# source debugging. Source for cordbg is availablein the \Tool Developers Guide directory.Csc.exe: C# compilerCompiles C# sources and incorporates resource files and separatelycompiled modules. Also allows you to specify conditional compilation,ch05.24722 Page 158 Wednesday, February 13, 2002 5:21 PM Essential .NET Tools|159options, XML documentation, and path information. Here are someexamples:csc foo.cs /r:bar.dll /win32res:foo.rescsc foo.cs /debug /define:TEMPDbgClr.exe: GUI debuggerWindows-based, source-level debugger. Available in the \GuiDebugdirectory of the .NET Framework SDK installation.GACUtil.exe: global assembly cache utilityAllows you to install, uninstall, and list the contents of the globalassembly cache. Here’s an example:gacutil /i c.dllILAsm.exe: MSIL assemblerCreates MSIL modules and assemblies directly from an MSIL textualrepresentation.ILDasm.exe: MSIL disassemblerDisassembles modules and assemblies. The default is to display a tree-style representation, but you can also specify an output file. Here aresome examples:ildasm b.dllildasm b.dll /out=b.asmInstallUtil.exe: installer utilityExecutes installers and uninstallers contained within the assembly. Alogfile can be written, and state information can be persisted.Ngen.exe: native image generatorCompiles an assembly to native code and installs a native image in thelocal assembly cache. That native image is used each time you access theoriginal assembly, even though the original assembly contains MSIL. Ifthe runtime can’t locate the native image, it falls back on JIT compila-tion. Here are some examples:ngen foo.exengen foo.dllnmake.exe: make utilityCommon utility that scripts building of multiple components andsource files and tracks rebuild dependency information. See Appendix Efor more information.PEVerify.exe: portable executable verifierVerifies that your compiler has generated type-safe MSIL. C# will alwaysgenerate type-safe MSIL. Useful interop with ILASM-based programs.,ch05.24722 Page 159 Wednesday, February 13, 2002 5:21 PM 160|Chapter 5: Essential .NET ToolsRegAsm.exe: register assembly toolRegisters an assembly in the system registry. This allows COM clients tocall managed methods. You can also use it to generate the registry filefor future registration. Here’s an example:regasm /regfile:c.reg c.dllRegSvcs.exe: register services utilityRegisters an assembly to COM+ 1.0, and installs its typelib into anexisting application. Can also generate a typelib. Here’s an example:regsvcs foo.dll /appname:comapp /tlb:newfoo.tlbSn.exe: shared name utilityVerifies assemblies and their key information. Also generates key files.Here’s an example:sn -k mykey.snkSoapSuds.exe: SoapSuds utilityCreates XML schemas for services in an assembly and creates assem-blies from a schema. You can also reference the schema via its URL.Here’s an example:soapsuds –url:http://localhost/myapp/app.soap?wsdl –os:app.xmlTlbExp.exe: type library exporterExports a COM typelibderived from the public types within the sup-plied assembly. Differs from regasm in that it doesn’t perform any regis-tration. Here’s an example:tlbexp /out:c.tlb c.dllTlbImp.exe: type library importerCreates a managed assembly from the supplied COM typelib, mappingthe type definitions to .NET types. You need to import this new assem-bly into your C# program for use. Here’s an example:tlbimp /out:MyOldCom.dll MyCom.tlbWsdl.exe: web services description language toolCreates service descriptions and generates proxies for ASP.NET web-service methods. See the ASP.NET documentation in the .NET Frame-work SDK for more detail on web services.WinCV.exe: windows class viewerSearches for matching names within a supplied assembly. If none aresupplied, it uses the default libraries. The namespaces and classes aredisplayed in a listbox, and the selected type information is displayed inanother window.,ch05.24722 Page 160 Wednesday, February 13, 2002 5:21 PM Essential .NET Tools|161Xsd.exe: XML schema definition toolGenerates XML schemas from XDR, XML files, or class information.Can also generate DataSet or class information from a schema. Here’san example:xsd foo.xdrxsd bar.dll,ch05.24722 Page 161 Wednesday, February 13, 2002 5:21 PM ,ch05.24722 Page 162 Wednesday, February 13, 2002 5:21 PM . 158Chapter 5CHAPTER 5Essential .NET ToolsThe .NET Framework SDK contains many useful programming tools. Here,in an alphabetical list, are. noted, the tools in this listcan be found either in the in directory of your .NET Framework SDKinstallation or in the %SystemRoot%Microsoft .NET FrameworkVERSIONdirectory

Ngày đăng: 20/08/2012, 12:06

TỪ KHÓA LIÊN QUAN

w