Questions tagged [clr]

The Common Language Runtime (CLR) is a core component of Microsoft's .NET initiative. It is Microsoft's implementation of the Common Language Infrastructure (CLI) standard, which defines an execution environment for program code. In the CLR, code is expressed in a form of bytecode called the Common Intermediate Language (CIL, previously known as MSIL—Microsoft Intermediate Language).

Developers using the CLR write code in a language such as C# or VB.NET. At compile time, a .NET compiler converts such code into CIL code. At runtime, the CLR's just-in-time compiler converts the CIL code into code native to the operating system. Alternatively, the CIL code can be compiled to native code in a separate step prior to runtime by using the Native Image Generator (NGEN). This speeds up all later runs of the software as the CIL-to-native compilation is no longer necessary.

Although some other implementations of the Common Language Infrastructure run on non-Windows operating systems, Microsoft's .NET Framework implementation runs only on Microsoft Windows operating systems.

Books

Articles

3930 questions
2
votes
1 answer

Windows Form designer (resx file) is not created when adding a new Form to the project

I recently started to work with Visual Studio 2019 (2015 had no problems like this one). I somehow created a primary Windows Form without any bugs. But after I tried to create another Windows Form in the same project (Sol Explorer->Add->New…
Perotto
  • 194
  • 1
  • 14
2
votes
1 answer

IL (Intermediate Language) Code in Native .NET Images

Consider a simple Console .NET app, that only contains the Visual Studio's auto-generated and empty Main method. As per Jeffrey Richter's "CLR via C#" in the context of mscorlib.dll: "This assembly is automatically loaded when the CLR initializes".…
Mihai Albert
  • 1,288
  • 1
  • 12
  • 27
2
votes
0 answers

.NET Profiling API initialization

I am trying to learn how to write a simple .net profiler using profiling API. For the first step, I just want to be able to load the profiler dll and to write to a log file from ICorProfilerCallback::Initialize. In a test .net console app I set…
pr12015
  • 67
  • 7
2
votes
0 answers

Creating a PE file using IMetaDataEmit::Save(/ToMemory/ToStream)

I'm writing a native CLR Profiler which does some heavy IL rewriting. When developing a new feature, we sometimes encounter a CLR verification error. For small methods, it's pretty easy to compare the bytes before and after, looking at the various…
Egozy
  • 380
  • 2
  • 13
2
votes
1 answer

How does CLR compile Q# code that uses or does not make use of qubits?

If a Q# operation does not use qubits or quatum specific gates, will then the CLR generate bytecode that will be executed by the CPU and not the QPU(quantum processor)?
2
votes
1 answer

managed and unmanaged

if a .net dll contains both managed and unmanaged code , how does the code will be converted to CIL and how CLR allocate and manages the memory
Raghav
  • 43
  • 3
2
votes
2 answers

what if i will copy a reference to an event object to another object and will change an event object afterwards?

I am reading a book about C# and CLR and a can`t understand one thing. The text going below: To fix this race condition, many developers write the OnNewMail method as follows: // Version 2 protected virtual void OnNewMail(NewMailEventArgs e) { …
2
votes
2 answers

Is C++CLI optimized?

If I write a program in C++CLI / managed C++, does the compiler perform any optimizations? I know that for C#, there are some optimizations done at compile time, with most optimizations being done by the JIT. Is the same true for C++CLI? A similar…
Verdagon
  • 2,456
  • 3
  • 22
  • 36
2
votes
1 answer

ODBC Excel SQL Condition

I need to build a SQL query to read an Excel file, through ODBC with the Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb). That query needs a conditional statement in the SELECT that expresses "if the column A from the page TA has the value x,…
user9658871
2
votes
1 answer

How to use multiple inheritance in the CLR?

I have come across a few sources like this that claim multiple inheritance (multiple base types) is actually supported in the CLR (but not in C# and other languages). Based on the method described in this article, it seems it's more of a trick than…
IS4
  • 11,945
  • 2
  • 47
  • 86
2
votes
2 answers

How many string object are created when using string concatenation in C#

I'm a beginner in C#, just have some question on string concatenation. string str = "My name is"; str += "John" Q1-Does C#(.NET) have the same concept string pool in Java? Q2- how many string object are created?
user9623401
2
votes
2 answers

Specifying SqlString length for a CLR stored procedure

I'm writing stored procedures in C# at the moment and I've run into a problem with the size of a parameter. So I've created a project in VS 2008 and created several stored procedures which all look a bit like this: public partial class…
2
votes
1 answer

Using a CREATEd ASSEMBLY causes SQL Server to hang permanently

this one's a bit difficult to explain, especially for a non-native english speaker: I want to use some elliptic-curve-based digital signature functions of the C# implementation of the BouncyCastle crypto library. I wrote a small C# wrapper class…
jlnme
  • 321
  • 1
  • 3
  • 4
2
votes
4 answers

CLR detected an invalid program with Entity Framework

I am retrieving data from a wordpress database which defines the primary key as decimal and I am using a x64 configuration on the project... The bit I searched I found out that it is the problem, but I couldn't find a solution. What do I have to…
BrunoLM
  • 97,872
  • 84
  • 296
  • 452
2
votes
2 answers

Does the CLR intern string constants?

Lately I've been reading up on how the string intern pool works. However I haven't been able to find the answer to this question. If I declare a constant string variable like const string STR = "foo";, does this also get added to the intern table?
MplsAmigo
  • 985
  • 6
  • 21
1 2 3
99
100