Is there a way to "delete" the CLR in C#

swodniW 141 Reputation points
2021-08-03T12:04:32.087+00:00

Hello everybody.
Is there a way, to "do not use" the CLR during runtime of C# file?
Thanks in advance

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,391 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Michael Taylor 49,251 Reputation points
    2021-08-03T14:22:50.03+00:00

    The CLR is the runtime. If you have no runtime exactly how would a .NET app run? You literally would have deleted the runtime that the app needs to run. It would be equivalent to running a Windows app without Windows.

    What exactly is your goal? Are you trying to get a xcopy-style app that doesn't require the runtime to be installed? If so then look into a .NET Core/5 self-contained deployment here.

    0 comments No comments

  2. Sam of Simple Samples 5,516 Reputation points
    2021-08-03T17:50:50.79+00:00

    See Common Language Runtime (CLR) overview - .NET. It refers to the Common Language Infrastructure (CLI). The CLI is the standard and the CLR is Microsoft's implementation of it. The C# Language Standard (version 5.0): ECMA-334.pdf (Annex C. Standard library) says:

    A conforming C# implementation shall provide a minimum set of types having specific semantics. ... For a formal
    definition of these types and their members, refer to ISO/IEC 23271:2012 Common Language
    Infrastructure (CLI)

    The C# language standard requires the CLR or an equivalent.

    0 comments No comments

  3. Lex Li (Microsoft) 4,742 Reputation points Microsoft Employee
    2021-08-04T05:11:39.22+00:00

    Not sure what you want to achieve by using C# without CLR. Your only option is to use RemObjects' C# that allows you to use other runtimes (like Java, native Win32 and WebAssembly) instead of .NET CLR,

    https://www.elementscompiler.com/elements/hydrogene/

    0 comments No comments