Code Access Security is a CLR security system that is independent of the host system. It bases its security upon code and where the code comes from. Not who is running the code. So, privileges are given to code not users. It begins with what is called host evidence. When the CLR loader loads anContinue reading “.NET Code Access Security”
Category Archives: .NET Framework
.NET Threading and Tasks
Since creating and destroying threads is a costly set of operations, the CLR manages its own thread pool. There is one CLR thread pool per CLR. So if there is multiple versions of the CLR loaded in a process there are multiple CLR thread pools. Initially there are no threads in this thread pool. AsContinue reading “.NET Threading and Tasks”
.NET Language Integrated Query (LINQ)
As of C# 3.0 we have had a standard way of querying data through Language Integrated Query or LINQ for short. C# 3.0 introduces its query language as a first-class citizen. The querying are type checked by the C# compiler. C# 3.0 also introduced things like lamda expressions and extension methods et. al. Both ofContinue reading “.NET Language Integrated Query (LINQ)”
.NET and Component Services (COM+)
Running out of resources can be a big problem for distributed systems. Handling a large number of requests from a few clients may work but handling a few requests from a large number of clients is a big problem. We simply do not have the resources, like database connections, to handle the load. COM+ isContinue reading “.NET and Component Services (COM+)”
.NET Weak and Strong References
When it comes to garbage collection there are weak references and strong references. When a root points to an object in managed heap, a strong reference exists. A weak reference is actually its own type; WeakReference. A WeakReference allows the garbage collector to collect the object, but also to let it be accessed. It allContinue reading “.NET Weak and Strong References”
.NET Boxing and Unboxing
Value types have smaller memory footprint since they are not allocated on the managed heap, and as such does not have the additional fields – sync block index and type handle – and no reference to the field exists. Also not being a reference type, it does not get garbage collected. However, value types canContinue reading “.NET Boxing and Unboxing”
.NET Public Key and Assembly Signing
The CLR uses public keys for two reasons. 1) to uniquely identity the developer of the component and 2) to protect the component from tampering. Assemblies with public keys also has a digital signature. This signature provides a secure hash of the assembly manifest, which themselves contains hashes of all subordinate modules. Historically the CLRContinue reading “.NET Public Key and Assembly Signing”
.NET Assembly Loading
There are two main ways to programmatically load assemblies. You can use the assembly loader or the assembly resolver. The assembly loader uses System.Reflection.Assembly class’ LoadFrom static method. The assembly resolver uses the System.Reflection.Assembly class’ Load static method. The assembly loader loads a specified file i.e. from a file path like so: var assembly =Continue reading “.NET Assembly Loading”
.NET CLR Hosting
The CLR provides an unmanaged set of functions and COM interfaces called the CLR hosting API. An application that uses the CLR hosting API are called CLR hosts. CLR Hosting is about hosting the CLR in your native process and interacting with it to optimize the CLR. Examples of applications that also are CLR hosts:Continue reading “.NET CLR Hosting”
.NET PE32 File Format
The file format for CLI components is a strict extension of the current Portable Executable (PE) file format. This extended PE32 format enables the operating system to recognize runtime images, accommodates code emitted as CIL or native code, and accommodates runtime metadata as an integral part of the emitted code. The following picture shows theContinue reading “.NET PE32 File Format”