C# compiler csc.exe
Visual Basic .NET compiler vbc.exe
IL disassembler ildasm.exe
GUI debugger dbgclr.exe
.NET Framework Configuration Tool mscorcfg.msc
Assembly Cache Viewer sfushion.dll
Native Image Generator ngen.exe
Global Assembly Cache Utility gacutil.exe
Strong Name Tool sn.exe
Code Access Security Policy Tool caspol.exe
Web Service Description Language Tool wsdl.exe
( ... siehe "Die .NET-Architektur")
Assembly Cache Viewer (sfushion.dll)
*) see ".NET Architecture",Appendix A: important directories Windows Explorer Add-In that visualizes the Global Assembly Cache (GAC) like an ordinary directory
actual paths: e.g.
assembly mscorlib:GAC* \NativeImages1_v1.0.3705\mscorlib\ 1.0.3300.0__b77a5c561934e089_be4960bd\mscorlib.dll
assembly System:GAC* \GAC\System\1.0.3300.0__b77a5c561934e089\System.dll
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
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
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
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
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 directly Delay-Signing
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 . . .
...
Web Service Description Language Tool (wsdl.exe)
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 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
Comments