Visual Studio/Visual Studio Code로 .NET 5 기능 디버그
간단한 함수 만들기
1. 폴더를 만들고 dotnet 격리 런타임으로 새 함수를 만듭니다.
mkdir debugmyfunction
cd debugmyfunction
func new -n debugtest --worker-runtime dotnet-isolated
2. 원하는 대로 트리거를 선택합니다. 저는 HttpTrigger를 선택했습니다.
![](https://s1.md5.ltd/image/27a9b970ce3cdc437dee9a8f0c2024b7.png)
3. 테스트를 위해 func를 실행합니다.
func start
![](https://s1.md5.ltd/image/bc718699616865296c06a10731cf0137.png)
4. 테스트할 함수를 호출합니다.
![](https://s1.md5.ltd/image/2eaeacdd1cedd9030ac9ea7dffc685eb.png)
Visual Studio로 시작 디버그
이후 프로세스에 연결할 수 있습니다.
func start
, 그러나 시작 논리를 디버그하려면 다음과 같이 할 수 있습니다.
1. --dotnet-isolated-debug 옵션을 추가하여 func를 실행합니다.
func start --dotnet-isolated-debug
2. Visual Studio로 이동하여 Program.cs에 중단점을 설정합니다.
![](https://s1.md5.ltd/image/68a5be39403125cd57b7918737df0719.png)
3. 디버그 메뉴에서 프로세스에 연결...을 클릭합니다.
![](https://s1.md5.ltd/image/f6352a9d6a3a3d2d5f44a0bdae47545a.png)
4. dotnet.exe를 찾아 첨부합니다. func,exe에 첨부하지 마십시오!
![](https://s1.md5.ltd/image/c1847116648adeea14104d8380dbecb7.png)
5. 이제 시작 디버그를 할 수 있습니다.
![](https://s1.md5.ltd/image/2e6e5438fd450f2e4fc539d107a40cce.png)
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로 이동하여 중단점을 설정합니다.
![](https://s1.md5.ltd/image/9483427af6f877183aa9a6c3ab5887fd.png)
3. 디버그 메뉴로 이동하여 launch.json 파일 생성을 클릭합니다.
![](https://s1.md5.ltd/image/678175048ed90359f81778c22c86b863.png)
4. .NET 코어를 선택합니다.
![](https://s1.md5.ltd/image/e9249c22ccc9f903064e407073caf35f.png)
5. 드롭다운에서 .NET Core 연결을 선택합니다.
![](https://s1.md5.ltd/image/61a9637657f6440f9a13650a582cb1cf.png)
6. F5 키를 누르고 dotnet.exe를 선택합니다.
![](https://s1.md5.ltd/image/a772a02ee64ef0aec10774edafa4cbc4.png)
7. 이제 디버깅할 수 있습니다.
![](https://s1.md5.ltd/image/56cb702b8083bf8a06be453337e9a412.png)
디버깅을 즐기세요!!
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에 중단점을 설정합니다.
![](https://s1.md5.ltd/image/68a5be39403125cd57b7918737df0719.png)
3. 디버그 메뉴에서 프로세스에 연결...을 클릭합니다.
![](https://s1.md5.ltd/image/f6352a9d6a3a3d2d5f44a0bdae47545a.png)
4. dotnet.exe를 찾아 첨부합니다. func,exe에 첨부하지 마십시오!
![](https://s1.md5.ltd/image/c1847116648adeea14104d8380dbecb7.png)
5. 이제 시작 디버그를 할 수 있습니다.
![](https://s1.md5.ltd/image/2e6e5438fd450f2e4fc539d107a40cce.png)
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로 이동하여 중단점을 설정합니다.
![](https://s1.md5.ltd/image/9483427af6f877183aa9a6c3ab5887fd.png)
3. 디버그 메뉴로 이동하여 launch.json 파일 생성을 클릭합니다.
![](https://s1.md5.ltd/image/678175048ed90359f81778c22c86b863.png)
4. .NET 코어를 선택합니다.
![](https://s1.md5.ltd/image/e9249c22ccc9f903064e407073caf35f.png)
5. 드롭다운에서 .NET Core 연결을 선택합니다.
![](https://s1.md5.ltd/image/61a9637657f6440f9a13650a582cb1cf.png)
6. F5 키를 누르고 dotnet.exe를 선택합니다.
![](https://s1.md5.ltd/image/a772a02ee64ef0aec10774edafa4cbc4.png)
7. 이제 디버깅할 수 있습니다.
![](https://s1.md5.ltd/image/56cb702b8083bf8a06be453337e9a412.png)
디버깅을 즐기세요!!
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.)