Download presentation
Presentation is loading. Please wait.
1
.NET Framework Tools Albrecht Wöß Institute for System Software Johannes Kepler University Linz © University of Linz, Institute for System Software, 2004 published under the Microsoft Curriculum License
2
A. Woess.NET Framework Tools2 Overview csc.exeC# compiler csc.exe vbc.exeVisual Basic.NET compiler vbc.exe ildasm.exeIL disassembler ildasm.exe dbgclr.exeGUI debugger dbgclr.exe mscorcfg.msc.NET Framework Configuration Tool mscorcfg.msc sfushion.dllAssembly Cache Viewer sfushion.dll ngen.exeNative Image Generator ngen.exe gacutil.exeGlobal Assembly Cache Utility gacutil.exe sn.exeStrong Name Tool sn.exe caspol.exeCode Access Security Policy Tool caspol.exe wsdl.exeWeb Service Description Language Tool wsdl.exe (... siehe "Die.NET-Architektur")
3
A. Woess.NET Framework Tools3 Assembly Cache Viewer (sfushion.dll) Windows Explorer Add-In that visualizes the Global Assembly Cache (GAC) like an ordinary directory actual paths: e.g. GAC –assembly mscorlib: GAC* \NativeImages1_v1.0.3705\mscorlib\ 1.0.3300.0__b77a5c561934e089_be4960bd\mscorlib.dll GAC –assembly System: GAC* \GAC\System\1.0.3300.0__b77a5c561934e089\System.dll *) see ".NET Architecture", Appendix A: important directories
4
A. Woess.NET Framework Tools4 Native Image Generator (ngen.exe) generates a native image (= a tranlation to machine code) of an assembly thus the assembly is compiled only once on the target computer at install time (= install-time compilation); no need for new compilations on every program run (= just-in-time (JIT) compilation) core assemblies of the.NET Framework are installed as native images per default: mscorlib, System, System.Drawing, System.Windows.Forms,... file size comparison: PE file native image: e.g. System.dll 1.216.512 Bytes as IL assembly 1.929.216 Bytes as native image
5
A. Woess.NET Framework Tools5 Global Assembly Cache Utility (gacutil.exe) Command line tool for installing assemblies in the GAC > gacutil -i GlobalLib.dll removing assemblies from the GAC > gacutil -u GlobalLib displaying the contents of the GAC > gacutil -l supports counting the references to global assemblies > gacutil -ir GlobalLib.dll FILEPATH c:\Apps\MyApp.exe > gacutil -ur GlobalLib FILEPATH c:\Apps\MyApp.exe > gacutil -lr –the assembly cannot be removed from the GAC, while at least one reference to it still exists
6
A. Woess.NET Framework Tools6 Strong Name Tool (sn.exe) Command line tool for generating pairs of private & public keys > sn -k mykeys.snk extracting the public key from a key pair > sn -p mykeys.snk mypubkey.snk delayed signing of assemblies > sn -R MyLib.dll mykeys.snk
7
A. Woess.NET Framework Tools7 Strong Name for Assemblies "strong" assembly name consists of: –name –version number ( major.minor.build.revision ) –culture attribute (usually neutral ) –hash value of the public key z.B. MyLib, Version=1.2.745.18000, Culture=en-US, PublicKeyToken=13a3f300fff94cef Why sign an assembly? –only names of signed assembly are considered "strong" –only signed assemblies can be installed into the GAC
8
A. Woess.NET Framework Tools8 Delay-Signing sn -k mykeys.snk [assembly: AssemblyKeyFile("mykeys.snk")] MyLib.cs csc /t:library MyLib.cs sn -p mykeys.snk mypubkeys.snk csc /t:library MyLib.cs sn -R MyLib.dll mykeys.snk [assembly: AssemblyKeyFile("mypubkeys.snk")] [assembly: AssemblyDelaySign(true)] MyLib.cs MyLib.dll (signed) sign directlyDelay-Signing
9
A. Woess.NET Framework Tools9 Code Access Security Policy Tool (caspol.exe) Command line tool for turning security checks on and off > caspol -security ( on | off ) adding/removing/changing/listing code groups > caspol -addgroup > caspol -remgroup > caspol -chggroup > caspol -listgroups adding/removing/changing/listing permission sets > caspol -addpset > caspol -rempset > caspol -chgpset > caspol -listpset... commands target enterprise/machine/user security policy level > caspol -enterprise / -machine / -user / -all......
10
A. Woess.NET Framework Tools10 Web Service Description Language Tool (wsdl.exe) Command line tool for generating web service proxies from WSDL files > wsdl -language:VB > wsdl -namespace:TimeClient > wsdl -out:TimeServiceProxy.cs > wsdl http://dotnet.jku.at/time/TimeService.asmx?WSDL public class TimeService : System.Web.Services.Protocols.SoapHttpClientProtocol { public TimeService() { this.Url = "http://dotnet.jku.at/time/TimeService.asmx"; } public string GetTime() { object[] results = this.Invoke("GetTime", new object[0]); return ((string)(results[0])); } TimeService.cs
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.