Edition 0 Updated to asp. Net core 0


Testing and debugging containers with Visual Studio 2022



Yüklə 11,82 Mb.
Pdf görüntüsü
səhifə86/288
tarix12.07.2023
ölçüsü11,82 Mb.
#136458
1   ...   82   83   84   85   86   87   88   89   ...   288
NET-Microservices-Architecture-for-Containerized-NET-Applications

Testing and debugging containers with Visual Studio 2022 
When running and debugging the containers with Visual Studio 2022, you can debug the .NET 
application in much the same way as you would when running without containers. 
Testing and debugging without Visual Studio 
If you’re developing using the editor/CLI approach, debugging containers is more difficult and you’ll 
probably want to debug by generating traces. 
Additional resources 

Quickstart: Docker in Visual Studio.
https://learn.microsoft.com/visualstudio/containers/container-tools
 

Debugging apps in a local Docker container
https://learn.microsoft.com/visualstudio/containers/edit-and-refresh
 
Simplified workflow when developing containers with Visual Studio 
Effectively, the workflow when using Visual Studio is a lot simpler than if you use the editor/CLI 
approach. Most of the steps required by Docker related to the Dockerfile and docker-compose.yml 
files are hidden or simplified by Visual Studio, as shown in Figure 5-15. 


91 
CHAPTER 4 | Development process for Docker-based applications 
Figure 5-15. Simplified workflow when developing with Visual Studio 
In addition, you need to perform step 2 (adding Docker support to your projects) just once. Therefore, 
the workflow is similar to your usual development tasks when using .NET for any other development. 
You need to know what is going on under the covers (the image build process, what base images 
you’re using, deployment of containers, etc.) and sometimes you will also need to edit the 
Dockerfile 
or docker-compose.yml file to customize behaviors. But most of the work is greatly simplified by using 
Visual Studio, making you a lot more productive. 
Using PowerShell commands in a Dockerfile to set up Windows 
Containers 
Windows Containers
 allow you to convert your existing Windows applications into Docker images and 
deploy them with the same tools as the rest of the Docker ecosystem. To use Windows Containers
you run PowerShell commands in the Dockerfile, as shown in the following example: 

Yüklə 11,82 Mb.

Dostları ilə paylaş:
1   ...   82   83   84   85   86   87   88   89   ...   288




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin