Visual Studio/Visual Studio Code로 .NET 5 기능 디버그
간단한 함수 만들기
1. 폴더를 만들고 dotnet 격리 런타임으로 새 함수를 만듭니다.
mkdir debugmyfunction
cd debugmyfunction
func new -n debugtest --worker-runtime dotnet-isolated
2. 원하는 대로 트리거를 선택합니다. 저는 HttpTrigger를 선택했습니다.

3. 테스트를 위해 func를 실행합니다.
func start

4. 테스트할 함수를 호출합니다.

Visual Studio로 시작 디버그
이후 프로세스에 연결할 수 있습니다.
func start
, 그러나 시작 논리를 디버그하려면 다음과 같이 할 수 있습니다.
1. --dotnet-isolated-debug 옵션을 추가하여 func를 실행합니다.
func start --dotnet-isolated-debug
2. Visual Studio로 이동하여 Program.cs에 중단점을 설정합니다.

3. 디버그 메뉴에서 프로세스에 연결...을 클릭합니다.

4. dotnet.exe를 찾아 첨부합니다. func,exe에 첨부하지 마십시오!

5. 이제 시작 디버그를 할 수 있습니다.

Visual Studio Code로 시작 디버그
Visual Studio Code로 F5를 수행하거나 Visual Studio와 동일한 프로세스를 사용할 수 있습니다.
F5 사용
F5 디버그가 작동하도록 하려면 .vscode 폴더에 launch.json만 있으면 됩니다. 시작을 디버그해야 하는 경우 --dotnet-isolated-debug를 지정하기 위해 tasks.json도 필요합니다.
발사.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to .NET Functions",
"type": "coreclr",
"request": "attach",
"processId": "${command:azureFunctions.pickProcess}"
}
]
}
작업.json
선택 과목.
{
"version": "2.0.0",
"tasks": [
{
"type": "func",
"options": {
"cwd": "${workspaceFolder}/bin/Debug/net5.0"
},
"command": "host start --dotnet-isolated-debug",
"isBackground": true,
"problemMatcher": "$func-dotnet-watch"
}
]
}
--dotnet-isolated-debug 사용
Visual Studio와 동일한 작업을 수행할 수도 있습니다.
1. --dotnet-isolated-debug 옵션을 추가하여 func를 실행합니다.
func start --dotnet-isolated-debug
2. Visual Studio Code로 이동하여 중단점을 설정합니다.

3. 디버그 메뉴로 이동하여 launch.json 파일 생성을 클릭합니다.

4. .NET 코어를 선택합니다.

5. 드롭다운에서 .NET Core 연결을 선택합니다.

6. F5 키를 누르고 dotnet.exe를 선택합니다.

7. 이제 디버깅할 수 있습니다.

디버깅을 즐기세요!!
Reference
이 문제에 관하여(Visual Studio/Visual Studio Code로 .NET 5 기능 디버그), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://dev.to/kenakamu/debug-net-5-function-with-visual-studio-visual-studio-code-5235
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
mkdir debugmyfunction
cd debugmyfunction
func new -n debugtest --worker-runtime dotnet-isolated
func start
이후 프로세스에 연결할 수 있습니다.
func start
, 그러나 시작 논리를 디버그하려면 다음과 같이 할 수 있습니다.
1. --dotnet-isolated-debug 옵션을 추가하여 func를 실행합니다.
func start --dotnet-isolated-debug
2. Visual Studio로 이동하여 Program.cs에 중단점을 설정합니다.

3. 디버그 메뉴에서 프로세스에 연결...을 클릭합니다.

4. dotnet.exe를 찾아 첨부합니다. func,exe에 첨부하지 마십시오!

5. 이제 시작 디버그를 할 수 있습니다.

Visual Studio Code로 시작 디버그
Visual Studio Code로 F5를 수행하거나 Visual Studio와 동일한 프로세스를 사용할 수 있습니다.
F5 사용
F5 디버그가 작동하도록 하려면 .vscode 폴더에 launch.json만 있으면 됩니다. 시작을 디버그해야 하는 경우 --dotnet-isolated-debug를 지정하기 위해 tasks.json도 필요합니다.
발사.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to .NET Functions",
"type": "coreclr",
"request": "attach",
"processId": "${command:azureFunctions.pickProcess}"
}
]
}
작업.json
선택 과목.
{
"version": "2.0.0",
"tasks": [
{
"type": "func",
"options": {
"cwd": "${workspaceFolder}/bin/Debug/net5.0"
},
"command": "host start --dotnet-isolated-debug",
"isBackground": true,
"problemMatcher": "$func-dotnet-watch"
}
]
}
--dotnet-isolated-debug 사용
Visual Studio와 동일한 작업을 수행할 수도 있습니다.
1. --dotnet-isolated-debug 옵션을 추가하여 func를 실행합니다.
func start --dotnet-isolated-debug
2. Visual Studio Code로 이동하여 중단점을 설정합니다.

3. 디버그 메뉴로 이동하여 launch.json 파일 생성을 클릭합니다.

4. .NET 코어를 선택합니다.

5. 드롭다운에서 .NET Core 연결을 선택합니다.

6. F5 키를 누르고 dotnet.exe를 선택합니다.

7. 이제 디버깅할 수 있습니다.

디버깅을 즐기세요!!
Reference
이 문제에 관하여(Visual Studio/Visual Studio Code로 .NET 5 기능 디버그), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://dev.to/kenakamu/debug-net-5-function-with-visual-studio-visual-studio-code-5235
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to .NET Functions",
"type": "coreclr",
"request": "attach",
"processId": "${command:azureFunctions.pickProcess}"
}
]
}
{
"version": "2.0.0",
"tasks": [
{
"type": "func",
"options": {
"cwd": "${workspaceFolder}/bin/Debug/net5.0"
},
"command": "host start --dotnet-isolated-debug",
"isBackground": true,
"problemMatcher": "$func-dotnet-watch"
}
]
}
func start --dotnet-isolated-debug
Reference
이 문제에 관하여(Visual Studio/Visual Studio Code로 .NET 5 기능 디버그), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/kenakamu/debug-net-5-function-with-visual-studio-visual-studio-code-5235텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)