.NET Reference Source

repository·main·Indexed 25 days ago

https://github.com/microsoft/referencesource

A read-only subset of the .NET Framework source code provided as a reference for .NET Core development and a resource for the developer community.

Tokens
761
Snippets
1
Records
5
Agent score
36%

What's inside .NET Reference Source

  1. Overview of .NET Reference Source

    main
    .NET Reference Source is a read-only repository containing a subset of the .NET Framework source code. This subset provides functionality similar to the class libraries developed in .NET Core. It is intended for community leverage and as a reference for .NET Core development.
  2. Regenerate System.Web.RegularExpressions.ilpp

    main

    Because the Razzle build window runtime is often outdated, you cannot reliably run RegexPreCompiler.exe from a Razzle window. To regenerate the System.Web.RegularExpressions.ilpp file, you must use a Suite window.

    Follow these steps:

    1. Modify ndp\fx\src\xsp\regcomp\RegexPrecompiler.cs.
    2. Build from ndp\fx\src\xsp\regcomp using a Razzle window.
    3. Open regexes\System.Web.RegularExpressions.ilpp for editing (using tf edit).
    4. Open a Suite window.
    5. Navigate to ndp\fx\src\xsp\regexes.
    6. Run the batch file RebuildRegExILFile.cmd to regenerate the .ilpp file.
    7. Return to a Razzle window, navigate to ndp\fx\src\xsp\regexes, and run build -c to build System.Web.RegularExpressions.dll.
    8. Check in the modified System.Web.RegularExpressions.ilpp.
  3. Configure RegexPreCompiler to use a specific runtime version

    main

    When running RegexPreCompiler from a Suite window, it defaults to the public runtime installed on the machine (typically a previously shipped RTM version). If you have modified the Regex engine in System.dll for the current release, these changes will not be effective unless you force the compiler to use your current runtime build.

    Replace v4.0.amd64chk in the examples below with your current runtime build install name (e.g., v4.0.x86chk).

    Option 1: Configuration File Create a RegexPreCompiler.exe.config file with the following content:

    <configuration>
      <startup>
        <supportedRuntime version="v4.0.amd64chk" />
      </startup>
    </configuration>

    Option 2: Environment Variables Set the following environment variables before running RegexPreCompiler and unset them afterward:

    set COMPLUS_DEFAULTVERSION=v4.0.amd64chk
    set COMPLUS_VERSION=v4.0.amd64chk
    # ... run RegexPreCompiler ...
    set COMPLUS_DEFAULTVERSION=
    set COMPLUS_VERSION=

    Option 3: ClrEnv Window Instead of using a Suite window, run RebuildRegExILFile.cmd from a ClrEnv window, which should have the correct environment configuration pre-set.

  4. License information for .NET Reference Source

    main
    Files in this repository are licensed under the MIT license unless otherwise specified in the file header. If a file header only contains a copyright notice (e.g., Copyright (c) Microsoft Corporation. All rights reserved.), it is assumed to be MIT-licensed.