clr

In which CLR my code will execute?

Consider I am having two versions of .Net(.Net 1.1,2.0) in my developement machines. If I am deploying my application X against .Net 1.1 and deploying another applicatin Y agaings .Net 2.0 framework. Now I need to know in which CLR(1.1 or 2.0) my both applications will run? Also state me the reason? ...

advantages, disadvantages, and difficulties of writing a language to use .NET

I'm thinking about possibly designing/building a language at some point, and what are the advantages, disadvantages, and difficulties of writing it to run on the .NET framework/CLR? ...

.NET Object Executable Instructions Memory Consumption?

Hello Does anyone know if and object's executable code/instructions that are stored in memory by the CLR when creating it are stored once for every instance of such object? Or they are duplicated for each created instance? In other words, does the CLR stores once the Executable Instructions of an object and reuses that for every instan...

Why is there a difference in error handling clr procedures in sql server 2005?

I am using a clr procedure in one of my normal stored procs and i'm experiencing an odd error handling situation. Check the following code, it works as expected... BEGIN TRY create table #test(id varchar(2)) insert #test select '123' select * from #test END TRY BEGIN CATCH select 'an error occured but was handled' END CATCH Ho...

Can we construct an instance of `OpCode`?

The .NET Framework 4.0 introduces several items to the Reflection API that range from extremely useful to vital for my work. Among these are protected constructors for Assembly, Module, MethodBody, and LocalVariableInfo and the new CustomAttributeData class. There are a couple items I still need that are quite troublesome to work around....

The condition field (ARM ISA) and its applicability to managed code JIT

After working with the ARM instruction set for a bit after heavy X86 work in the past, I'm pondering something for the CIL AOT/JIT compiler I'm working on. My intermediate representation is a fixed-width expansion of the CIL byte code with a couple extra opcodes. Here's an example of a situation that arises in the JIT, and two possible s...

Mapping CLR Parameter Data

I am writing a stored procedure generator and I need to map CLR types to their SQL Server types. MSDN lists the type mappings at: http://msdn.microsoft.com/en-us/library/ms131092.aspx but I don't want to use a big switch statement to handle the mappings. Is there a simple way to retrieve the SQL Server type as a string using whatever p...

How many runtimes (CLRs) can be loaded in a single process?

I attended Virtual Tech Days today. In Quiz section there was the following question. "In the previous versions of .NET (before 4.0) how many runtimes (CLRs) can be loaded in a single process?" Any ideas? ...

Use of Different .Net Languages?

Is there a breakdown of the popularity of the different .Net languages available? Does anyone know of any surveys that give this information, or even if it is possible to determine this? Update The answer is not a list of the different .Net languages. I would like to see statistics showing the relative usage/popularity of each .Net...

Why is Thread.Join not letting through COM messages?

I am running some multi-threaded code that does the following. On an STA thread, I create a 'worker' thread, and run it. The STA thread then waits for the worker thread to exit. The worker thread calls a method on a proxy to an STA COM object on the STA thread, and then exits. In step 2, I'm using Thread.Join() to wait for the worke...

How can System.Object use sub-classes as its return types?

It is true in .NET that all types inherit from System.Object. What I find paradoxical, is a few methods on System.Object - namely public virtual string ToString(); public virtual bool Equals(object objA, object objB); System.String is inherited from System.Object: [Serializable] public class String : Object { /*...*/ } System.Boo...

.NET CLR InternalCall

Is there a way to host the .NET CLR runtime and register MethodImplOptions.InternalCall functions? (This is not a topic about P/Invoke) ...

Where does CLR store static classes?

Here a lot of people is confuse, Normal class store it's data in the heap right? And the reference(Pointer) to the stack. When the stack fall out of scope, Next time the GC(I bet you know what it's mean this time) kicks in and removes the memory from the heap. Now in case of static classes, the memory can't be clean by GC because it n...

In CLR, what is difference between a background and foreground thread ?

What is difference between a background and foreground thread ? ...

What is it called? I want to process the "events" that a CLR DLL produces

So I am a Visual Basic 6 developer moving over to CLR and need an answer to a real newb question. In Visual Basic 6, if you had an ActiveX control, you could reference that control and then have a statement essentially saying: Public WithEvents YourControl (Emphasis on the "WithEvents" keyword) What happen is that in Visual Basic you...

Ignore missing dependencies during ReflectionOnlyLoad

I am working on a simple class browser dialog that allows users to open an assembly and choose a static method from within. However, there are some situations where the assembly's dependencies are missing. Since I only need the method name and not its full prototype, is there any way to get past the FileNotFoundException that is raised ...

What's the "'1" for in class names sent from Reflection/CodeDom/CLR?

I can't remember exactly where I've seen this strange '1 (single-tick and the number 1) appearing next to classnames, but it's shown up when inspecting variable values while debugging and most recently in the answer to this question. targetClass.BaseTypes.Add(new CodeTypeReference { BaseType = "DataObjectBase`1[Refund]", Options = CodeT...

Loader lock (regsvr32 R6033 error) with managed C++ dll

I have a C++ dll which implements several COM interfaces, that I'm trying to migrate to managed C++. I set the /clr compiler flag and changed the Runtime Library property from /MT to /MD to avoid the conflict between these two flags, but that's all I've changed. When it attempts to register the dll during the build process, I get the f...

What's the size of a reference on the CLR

I was (purely out of curiosity) trying to find out what the size of an actual reference is when an allocation is made on the stack. After reading this I still don't know (this answers it only for value types or type definitions), and I still cannot seem to find it anywhere. So basically imagine a class as follows class A { string ...

Is it possible to host the CLR in a C program?

Every example I can find is in C++, but I'm trying to keep my project in C. Is it even possible to host the CLR in a C program? If so, can you point me to an example? ...