clr

Why do we so many kinds of assembly loading methods?

Hi, AFAIK, there're 3 methods to load an assembly into a AppDomain: Assembly.Load() Assembly.LoadFrom() Assembly.LoadFile() The LoadFrom() method takes the assembly filepath as its argument, but the filepath is merely providing the assembly identity information as a clue to the CLR. The LoadFrom() method still internally calls Load(...

What exactly is meant by Platform? How many versions of CLR & JVM are available?

Does platform mean the OS or the CLR,JVM & like that?? I heard that CLR & JVM differs from OS to OS.. So what different versions of JVM & also of CLR is availabe right now in market? (I think CLR is having only 1 version that is for windows only) pls clarify my this confusion as much as possible... ...

Is the Main method JIT'd?

As far I recall the function is JIT'd when it is called second time. What about the Main method? Would the code inside be JIT'd? If I mesure some chunk of code, should I wrapped it in a function? ...

Why isn't Microsoft branching C#, .NET, CLR for major changes (horizontal versioning)?

This isn't like new versions where newer versions will still have backwards compatibility. What I mean is something like, when the designers of C#, .NET, CLR realize that they made a mistake or they overlooked something that could be hugely beneficial but now they couldn't pursue it because of backwards compatibility, they could branch ...

Run-time Generation Compilation of CLR

Hi, I have a C# application which generates .NET functions at run-time and executes them. To do so, it generates C# in strings and calls the online C# compiler to convert it into CLR to be JIT compiled and executed. For performance reasons, I would like to be able to generate directly CLR (in strings or through an internal representati...

Troubleshooting Internal Error in the .NET Runtime

Several weeks ago, my company laptop started having some strange problems. I could no longer launch the Microsoft Developer Web Server (via Visual Studio->Debug). I later figured out that I couldn't execute any .NET application. In speaking with Microsoft CLR specialist after reviewing my dmp files, he said When loaded into yo...

SSCLI (Rotor) for the v4.0 clr?

Does anyone know if there is (or will be) an SSCLI release for the v4.0 runtime? ...

GetType returns diffent information than is operator uses

Cannot explain what is going on the following program. GetType is returning the type I want to return and not the original one. Does that mean we cannot rely on GetType? is operator is right though. Can anybody please explain it in detail? using System; namespace ConsoleApplication2 { public class MyClass { public Type ...

Binary Heap vs (new) B-Heap: Should it be implemented in the CLR/.NET, and where?

The following article discusses an alternative heap structure that takes into consideration that most servers are virtualized and therefore most memory is paged to disk. http://queue.acm.org/detail.cfm?id=1814327 Can (or should) a .NET developer implement a B-Heap data structure so that parent-child relationships are maintained within...

Question about Code Access Security (CAS).

Hi guys, I am studying the Code Access Security of .NET 2.0. My current understanding is as below: The basic mechanism of the CAS is for the CLR to collect certain evidences from the assembly, and then use the evidence and policy to work out a permission set for the assembly's code. And the assembly's code can do nothing beyond that pe...

Question about the working paradigm of Code Access Security (CAS)

Hi friends, I wrote the following code to test the CAS: [SecurityPermission(SecurityAction.Demand,Flags=SecurityPermissionFlag.Execution)] static void Main(string[] args) { Console.WriteLine("hello, world!"); } In the .NET 2.0 Configuration, I use the strong name of the above assembly to create a code group an...

Net Runtime Bug : .NET Runtime 2.0 Error - Event Id: 1000 Crashed my program. What caused this?

Hi, I have a new program which has been running 24/7 for over 2 weeks now but last night it crash/went down with no Fatal log exception in my log4net file ...the process appears to have been killed by someting .... and when I looked in the Windows Event Viewer Application log it contained an error for the programs process saying '.NET R...

does, myval = (someconditon) ? someVal : myval get optimized to not set the value in case it's false

CPath = (CPath == null) ? Request.Path : CPath; First of all I wish CLR would just let me do the ? Request.Path and not bother me with creating a : But I'm asking will it optimize it away? Or still assign. ...

Catching First Chance Exceptions in Managed Code without being debugged

Is there a way to catch First-Chance exceptions, and log them without running under a debugger? I suppose another way to ask the question is can I write something that will act like a debugger being attached to my process and see what is going wrong while it happens? ...

How is GetHashCode() implemented for Int32?

I've been looking all over the place, but I can't find anything. Can anyone shed some light on this? ...

What does the revision in the CLR v4.0.30319 encode?

My understanding is that the revision of "50727" in the v2.0 of the CLR encodes the date of the release build: 2005-07-27. If this is true, what does the 30319 encode? Note: my information comes from a blog of a member of the CLR team. Note 2nd comment on this blog post: http://blogs.msdn.com/b/abhinaba/archive/2005/10/28/486189.aspx. ...

What is the difference between the type String and type string? (Uppercase first letter)

Possible Duplicate: In C# what is the difference between String and string I couldn't find the info anywhere, but I'm sure it's just a simple answer. Are they interchangeable?? ...

LNK2022 Error When Using /clr

I'm having a problem linking a C++ project in VS2008 when using the /clr compile option. I am getting the following build errors: Class1.obj : error LNK2022: metadata operation failed (8013118D) : Inconsistent layout information in duplicated types (_PROPSHEETPAGEA): (0x0200046f). Class1.obj : error LNK2022: metadata operation failed (...

Fork Concept in C#

Since C# supports threading, is there any way to implement fork concept in C#? Thanks in advance.... ...

get 'ldftn' function pointer in C#

in cil code, ldftn is used to get the function pointer address to call the delegate constructor(i.e. .ctor(object, native int)). How to get the function pointer used to construct delegate in C#? ...