Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
]
},
"microsoft.visualstudio.slngen.tool": {
"version": "11.1.0",
"version": "12.0.15",
"commands": [
"slngen"
]
Expand Down
12 changes: 6 additions & 6 deletions docs/workflow/building/coreclr/nativeaot.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,22 @@ The compiler also has a mode where each managed assembly can be compiled into a

## Visual Studio Solutions

The repository has a number of Visual Studio Solutions files (`*.sln`) that are useful for editing parts of the repository. Build the repo from command line first before building using the solution files. Remember to select the appropriate configuration that you built. By default, `build.cmd` builds Debug x64 and so `Debug` and `x64` must be selected in the solution build configuration drop downs.
The repository has a number of Visual Studio Solutions files (`*.slnx`) that are useful for editing parts of the repository. Build the repo from command line first before building using the solution files. Remember to select the appropriate configuration that you built. By default, `build.cmd` builds Debug x64 and so `Debug` and `x64` must be selected in the solution build configuration drop downs.

Solutions related to this:

* `src\coreclr\nativeaot\nativeaot.sln`. This solution is for the runtime libraries.
* `src\coreclr\tools\aot\ilc.sln`. This solution is for the compiler.
* `src\coreclr\nativeaot\nativeaot.slnx`. This solution is for the runtime libraries.
* `src\coreclr\tools\aot\ilc.slnx`. This solution is for the compiler.

Typical workflow for working on the compiler:

* Open `ilc.sln` in Visual Studio
* Open `ilc.slnx` in Visual Studio
* Set "ILCompiler" project in solution explorer as your startup project
* Set Working directory in the project Debug options to your test project directory, e.g. `C:\test`
* Set Application arguments in the project Debug options to the response file that was generated by regular native aot publishing of your test project, e.g. `@obj\Release\net8.0\win-x64\native\HelloWorld.ilc.rsp`
* Build & run using **F5**

NOTE: this requires that you globally install the same .NET SDK version as the one that is used to build the repo. You can avoid this requirement by launching Visual Studio through the build.cmd script at the root of the repo. `build.cmd -vs src\coreclr\tools\aot\ilc.sln` opens the ILC solution, `build.cmd -vs nativeaot` opens the native AOT solution.
NOTE: this requires that you globally install the same .NET SDK version as the one that is used to build the repo. You can avoid this requirement by launching Visual Studio through the build.cmd script at the root of the repo. `build.cmd -vs src\coreclr\tools\aot\ilc.slnx` opens the ILC solution, `build.cmd -vs nativeaot` opens the native AOT solution.

## Convenience Visual Studio "repro" project

Expand All @@ -80,7 +80,7 @@ Typical native AOT runtime developer scenario workflow is to native AOT compile
The workflow looks like this:

* Build the repo using the Building instructions above
* Open the ilc.sln solution described above. This solution contains the compiler, but also an unrelated project named "repro". This repro project is a small Hello World. You can place any piece of C# you would like to compile in it. Building the project will compile the source code into IL, but also generate a response file that is suitable to pass to the AOT compiler.
* Open the ilc.slnx solution described above. This solution contains the compiler, but also an unrelated project named "repro". This repro project is a small Hello World. You can place any piece of C# you would like to compile in it. Building the project will compile the source code into IL, but also generate a response file that is suitable to pass to the AOT compiler.
* Make sure you set the solution configuration in VS to the configuration you just built (e.g. x64 Debug).
* In the ILCompiler project properties, on the Debug tab, set the "Application arguments" to `@$(ArtifactsBinDir)repro\$(TargetArchitecture)\$(Configuration)\compile-with-Release-libs.rsp`. The `@` at the front of the argument indicates that this is the path to the response file generated when "repro" was built. Adjust the "compile-with-Release-libs" part to "compile-with-Debug-libs" depending on how you built the libraries (the `-lc` argument to `build.cmd`). Visual Studio will expand the path to something like `@C:\runtime\artifacts\bin\repro\x64\Debug\compile-with-Release-libs.rsp`.
* Build & run ILCompiler using **F5**. This will compile the repro project into an `.obj` file. You can debug the compiler and set breakpoints in it at this point.
Expand Down
6 changes: 3 additions & 3 deletions docs/workflow/building/libraries/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ git pull upstream main & git push origin main
build.cmd clr+libs -rc Release
:: Performing the above is usually only needed once in a day, or when you pull down significant new changes.

:: If you use Visual Studio, you might open System.Collections.Concurrent.sln here.
:: If you use Visual Studio, you might open System.Collections.Concurrent.slnx here.
build.cmd -vs System.Collections.Concurrent

:: Switch to working on a given library (System.Collections.Concurrent in this case)
Expand Down Expand Up @@ -147,7 +147,7 @@ Similar to building the entire repo with `build.cmd` or `build.sh` in the root y
- Build all projects for a given library (e.g.: System.Collections) including running the tests

```bash
./build.sh -projects src/libraries/*/System.Collections.sln
./build.sh -projects src/libraries/*/System.Collections.slnx
```

- Build just the tests for a library project
Expand All @@ -157,7 +157,7 @@ Similar to building the entire repo with `build.cmd` or `build.sh` in the root y

- All the options listed above like framework and configuration are also supported (note they must be after the directory)
```bash
./build.sh -projects src/libraries/*/System.Collections.sln -f net472 -c Release
./build.sh -projects src/libraries/*/System.Collections.slnx -f net472 -c Release
```

As `dotnet build` works on both Unix and Windows and calls the restore target implicitly, we will use it throughout this guide.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Individual projects and libraries can be build by specifying the build configura
- Build all projects for a given library (e.g.: System.Net.Http) including the tests

```bash
./build.sh -os browser -c Release --projects <full-repository-path>/src/libraries/System.Net.Http/System.Net.Http.sln
./build.sh -os browser -c Release --projects <full-repository-path>/src/libraries/System.Net.Http/System.Net.Http.slnx
```

- Build only the source project of a given library (e.g.: System.Net.Http)
Expand Down
8 changes: 4 additions & 4 deletions docs/workflow/debugging/coreclr/debugging-runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ If for some reason `System.Private.CoreLib.dll` is missing, you can rebuild it w
Visual Studio's capabilities as a full IDE provide a lot of help making the runtime debugging more amiable.

0. Run `.\build.cmd clr.nativeprereqs -a <architecture> -c <configuration>`. This will build some of the tools requiremented for the native build. This step only needs to be run once as long you don't clean the `artifacts` directory.
1. Open the CoreCLR solution _(coreclr.sln)_ in Visual Studio.
1. Open the CoreCLR solution _(coreclr.slnx)_ in Visual Studio.
* _Method 1_: Use the build scripts to open the solution:
1. Run `.\build.cmd -vs coreclr.sln -a <architecture> -c <configuration>`. This will create and launch the CoreCLR solution in VS for the specified architecture and configuration. By default, this will be `x64 Debug`.
1. Run `.\build.cmd -vs coreclr.slnx -a <architecture> -c <configuration>`. This will create and launch the CoreCLR solution in VS for the specified architecture and configuration. By default, this will be `x64 Debug`.
* _Method 2_: Manually build and open the solution:
1. Perform a build of the repo with the `-msbuild` flag.
2. Open solution `path\to\runtime\artifacts\obj\coreclr\windows.<architecture>.<configuration>\ide\CoreCLR.sln` in Visual Studio. As in the previous method, the architecture and configuration by default are `x64` and `Debug`, unless explicitly stated otherwise.
2. Open solution `path\to\runtime\artifacts\obj\coreclr\windows.<architecture>.<configuration>\ide\CoreCLR.slnx` in Visual Studio. As in the previous method, the architecture and configuration by default are `x64` and `Debug`, unless explicitly stated otherwise.
2. Right-click the **INSTALL** project and choose `Set as StartUp Project`.
3. Bring up the properties page for the **INSTALL** project.
4. Select _Configuration Properties -> Debugging_ from the left side tree control.
Expand Down Expand Up @@ -114,7 +114,7 @@ Visual Studio can also be used to debug builds built externally from CLI scripts
5. To set breakpoints, runtime source files can to be added by right clicking the solution in the Solution Explorer and selecting Add -> Existing Item.
6. Set breakpoints and run the application with `F5` to start debugging.

Note, the `.sln` file can be saved and stores paths to `corerun.exe`, included files, and debug settings. It can be reused as long as the paths do not change.
Note, the `.slnx` file can be saved and stores paths to `corerun.exe`, included files, and debug settings. It can be reused as long as the paths do not change.

### Using Visual Studio Code

Expand Down
14 changes: 7 additions & 7 deletions docs/workflow/editing-and-debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ more on Markdown in general.

# Visual Studio Solutions

The repository has a number of Visual Studio Solutions files (`*.sln`) that are useful for editing parts of the repository. In particular
The repository has a number of Visual Studio Solutions files (`*.slnx`) that are useful for editing parts of the repository. In particular

* `src\coreclr\System.Private.CoreLib\System.Private.CoreLib.sln` - This solution is for all managed (C#) code that is defined
* `src\coreclr\System.Private.CoreLib\System.Private.CoreLib.slnx` - This solution is for all managed (C#) code that is defined
in the runtime itself. This is all class library support of one form or another.
* `artifacts\obj\coreclr\windows.<Arch>.<BuildType>\ide\CoreCLR.sln` - this solution contains most native (C++) projects
* `artifacts\obj\coreclr\windows.<Arch>.<BuildType>\ide\CoreCLR.slnx` - this solution contains most native (C++) projects
associated with the repository, including
* `coreclr` - This is the main runtime DLL (the GC, class loader, interop are all here)
* `corjit` - This is the Just In Time (JIT) compiler that compiles .NET Intermediate language to native code.
* `corerun` - This is the simple host program that can run a .NET application
* `crossgen` - This is the host program that runs the JIT compiler and produces .NET Native images (`*.ni.dll`)
for C# code.
* This project can be automatically generated and opened in Visual Studio by running `./build.cmd -vs CoreCLR.sln -a <Arch> -c <BuildType>` from the root of the repository.
* `artifacts\obj\win-<Arch>.<BuildType>\corehost\ide\corehost.sln` - this solution contains the native (C++) projects for the [host components](../design/features/host-components.md)
* This project can be automatically generated and opened in Visual Studio by running `./build.cmd -vs corehost.sln -a <Arch> -c <BuildType>` from the root of the repository.
* This project can be automatically generated and opened in Visual Studio by running `./build.cmd -vs CoreCLR.slnx -a <Arch> -c <BuildType>` from the root of the repository.
* `artifacts\obj\win-<Arch>.<BuildType>\corehost\ide\corehost.slnx` - this solution contains the native (C++) projects for the [host components](../design/features/host-components.md)
* This project can be automatically generated and opened in Visual Studio by running `./build.cmd -vs corehost.slnx -a <Arch> -c <BuildType>` from the root of the repository.

Thus opening one of these solution files (double clicking on them in Explorer) is typically all you need
to do most editing.

Notice that the CoreCLR and corehost solutions are under the `artifacts` directory. This is because they are created as part of the build.
Thus you can only launch these solutions after you have built at least once with the `-msbuild` flag or run the `./build.cmd -vs CoreCLR.sln` or `./build.cmd -vs corehost.sln` command line with the specified architecture and configuration.
Thus you can only launch these solutions after you have built at least once with the `-msbuild` flag or run the `./build.cmd -vs CoreCLR.slnx` or `./build.cmd -vs corehost.slnx` command line with the specified architecture and configuration.

* See [Debugging CoreCLR](debugging/coreclr/debugging-runtime.md)

Expand Down
2 changes: 1 addition & 1 deletion docs/workflow/requirements/windows-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Alternatively, if you would rather avoid modifying your machine state, you can u
.\build.cmd -vs System.Text.RegularExpressions
```

This will set the `DOTNET_ROOT` and `PATH` environment variables to point to the locally acquired SDK under the `.dotnet` directory found at the root of the repo for the duration of this terminal session. Then, it will launch the Visual Studio instance that is registered for the `.sln` extension, and open the solution you passed as argument to the command-line.
This will set the `DOTNET_ROOT` and `PATH` environment variables to point to the locally acquired SDK under the `.dotnet` directory found at the root of the repo for the duration of this terminal session. Then, it will launch the Visual Studio instance that is registered for the `.slnx` extension, and open the solution you passed as argument to the command-line.

## Installing dependencies with winget

Expand Down
2 changes: 1 addition & 1 deletion docs/workflow/testing/host/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ The `category!=failing` is to respect the [filtering traits](../libraries/filter

### Visual Studio

The [Microsoft.DotNet.CoreSetup.sln](/src/installer/Microsoft.DotNet.CoreSetup.sln) can be used to run and debug host tests through Visual Studio. When using the solution, the product should have already been [built](#building-tests) and the [test context](#test-context) set up.
The [Microsoft.DotNet.CoreSetup.slnx](/src/installer/Microsoft.DotNet.CoreSetup.slnx) can be used to run and debug host tests through Visual Studio. When using the solution, the product should have already been [built](#building-tests) and the [test context](#test-context) set up.

If you built the runtime or libraries with a different configuration from the host, you have to specify this when starting visual studio:

Expand Down
22 changes: 11 additions & 11 deletions eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function Get-Help() {
Write-Host " [Default: Minimal]"
Write-Host " -vs Open the solution with Visual Studio using the locally acquired SDK."
Write-Host " Path or any project or solution name is accepted."
Write-Host " (Example: -vs Microsoft.CSharp or -vs CoreCLR.sln)"
Write-Host " (Example: -vs Microsoft.CSharp or -vs CoreCLR.slnx)"
Write-Host ""

Write-Host "Actions (defaults to -restore -build):"
Expand Down Expand Up @@ -175,10 +175,10 @@ if ($vs) {
$configToOpen = $runtimeConfiguration
}

if ($vs -ieq "coreclr.sln") {
# If someone passes in coreclr.sln (case-insensitive),
if ($vs -ieq "coreclr.slnx") {
# If someone passes in coreclr.slnx (case-insensitive),
# launch the generated CMake solution.
$vs = Split-Path $PSScriptRoot -Parent | Join-Path -ChildPath "artifacts\obj\coreclr" | Join-Path -ChildPath "windows.$archToOpen.$((Get-Culture).TextInfo.ToTitleCase($configToOpen))" | Join-Path -ChildPath "ide" | Join-Path -ChildPath "CoreCLR.sln"
$vs = Split-Path $PSScriptRoot -Parent | Join-Path -ChildPath "artifacts\obj\coreclr" | Join-Path -ChildPath "windows.$archToOpen.$((Get-Culture).TextInfo.ToTitleCase($configToOpen))" | Join-Path -ChildPath "ide" | Join-Path -ChildPath "CoreCLR.slnx"
if (-Not (Test-Path $vs)) {
Invoke-Expression "& `"$repoRoot/eng/common/msbuild.ps1`" $repoRoot/src/coreclr/runtime.proj /clp:nosummary /restore /p:Ninja=false /p:Configuration=$configToOpen /p:TargetArchitecture=$archToOpen /p:ConfigureOnly=true /p:ClrFullNativeBuild=true"
if ($lastExitCode -ne 0) {
Expand All @@ -190,8 +190,8 @@ if ($vs) {
}
}
}
elseif ($vs -ieq "corehost.sln") {
$vs = Split-Path $PSScriptRoot -Parent | Join-Path -ChildPath "artifacts\obj\" | Join-Path -ChildPath "win-$archToOpen.$((Get-Culture).TextInfo.ToTitleCase($configToOpen))" | Join-Path -ChildPath "corehost" | Join-Path -ChildPath "ide" | Join-Path -ChildPath "corehost.sln"
elseif ($vs -ieq "corehost.slnx") {
$vs = Split-Path $PSScriptRoot -Parent | Join-Path -ChildPath "artifacts\obj\" | Join-Path -ChildPath "win-$archToOpen.$((Get-Culture).TextInfo.ToTitleCase($configToOpen))" | Join-Path -ChildPath "corehost" | Join-Path -ChildPath "ide" | Join-Path -ChildPath "corehost.slnx"
if (-Not (Test-Path $vs)) {
Invoke-Expression "& `"$repoRoot/eng/common/msbuild.ps1`" $repoRoot/src/native/corehost/corehost.proj /clp:nosummary /restore /p:Ninja=false /p:Configuration=$configToOpen /p:TargetArchitecture=$archToOpen /p:ConfigureOnly=true"
if ($lastExitCode -ne 0) {
Expand All @@ -208,24 +208,24 @@ if ($vs) {

if ($runtimeFlavor -eq "Mono") {
# Search for the solution in mono
$vs = Split-Path $PSScriptRoot -Parent | Join-Path -ChildPath "src\mono" | Join-Path -ChildPath $vs | Join-Path -ChildPath "$vs.sln"
$vs = Split-Path $PSScriptRoot -Parent | Join-Path -ChildPath "src\mono" | Join-Path -ChildPath $vs | Join-Path -ChildPath "$vs.slnx"
} else {
# Search for the solution in coreclr
$vs = Split-Path $PSScriptRoot -Parent | Join-Path -ChildPath "src\coreclr" | Join-Path -ChildPath $vs | Join-Path -ChildPath "$vs.sln"
$vs = Split-Path $PSScriptRoot -Parent | Join-Path -ChildPath "src\coreclr" | Join-Path -ChildPath $vs | Join-Path -ChildPath "$vs.slnx"
}

if (-Not (Test-Path $vs)) {
$vs = $solution

# Search for the solution in libraries
$vs = Split-Path $PSScriptRoot -Parent | Join-Path -ChildPath "src\libraries" | Join-Path -ChildPath $vs | Join-Path -ChildPath "$vs.sln"
$vs = Split-Path $PSScriptRoot -Parent | Join-Path -ChildPath "src\libraries" | Join-Path -ChildPath $vs | Join-Path -ChildPath "$vs.slnx"

if (-Not (Test-Path $vs)) {
$vs = $solution

# Search for the solution in installer
if (-Not ($vs.endswith(".sln"))) {
$vs = "$vs.sln"
if (-Not ($vs.endswith(".slnx"))) {
$vs = "$vs.slnx"
}

$vs = Split-Path $PSScriptRoot -Parent | Join-Path -ChildPath "src\installer" | Join-Path -ChildPath $vs
Expand Down
2 changes: 1 addition & 1 deletion eng/common/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function Print-Usage() {
Write-Host ""

Write-Host "Advanced settings:"
Write-Host " -projects <value> Semi-colon delimited list of sln/proj's to build. Globbing is supported (*.sln)"
Write-Host " -projects <value> Semi-colon delimited list of slnx/proj's to build. Globbing is supported (*.slnx)"
Write-Host " -ci Set when running on CI server"
Write-Host " -excludeCIBinarylog Don't output binary log (short: -nobl)"
Write-Host " -prepareMachine Prepare machine for CI run, clean up processes after build"
Expand Down
Loading
Loading