Skip to content

Commit ca7c7fa

Browse files
committed
Incorporate feedback round 2
1 parent cd3a134 commit ca7c7fa

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

docs/containers/container-build-from-command-line.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,20 @@ To build a containerized solution from the command line, you can usually use the
2424
docker build -f Dockerfile ..
2525
```
2626

27-
When you initially add Docker support to a project, you can provide a different folder for the build context. You can also set it in the project file by setting the `DockerfileContext` property. For example,
27+
You can set the build context in the project file by setting the `DockerfileContext` property. For example,
2828

2929
```xml
3030
<PropertyGroup>
3131
<DockerfileContext>contextfolder</DockerfileContext>
3232
</PropertyGroup>
3333
```
3434

35+
Relative paths in the Dockerfile are relative to the build context, so if you change the context, be sure to update the relative paths accordingly.
36+
37+
:::moniker range=">=vs-2022"
38+
With Visual Studio 17.11 and later, when you add Docker support to a project, you can specify a folder for the build context. If you want to change the build context, you could delete the Dockerfile (if it doesn't have other changes you want to keep), and rerun **Add Docker support**, this time specifying the new build context. The new Dockerfile will have relative paths updated to correspond to the new build context.
39+
:::moniker-end
40+
3541
## Use MSBuild
3642

3743
::: moniker range=">=vs-2022"

docs/containers/container-debug-customization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The process of running the debugger depends on the type of project and container
4444
|Scenario|Debugger process|
4545
|-|-|
4646
| **.NET Core apps (Linux containers)**| Visual Studio downloads `vsdbg` and maps it to the container, then it gets called with your program and arguments (that is, `dotnet webapp.dll`), and then debugger attaches to the process. |
47-
| **.NET Core apps (Windows containers)**| Visual Studio uses `msvsmon` or `onecoremsvsmon` and maps it to the container, runs it as the entry point and then Visual Studio connects to it and attaches to the program. This is similar to how you would normally set up remote debugging on another computer or virtual machine. The `onecoremsvsmon` version is only used in cases where `msvsmon` can't run, for example, in Windows Nano Server.|
47+
| **.NET Core apps (Windows containers)**| Visual Studio uses `msvsmon` or `onecoremsvsmon` and maps it to the container, runs it as the entry point and then Visual Studio connects to it and attaches to the program. This is similar to how you would normally set up remote debugging on another computer or virtual machine. |
4848
| **.NET Framework apps** | Visual Studio uses `msvsmon` and maps it to the container, runs it as part of the entry point where Visual Studio can connect to it, and attaches to the program.|
4949

5050
For information on `vsdbg.exe`, see [Offroad debugging of .NET Core on Linux and OS X from Visual Studio](https://github.com/Microsoft/MIEngine/wiki/Offroad-Debugging-of-.NET-Core-on-Linux---OSX-from-Visual-Studio).

docs/containers/container-entry-point.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Visual Studio uses a custom container entry point depending on the project type
2424
:::moniker range=">=vs-2022"
2525
|Container type|Entry point|
2626
|-|-|
27-
| **Linux containers** | The entry point is `dotnet --roll-forward Major /VSTools/DistrolessHelper/DistrolessHelper.dll --wait`. It's the debugger that is responsible to run the app (that is, `dotnet webapp.dll`), even when not debugging.|
27+
| **Linux containers** | For .NET 6 and later, the entry point is `dotnet --roll-forward Major /VSTools/DistrolessHelper/DistrolessHelper.dll --wait`. For .NET 5 and earlier, the entry point is `tail -f /dev/null`. These processes use an infinite wait to keep the container running when the app is not running. When the app is launched, with or without debugging, it's the debugger that is responsible to run the app (that is, `dotnet webapp.dll`) and keep the container running.|
2828
| **Windows containers**| The entry point is something like `C:\remote_debugger\x64\msvsmon.exe /noauth /anyuser /silent /nostatus` which runs the debugger, so it's listening for connections. For .NET Framework web apps, the entry point is slightly different where `ServiceMonitor` is added to the command.|
2929
:::moniker-end
3030

docs/containers/edit-and-refresh.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ This article illustrates how to use Visual Studio to start an app in a local Doc
1818

1919
If you already have a project of a supported type, Visual Studio can create a Dockerfile and configure your project to run in a container. See [Container Tools in Visual Studio](overview.md).
2020

21-
:::moniker range=">=vs-2022"
22-
Also, in Visual Studio 17.10 and later, [Hot Reload](../debugger/hot-reload.md) is supported in containers.
23-
:::moniker-end
24-
2521
## Prerequisites
2622

2723
To debug apps in a local Docker container, the following tools must be installed:
@@ -115,6 +111,12 @@ Often, changes require further inspection. You can use the debugging features of
115111
![Screenshot showing part of the code for Index.cshtml.cs in Visual Studio with a breakpoint set to the left of a code line that is highlighted in yellow.](media/edit-and-refresh/vs-2022/breakpoint.png)
116112
:::moniker-end
117113

114+
:::moniker range=">=vs-2022"
115+
## Hot reload
116+
117+
Also, in Visual Studio 17.10 and later, [Hot Reload](../debugger/hot-reload.md) is supported in containers, although be aware that in a container, you have to refresh the page to see changes. If the change is to a CSS file, you again have to refresh the page to see those changes. Note also that updates to scoped CSS files (`.razor.css` files, see [ASP.NET Core Blazor CSS isolation](/aspnet/core/blazor/components/css-isolation)) are not supported as part of hot reload.
118+
:::moniker-end
119+
118120
## Create a .NET Framework console app
119121

120122
This section presents how to debug a .NET Framework console app project in a local Docker container by first showing how to add Docker support to the project. It's important to recognize that different project types have different levels of Docker support. There are even different levels of Docker support for .NET Core (including .NET 5 and later) console app projects versus .NET Framework console app projects.

0 commit comments

Comments
 (0)