-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to run and debug function app in VS Code #2071
Comments
Might be worth mentioning that this works as expected when creating a new v4 dotnet isolated app, hitting F5 builds and runs the function app without crashing |
I'm having this same issue with the GA release also ...
|
@nturinski might be able to help here. |
@nturinski please help ... hard to work without this |
I was able to debug with the template HTTP Trigger using .NET 6 without altering anything. My environment configuration is listed below. From the original post, the error seems like it's having an issue creating directories in the
|
Do people actually still use windows to dev? haha 😛 @nturinski You've built it as an isolated, which @liliankasem said does work. I believe we are both having problems with non-isolated (integrated? with the process worker). Also, its not a problem (for me) running the function host using core tools, it's that the vscode debugger attachment crashes... the func app keeps running, but vscode has no connection to it. I also should've been more clear with my environment, I'm on macOS.
The project is created entirely from the vscode new func project command, accepting all the defaults. debug_func.csproj <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.0.1" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="local.settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</None>
</ItemGroup>
</Project> local.settings.json {
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "<connectionStringToRealAzStorageAccount>",
"FUNCTIONS_WORKER_RUNTIME": "dotnet"
}
} launch.json {
"version": "0.2.0",
"configurations": [
{
"name": "Attach to .NET Functions",
"type": "coreclr",
"request": "attach",
"processId": "${command:azureFunctions.pickProcess}"
}
]
} settings.json {
"azureFunctions.deploySubpath": "bin/Release/net6.0/publish",
"azureFunctions.projectLanguage": "C#",
"azureFunctions.projectRuntime": "~4",
"debug.internalConsoleOptions": "neverOpen",
"azureFunctions.preDeployTask": "publish (functions)"
} tasks.json {
"version": "2.0.0",
"tasks": [
{
"label": "clean (functions)",
"command": "dotnet",
"args": [
"clean",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"type": "process",
"problemMatcher": "$msCompile"
},
{
"label": "build (functions)",
"command": "dotnet",
"args": [
"build",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"type": "process",
"dependsOn": "clean (functions)",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": "$msCompile"
},
{
"label": "clean release (functions)",
"command": "dotnet",
"args": [
"clean",
"--configuration",
"Release",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"type": "process",
"problemMatcher": "$msCompile"
},
{
"label": "publish (functions)",
"command": "dotnet",
"args": [
"publish",
"--configuration",
"Release",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"type": "process",
"dependsOn": "clean release (functions)",
"problemMatcher": "$msCompile"
},
{
"label": "launch",
"type": "func",
"dependsOn": "build (functions)",
"options": {
"cwd": "${workspaceFolder}/bin/Debug/net6.0"
},
"command": "host start",
"isBackground": true,
"problemMatcher": "$func-dotnet-watch"
}
]
} |
Nope, running vs code local on a mac and in-proc (no issues with the isolated template) |
Same here. macOS, azure-functions-core-tools@4, trying to debug the .NET 6 (non isolated) template: Screen.Recording.2021-12-13.at.11.22.04.mov |
Sorry for the late reply all-- I was out for the holidays. I'll start investigating this now. |
any updates on this @nturinski ? |
This issue is happening for dotnet-isolated functions in macOS Monterey 12.2 with M1 Pro chip. This workaround never worked. Any updates on a fix or workaround @nturinski ? |
Hi @Arash-Sabet For any M1 issues, the Core tools team has a roll-up issue tracking it here: Azure/azure-functions-core-tools#2834. Unfortunately, I'm not sure if there's anything we can do on the tooling side to fix this as we just core tools and attach. If you're not using an M1, I think that the workaround cited above should work. Sorry, we haven't had the bandwidth to implement this in the extension. I know this has been a major pain in the butt and has affected productivity. I'm really sorry about, we will try to get this resolved soon. |
@nturinski - it looks like dotnet/vscode-csharp#4903 is actually a duplicate of this issue. I'm at least not using M1. Is this a problem with the Azure Functions runtime or the OmniSharp language server? |
I've needed to refer back to @basilfx's workaround so often that I've turned it into a blog post here: https://johnnyreilly.com/debugging-azure-functions-vs-code-mac-os (credit attributed to @basilfx) |
I having the same problem @nturinski. I'm using an intel based mac 12.6.3, not M1. Exactly same problem. The signer workaround didn't work for me. This is indeed a pain in the but as we can't debug using VS Code. |
Huzzah! This fixed me, at least for now. Thank you for this blog post! Needing to litter the code with |
Function App name
N/A - local
Tools used
v1.5.2
dotnet --version
=6.0.100-rc.2.21505.57
func --version
=4.0.3780
New V4 app or existing V3 app migrated to V4
New v4 app - dotnet in-proc
Issue
After creating a new v4 app (.net v6 in-proc) using the functions VS Code extension, I am not able to run and debug the function app with the
.vscode
configuration that was added by the template. The application runs fine and as expected when using cli i.e.func start
. My assumption here is that the templated .vscode config is wrong?Expected
Pressing F5 in VS Code after a newly generated function app with VS Code config should build and run the function application in debug mode
Actual
Pressing F5 in VS Code after a newly generated function app with VS Code config builds and runs the function app, which then shuts down immediately after
The text was updated successfully, but these errors were encountered: