Azure/azure-functions-core-tools
func start does not honor Directory.Build.props when using $(SolutionDir)
オープン
#4,230 opened on 2025/01/13
buggood first issue
Repository metrics
- Stars
- (1,456 個のスター)
- PR merge metrics
- (PR metrics pending)
説明
Version
4.0.6610
Description
A project which correctly builds and starts with func start, would fails in the presence of a Directory.Build.props containing $(SolutionDir), like in:
<Project>
<PropertyGroup>
<UseArtifactsOutput>true</UseArtifactsOutput>
<ArtifactsPath>$(SolutionDir)/.build</ArtifactsPath>
</PropertyGroup>
</Project>
Steps to reproduce
- cd in the directory of a C# Azure Function source code
- Add a file
Directory.Build.propscontaining$(SolutionDir), like in:
<Project>
<PropertyGroup>
<UseArtifactsOutput>true</UseArtifactsOutput>
<ArtifactsPath>$(SolutionDir)/.build</ArtifactsPath>
</PropertyGroup>
</Project>
- Run
func start - Expected behavior: success
- Actual result:
Determining projects to restore...
Restored C:\prg\batch-server\service-bus\src\CSharpAzureFunction\CSharpAzureFunction.csproj (in 309 ms).
CSC : error CS2007: Unrecognized option: '/.build\obj\CSharpAzureFunction\debug\CSharpAzureFunction.GlobalUsings.g.cs' [C:\prg\batch-server\service-bus\src\CSharpAzureFunction\CSharpAzureFunction.csproj]
Error building project
CSC : error CS2007: Unrecognized option: '/.build\obj\CSharpAzureFunction\debug\.NETCoreApp,Version=v9.0.AssemblyAttributes.cs' [C:\prg\batch-server\service-bus\src\CSharpAzureFunction\CSharpAzureFunction.csproj]
CSC : error CS2007: Unrecognized option: '/.build\obj\CSharpAzureFunction\debug\CSharpAzureFunction.AssemblyInfo.cs' [C:\prg\batch-server\service-bus\src\CSharpAzureFunction\CSharpAzureFunction.csproj]
Build FAILED.
CSC : error CS2007: Unrecognized option: '/.build\obj\CSharpAzureFunction\debug\CSharpAzureFunction.GlobalUsings.g.cs' [C:\prg\batch-server\service-bus\src\CSharpAzureFunction\CSharpAzureFunction.csproj]
CSC : error CS2007: Unrecognized option: '/.build\obj\CSharpAzureFunction\debug\.NETCoreApp,Version=v9.0.AssemblyAttributes.cs' [C:\prg\batch-server\service-bus\src\CSharpAzureFunction\CSharpAzureFunction.csproj]
CSC : error CS2007: Unrecognized option: '/.build\obj\CSharpAzureFunction\debug\CSharpAzureFunction.AssemblyInfo.cs' [C:\prg\batch-server\service-bus\src\CSharpAzureFunction\CSharpAzureFunction.csproj]
Build succeeds in case either an absolute or a relative path is used, instead of $(SolutionDir).