Command line environment learning C # Guide

zhaozj2021-02-17  33

The article on the online command line learning C # is trivial, so I am here to organize the procedure, convenient for everyone.

First, install

Prepare for work, the hit SP is good, MS requires Win2K installation service pack 3NT 4.0 To Service Pack 6AIIS to 5.0 or later then download and install on the MS website

1) Install Microsoft .NET Framework Redistributable packageDotNetfx.exe 20 M, the hard disk space required to install: 160 MB The hard disk space required: 70 MB This is the runtime environment of the .NET application

2) Install .NET Framework SDK Setup.exe 100 M installed hard disk space: 600 MB The hard disk space required: 370 MB This is the development environment, documentation and examples

3) Installing .NET Framework Language Pack (Optional) LangPack.exe 1M Multi-Site Description: Net Framework language package contains text translated into non-English language, such as the text, such as error message. Running the .NET Framework application in a non-English operating system does not need to install the language package; Multiple language packs can be installed on a single computer, each language packet.

Second, environment variable settings assume that you will install .NET Framework in the E: A environment variable batch file SDKVARS.BAT will be used in the E: / Program Files / Microsoft.net / SDK / V1.1 / BIN directory. Add it to your system environment variable or load when you open Console. I am used to the latter, the method is to copy a console shortcut to the desktop, right click, to the target to the% systemroot% / system32 / cmd.exe / k address / sdkvars.bat in the property; the start directory can be filled in Mill storage code directory. Because the long file name is not supported here, I usually copy SDKVARS.BAT to the root directory for convenience, so fill in% systemroot% / system32 / cmd.exe /ke:/sdkvars.bat . This time you double-click the icon, you can work in the command line.

Third, the command line tool is used

Use the text editor to edit your program, then use the command line to compile the use of the command line, below is an ordered section of the book, enough

The .NET Framework SDK contains many useful programming tools. Here, in an alphabetical list, are those we have found most useful or necessary for developing C # applications. Unless otherwise noted, the tools in this list can be found either in the / bin directory of your .NET Framework SDK installation or in the% SystemRoot% / Microsoft.NET / Framework / VERSION directory (replace VERSION with the framework version). Once the .NET Framework is installed, you can access these tools from any directory. To use any of these tools, invoke a Command Prompt window and enter the name of the desired tool. for a complete list of the available command-line switches for any given tool, enter the tool name (eg, csc) and press the Return or Enter key.ADepends.exe: assembly dependency listAdepends displays all assemblies that a given assembly is dependent on to load This is a useful C # program found among the samples in the / Tool Developers Guide directory beneath the .NET Framework or Visual Studio .NET. Directory Tree. You NEED TO INSTALL THESE SAMPLES BEFORE You CAN Use THEM, BECAUSE They area not installed by Default.

Al.exe: assembly linking utilityCreates an assembly manifest from the modules and resources files you name You canalso include Win32 resources files Here's an example:.. Al /out:c.dll a.netmodule b.netmodule

CorDbg.exe:.. Runtime debuggerGeneral source-level, command-line debug utility for MSIL programs Very useful tool for C # source debugging Source for cordbg is available in the / Tool Developers Guide directory.

Csc.exe:. C # compilerCompiles C # sources and incorporates resource files and separately compiled modules.Also allows you to specify conditional compilation options, XML documentation, and path information Here are some examples: csc foo.cs /r:bar.dll / win32res : foo.rescsc foo.cs / debug /define: tempdbgclr.exe: gui debuggerwindows-based, source-level debugger. Available in the / guidebug directory of the .net framework sdk installation.

Gacutil.exe: Global Assembly Cache UtilityAllows you to install, uninstall, and list the contents of the global assembly cache. Here's an example: gacutil / i c.dll

ILASM.EXE: MSIL AssemblerCreates Msil Modules and askEMBLIES DIRECTLY from an msil textual representation.

ILDasm.exe:.. MSIL disassemblerDisassembles modules and assemblies The default is to display a tree-stylerepresentation, but you can also specify an output file Here are some examples: ildasm b.dllildasm b.dll /out=b.asm

Installutil.exe: Installer UtilityExecutes Installers and Uninstallers Contained Wtembly. A logfile can be written, and state information can be beethisted.

Ngen.exe:. Native image generatorCompiles an assembly to native code and installs a native image in the local assembly cache That native image is used each time you access the original assembly, even though the original assembly contains MSIL If the runtime can not. Locate The Native Image, IT Falls Back on Jit Compiration. Here Are Some Examples: NGen foo.exengen foo.dll

NMAKE.EXE: Make UtilityCommon Utility That Scripts Building of Multiple Components and Source Files and TRACKS Rebuild Dependix E for more information.

PEVerify.exe: portable executable verifierVerifies that your compiler has generated typesafe MSIL C # will always generate typesafe MSIL Useful interop with ILASM-based programs.RegAsm.exe:.. Register assembly toolRegisters an assembly in the system registry This allows COM clients. TO Call Managed Methods. You Can Also Use It To Generate The Registry File for Future Registration. Here's An Example: Regasm /Regfile: C.REG C.DLL

RegSvcs.exe: register services utilityRegisters an assembly to COM 1.0, and installs its typelib into an existing application Can also generate a typelib Here's an example:.. Regsvcs foo.dll / appname: comapp /tlb:newfoo.tlb

Sn.exe: Shared name UtilityVerifies Assemblies and their key information. Also generates key files. Here's anexample: Sn -k mykey.snk

SoapSuds.exe:. SoapSuds utilityCreates XML schemas for services in an assembly and creates assemblies from aschema You can also reference the schema via its URL Here's an example:. Soapsuds-url: http: //localhost/myapp/app.soap wsdl? -OS: app.xml

TlbExp.exe: type library exporterExports a COM typelib derived from the public types within the supplied assembly Differs from regasm in that it does not perform any registration Here's an example:.. Tlbexp /out:c.tlb c.dll

TlbImp.exe:. Type library importerCreates a managed assembly from the supplied COM typelib, mapping the typedefinitions to .NET types You need to import this new assembly into your C # program for use Here's an example:. Tlbimp /out:MyOldCom.dll MyCom .tlb

Wsdl.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 Framework SDK for more detail on webservices.WinCV.exe: windows class viewerSearches for matching names within a supplied assembly. If none are supplied, it uses the default libraries. The namespaces and classes are displayed in a listbox, and the selected type information is displayed in another window.

XML Schema Definition ToolgeneraS XML Schemas from XDR, XML Files, or Class Information. CAN Also GeneratedTataset Or Class Information from A Schema. Here's An Example: XSD foo.xdrxsd bar.dll

Fourth, learning materials

Documentation, Samples, QuickStart Tutorials included with .NET Framework, are all good learning materials. In addition, there are a lot of good C # books on the Internet, because only the command line learning, so the following is a good book that books do not need vs.net; and more than Xie Xie is these Books have English e-books online, and also saves everyone to buy books home, but also cost the Chinese in the book. The pain of reverse engineering.

[ORELLY] CSHARP Essentials book is very thin, especially suitable for C / C programmers, simple outline

[OREILLY] Programming Csharp 2E involves vs.net

[Prentice Hall] Thinkin Csharp online has no book review, according to Java and C , it may be a key concept

[MS Press] Inside CSHARP Microsoft This series is a good entry to make your learning curve become smoother

[MS Press] programming.microsoft.windows.with.c # Charles Petzold's book, must be placed in hand often

转载请注明原文地址:https://www.9cbs.com/read-30567.html

New Post(0)