Oryx icon indicating copy to clipboard operation
Oryx copied to clipboard

Directory.Build.Props is ignored when attempting to determine the TargetFramework of a csproj file

Open StevenTCramer opened this issue 2 years ago • 4 comments

Bug Report

  • At what date and time did you most recently experience the problem?

2022-07-20

  • Where did you experience the problem? E.g. Azure Web Apps, Azure Functions, Azure Container Registry, or offline use.

using Azure/static-web-apps-deploy@v1

  • If your repo is publicly available please share its URL: It isn't public yet

  • What happened?

Detecting platforms...
Could not detect any platform in the source directory.
Error: Could not detect the language from repo.
  • What did you expect or want to happen?
Detecting platforms...
Detected following platforms:
  dotnet: 6.0.6
  • How can we reproduce it? you can use https://github.com/staticwebdev/blazor-starter/generate and then move <TargetFramework>net6.0</TargetFramework> up to a Directory.Build.props file.

  • Do you have log output? Please include between the backticks:

Detecting platforms...
Could not detect any platform in the source directory.
Error: Could not detect the language from repo.

StevenTCramer avatar Jul 20 '22 12:07 StevenTCramer

@StevenTCramer, Directory.Build.props file is not supported as a way to detect target frameworks for .NET apps. Oryx is looking for target frameworks in a .csproj file in the root repo, could you try it with it?

qianz2 avatar Jul 20 '22 22:07 qianz2

@StevenTCramer, Directory.Build.props file is not supported as a way to detect target frameworks for .NET apps.

This is exactly my point. Yes, it works if I put the TargetFramework in the csproj, but the point in Directory.Build.props is to manage common settings across your solution in a central location. I would expect Oryx to be able to build the same as dotnet build.

StevenTCramer avatar Jul 21 '22 00:07 StevenTCramer

I just ran into this issue as well. Any chance this could get a look?

codemonkey85 avatar Nov 02 '23 18:11 codemonkey85

Same here, would love a fix

benoit160 avatar Dec 20 '23 17:12 benoit160