1. Weakly Named Assembly vs Strong Named Assembly        Weakly named assemblies and strongly named assemblies are structurally identical—that is, they use the same portable executable (PE) file format, PE32(+) header, CLR header, metadata, manifest…
Two Kinds of Assemblies, Two Kinds of Deployment A strongly named assembly consists of four attributes that uniquely identify the assembly: a file name (without an extension), a version number, a culture identity, and a public key. Because public key…
the .NET Framework has in place to deal with versioning problems. Two Kinds of Assemblies, Two Kinds of Deployment weakly named assemblies . strongly named assemblies same:use the same portable executable (PE) file format, PE32(+) header, CLR header,…
As time marches on,MS developers and control developer modify their code:they fix bugs,patch security flaws,add features,and so on,whick contributes to the instability of windows The CLR supports two kinds of assemblies:weakly named assemblies and st…
1. C# Compiler - CSC.exe            csc.exe /out:Program.exe /t:exe /r:MSCorLib.dll Program.cs      This command line tells the C# compiler to emit an executable file called Program.exe (/out:Program.exe). The type of file produced is a Win32 console…
   Kinds of methods        Constructors      Type constructors      Overload operators      Type conversions (for implicit and explicit casting)      Extension methods      Partial methods.              1. Instance Constructors and Classes (Reference…
1. System.Object        The runtime requires every type to ultimately be derived from the System.Object type.        Because all types are ultimately derived from System.Object, you are guaranteed that every object of every type has a minimum set of…
1. Assemly       A managed module is a standard 32-bit Microsoft Windoes portable executable (PE32) file or a standard 64-bit Windows portable executable (PE32+) file that requires the CLR to execute.        Managed Module = IL + metadata.        Ass…
1. Constants        A constant is a symbol that has a never-changing value. When defining a constant symbol, its value must be determinable at compile time. The compiler then saves the constant’s value in the assembly’s metadata. This means that you…
1. Different Kinds  of Type Members        A type can define zero or more of the following kinds of members:        Constants           A constant is a symbol that identifies a never-changing data value        Fields           A field represents a re…
1. Primitive Types        Any data types the compiler directly supports are called primitive types.        Primitive types map directly to types existing in the Framework Class Library (FCL).        For the types that are compliant with the Common La…
一. 创建对象 CLR要求用new操作符创建对象,这个操作符在编译时产生的IL指令为newobj.例如: Student XiaoJing=new Student(“XiaoJing”,”1986”); 那么在创建过程中,究竟发生了什么事呢? 分配空间.在托管堆中分配该类所需要字节数的内存空间. 初始化对象的附加成员.每个对象有两个附加成员:一是指向类方法表的指针:二是SyncBlockIndex成员,CLR用该字段进行线程同步控制,某些位还可以用作垃圾回收标 记等等.CLR通过这两个成员管理对…
<西游记>中真假美猴王让人着实难以区分,但是我们熟知了其中的细节也不难把他们剥去表象分别出来.对问题不太关心的可以直接调到文中关于.Net文件版本的介绍 问题 最近在编译AKKA.net 时出现了一个问题:Newtonsoft.Json.dll 冲突. C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1819,5): warning MSB3243: No way to resolv…
转:http://www.yl1001.com/userzone.htm?doaction=article&art_id=5851381388387201 我们一般都知道,.NET Framework的GAC(global assembly cache)其实就是一个特殊的目录,如下图所示 再谈CLR:.NET Framework GAC目录构造    但是它内部到底是什么结构呢?    再谈CLR:.NET Framework GAC目录构造        很奇怪对吧?两个图完全不一样.不要惊讶…
原文 So...you're seeing a FileNotFoundException, FileLoadException, BadImageFormatException or you suspect an assembly loading failure? Try the steps below to start your debugging process. First, get the Message property from the exception. If the exce…
最近忙着看新还珠,好几天不学习了.玩物丧志啊,罪过罪过. 今天总结的是类构造器的知识,其实这方面的文章蛮多的,可还是觉得亲自写一下对自己的思考和认识会有提高. 对于构造器,大家应该都不陌生,它主要是用来进行初始化状态的.包括实例构造器和类构造器两种,先给大家看个实际的例子. class Dog : Animal { //字段 private string _name;         private int _age;         public string Name//属性       …
1. 源代码编译为托管模块 程序在.NET框架下运行,首先要将源代码编译为 托管模块.CLR是一个可以被多种语言所使用的运行时,它的很多特性可以用于所有面向它的开发语言.微软开发了多种语言的编译器,编译时会使用相应的编译 器进行语法检查器和代码分析器,在编译完成后都生成一个托管模块. 托管模块? 托管模块是一个需要CLR环境才能执行的标准windows PE文件,包含IL和元数据以及PE表头和CLR表头. IL又叫托管代码,是编译器编译源文件后产生的指令,CLR会在运行时将IL编译成本地CPU指…
现在项目的框架是在2015年设计的,那时候Ulua还处于1.03版本,现在回头再看,Ulua已经迭代到1.25版本,中间引入带有wraper的cstolua,而后转向现有的toLua#版本. 随着版本更新性能提升了很多(当然也看人为因素),代码的清晰度也越来越清晰,但是引入的项目本身可能不需要的东西越来越多,比如Gameobject.vector等等,这些并不在我们现有框架需求的范围内.所以在这次优化过程中并没有直接拿最新的toLua#来替换现在的Lua交互模块,而是将后续版本中能够改善现有性能…
An assembly is a collection of one or more files containing type definitions and resource files. One of the assembly’s files is chosen to hold a manifest. The manifest is another set of metadata tables that basically contain the names of the files th…
在学习.NET的时候,因为一些疑问,让我打算把.NET的类型篇做一个总结.总结以三篇博文的形式呈现. 这篇博文,作为三篇博文的第一篇,主要探讨了.NET Framework中的基本类型,以及这些类型一些重要的特性. 第二篇中,我会探讨.NET 是如何实现两个对象的比较的,其中会用到第一篇中的基础和结论. 第三篇,我从CLR中的常用容器出发,来探讨泛型以及它们背后的数据结构. 下面,我们从类型说起. Primitive, Reference and Value 首先将这三种类型放在一起是不科学的.…
将类型生成到模块中 class Program { static void Main(string[] args) { Console.WriteLine("Hi"); } } 该应用程序定义了program类型,其中有名为Main的public static方法.Main中引用了另一个类型System.Console.System.console是Microsoft实现好的类型,用于实现这个类型的各个方法的IL代码存储在MSCorLib.dll文件中.总之,应用程序定义了一个类型,还…
E原文地址:http://eli.thegreenplace.net/2011/11/03/position-independent-code-pic-in-shared-libraries/下一文:http://blog.chinaunix.net/uid-20682147-id-3772399.html I've described the need for special handling of shared libraries while loading them into the pr…
也许你编程的时候很小心,注意不引起内存泄露,例如不要被全局Static的变量引用上,注意Singleton的static引用,注意Event Handler注销,注意IDisposable接口实现,而且正确实现了IDisposable.但或许你还是有内存泄露,为何?因为你的IDisposable接口根本没有被触发!为什么?参考MSDN这个页面的”Dispose method not invoked ”章节.还有其它的内存泄露原因,比如第三方组件或框架,框架本身的内存泄露问题,已经框架本身有Lif…
控件封装的部分说明 可能有人觉得应该前后端分离,我也承认这是应该的方向,我们也在考虑使用ng2等简化前端.但是,我们封装控件还是因为如下原因综合考虑的: 我们这是个框架,上面支撑了许多个应用,包含几百个页面,每个页面都去写一堆的js\css\html标签可能对开发人员来说非常麻烦,且每个人写的都可能不一样.为了更简化中.低级开发人员的工作才提供的这种封装,个人认为这样才是简化和标准化开发的做法 像我们这里有datatable.文件上传等的控件,datatable就包含分页.超链.排序.格式化等等…
# This file contains command-line options that the C# # command line compiler (CSC) will process as part # of every compilation, unless the "/noconfig" option # is specified. #========================================== # Reference the common Fra…
Polly Polly is a .NET 3.5 / 4.0 / 4.5 / PCL (Profile 259) library that allows developers to express transient exception- and fault-handling policies such as Retry, Retry Forever, Wait and Retry or Circuit Breaker in a fluent manner. Installing via Nu…
什么是AppDomain? 我们都知道windows进程,它起到应用程序隔离的作用,带来的好处是,当某个进程发生错误的时候,不会影响其他的进程,系统也不会受到影响.但是,创建windows进程的代价是很大的..net推出AppDomain的作用也是隔离,如果能确保应用程序都是安全代码(managed code),那么appdomain其实就可以起到进程的作用.每个appdomain里有自己的堆,负责自己内部对象的创建和销毁,对象一般不能夸appdomain访问. 当应用程序启动,CLR加载后,会…
因为手头需要使用一个第三方类库,网络上又找不到它的可用的版本,于是只好自己动手.这个类库使用了Dotfuscator 加密,用.NET Reflector加载程序集, 看到的字符串是乱码,如下面的代码例子所示: internal class Program { // Methods private static void Main(string[] args) { int num2 = 4; try { List<string> expressionStack_51_0; string exp…
.Net内存泄露原因及解决办法 1.    什么是.Net内存泄露 (1).NET 应用程序中的内存 您大概已经知道,.NET 应用程序中要使用多种类型的内存,包括:堆栈.非托管堆和托管堆.这里我们需要简单回顾一下. 以运行库为目标的代码称为托管代码,而不以运行库为目标的代码称为非托管代码. 在运行库的控制下执行的代码称作托管代码.相反,在运行库之外运行的代码称作非托管代码.COM 组件.ActiveX 接口和 Win32 API 函数都是非托管代码的示例. COM/COM++组件,Active…
Dispose模式是.NET中很基础也很重要的一个模式,今天重新复习一下相关的东西并记录下来. 什么是Dispose模式? 什么时候我们该为一个类型实现Dispose模式 使用Dispose模式时应该注意什么? 怎样实现一个Dispose模式? Dispose模式的例子 什么是Dispose模式? 要知道什么是Dispose模式必须先了解两个概念:资源和GC的基本原理.资源指的是一些类似于Windows句柄,数据库连接的非内存的一些本地资源,这些资源无法被运行时本身管理,需要程序员自己去申请和释…