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

Python Shared Network, loadFromRemoteSources

I build my python code with pyarmor + nuitka so i get exe. Sharing this exe with shared network. But When exe tries to load dll (import clr) it gets Unhandled Exception: System.IO.FileLoadException: Failed to load the file 'file: // \\ 192.168.1.251…
Emrexdy
  • 156
  • 1
  • 2
  • 8
2
votes
0 answers

Are there two CLR modules for python?

I have been trying to use clr Addreference module and I keep getting the following error- AttributeError: module 'clr' has no attribute 'AddReference' I have installed pythonnet and so that is not the cause for this. I was looking into the clr…
2
votes
4 answers

Curiosity: Converting a C# struct into an object still copies it

This question is more out of curiosity than a real problem. Consider the following code (C# 4.0, if it matters): class Program { static Point myPoint = new Point(3, 5); static void Main(string[] args) { Console.WriteLine("Point Struct…
Sebastian Krysmanski
  • 8,114
  • 10
  • 49
  • 91
2
votes
0 answers

What specifically about double-checked locking fails without volatile in C#?

All around the 'net there's advice against doing this in C#: readonly object _lock = new object(); string _instance = null; public string Instance { get { if (_instance == null) { lock (_lock) { if…
Xenoprimate
  • 7,691
  • 15
  • 58
  • 95
2
votes
1 answer

Is numbers comparisons as uint faster than normal int in c#

I was looking how some of the .Net core libraries were implemented and one of many things that caught my eye was that in Dictionary class some numeric comparisons where done doing a casting to (uint) even though at my naive eyes this…
Luxant
  • 141
  • 1
  • 7
2
votes
2 answers

SyncHashtable this[Object key] does not use locking

I went through the implementation of SyncHashtable in defined in .Net framework BCL. This class provides synchronized access to multiple readers and writers. One of the methods is implemented as public override Object this[Object key] { …
2
votes
3 answers

SQL 2008 CLR and Bing Maps

I've developed a small C# application that will let me geocode a table of address using Bing's geocode service configured as a serivce reference. I have the assembly loaded but when I attempt to call it via stored procedure I received the following…
nickrobison
  • 150
  • 2
  • 14
2
votes
2 answers

Passing both stackalloc'ed Span and by-ref struct as arguments

I am using a SequenceReader to copy contents from a ReadOnlySequence into different Span. However, I get a compiler error when I try to encapsulate the copy logic into a separate function and want to call it with a Span allocated on the…
Bruno Zell
  • 7,761
  • 5
  • 38
  • 46
2
votes
4 answers

What's a good strategy? Testing with Mocks in C# without default Virtual

I ran into a pretty big short-coming with C# in regards to mocking and testing. And my solutions to the issue are undesirable. I have three classes that come together to perform some functionality. It doesn't make any sense to use interfaces or to…
Nicholas
  • 3,286
  • 5
  • 27
  • 35
2
votes
1 answer

"FatalExecutionEngineError was detected" when using Console.Writeline after redefining String.Empty

I'm trying (for fun) to redefine String.Empty to be a single space "". Why does this break the CLR framework? Message: The runtime has encountered a fatal error. The address of the error was at 0x5814b976, on thread 0xf40. The error code is…
Espo
  • 41,399
  • 21
  • 132
  • 159
2
votes
1 answer

1>LINK : fatal error LNK1104: cannot open file 'MSCOREE.lib'`

i keep getting this error 1>Main.obj : MSIL module encountered; incremental linking is disabled for MSIL; performing full link 1>LINK : fatal error LNK1104: cannot open file 'MSCOREE.lib' i have two phase disabled and i am using cli and clr on…
Comyar D
  • 172
  • 2
  • 9
2
votes
1 answer

Instrumentation Profiler in CoreCLR - Ways to Load HelperAssembly in to dotnet process

I am trying to Instrument .NET Core web applications that runs on .NET Core 3.1 using CoreCLR Profiler in linux centos7. I have set the environment values CORECLR_PROFILER , CORECLR_ENABLE_PROFILING and CORECLR_PROFILER_PATH, where my…
jay
  • 61
  • 2
2
votes
2 answers

Writing a Compiler for Numerical Linear Algebra

I’m working on a small project and main purpose of the project is to create a compiler for numerical liner algebra. The approach I’m planning is, Create the Compiler in Java Programming language That will generate native assembly codes I Will be…
Upul Bandara
  • 5,973
  • 4
  • 37
  • 60
2
votes
1 answer

Import error (E0337) while linking C++ and C++/CLI projects (.NET Core)

I am currently trying to set up a .NET project. I have a existing back project in c++ that I want to display on a web interface. To do this I am trying to link my C++ to the .NET platforme via a CLR Class Library .NET Core (and ultimately link that…
Irpie
  • 41
  • 2
  • 7
2
votes
1 answer

&& : Cannot use this indirection on type '_Ty'

I want to convert std::list to std::list and i get error that && : Cannot use this indirection on type '_Ty' with [ _Ty=System::String^ ] Is it possible to convert ? convert.h #pragma once #include
Serhan Erkovan
  • 481
  • 4
  • 18