Fix func start dotnet-isolated extension loading when project has a custom OutputPath#4927
Open
Fix func start dotnet-isolated extension loading when project has a custom OutputPath#4927
Conversation
When running func start from the project root, dotnet build was always invoked with --output bin/output, which overrides $(OutDir) but can leave the Functions SDK MSBuild targets writing .azurefunctions to the original $(OutputPath) location. This causes the host to see DotnetIsolatedApp: False and load extensions from the wrong path. Changes: - Add TryGetBuildOutputPathAsync to DotnetHelpers.cs: evaluates the project's OutputPath MSBuild property without running a full build - Modify BuildDotnetProject to accept null outputPath, in which case it runs dotnet build without --output (uses the project's own path) - Add honorProjectOutputPath parameter to BuildAndChangeDirectory: when true, uses the project's actual OutputPath and falls back to bin/output if evaluation fails - Update StartHostAction.PreRunConditions to pass honorProjectOutputPath: true so func start respects custom OutputPath - Add unit test for TryGetBuildOutputPathAsync null-project-file case Agent-Logs-Url: https://github.com/Azure/azure-functions-core-tools/sessions/854e692e-04e3-41a1-90a5-01492d7aab54 Co-authored-by: liliankasem <2198905+liliankasem@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix func start command to load Function Extensions correctly
Fix func start dotnet-isolated extension loading when project has a custom OutputPath
May 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
func startalways built withdotnet build --output bin/output, overriding$(OutDir). The Functions SDK MSBuild targets that generate.azurefunctionsuse$(OutputPath)(not$(OutDir)), so on projects with a customOutputPaththe extensions landed in the project's original output directory rather thanbin/output. The host ran frombin/output, found no.azurefunctions, reportedDotnetIsolatedApp: False, and loaded no extensions.Changes
DotnetHelpers.TryGetBuildOutputPathAsync(new): Runsdotnet msbuild -getProperty:OutputPath -restore:falseto resolve the project's actual output directory. Returnsnullon any failure (unrestored project, no project file) so callers can fall back safely.DotnetHelpers.BuildDotnetProject: AcceptsnullforoutputPath; whennull, omits--outputand lets MSBuild use the project's ownOutputPath.DotnetHelpers.BuildAndChangeDirectory: NewhonorProjectOutputPathparameter (defaultfalse, no change for existing callers). Whentrue, evaluates the project'sOutputPathand builds without--output, thencds into it. Falls back to--output bin/outputif evaluation fails.StartHostAction.PreRunConditions: PasseshonorProjectOutputPath: true— the only call site that needs the new behavior.func packandfunc k8sare unaffected.Unit test:
TryGetBuildOutputPathAsync_ReturnsNull_WhenNoProjectFileExistscovers the null-return path.Pull request checklist
release_notes.mdWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
azfunc.pkgs.visualstudio.com/usr/bin/dotnet dotnet build src/Cli/func/Azure.Functions.Cli.csproj -q(dns block)/opt/hostedtoolcache/CodeQL/2.25.1/x64/codeql/csharp/tools/linux64/Semmle.Autobuild.CSharp /opt/hostedtoolcache/CodeQL/2.25.1/x64/codeql/csharp/tools/linux64/Semmle.Autobuild.CSharp(dns block)/tmp/codeql-scratch-50c7d6e9ded3e5a4/dbs/csharp/working/.dotnet/dotnet /tmp/codeql-scratch-50c7d6e9ded3e5a4/dbs/csharp/working/.dotnet/dotnet restore --no-dependencies /home/REDACTED/work/azure-functions-core-tools/azure-functions-core-tools/Azure.Functions.Cli.sln --packages /tmp/codeql-scratch-50c7d6e9ded3e5a4/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-50c7d6e9ded3e5a4/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-50c7d6e9ded3e5a4/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true(dns block)If you need me to access, download, or install something from one of these locations, you can either: