Skip to content

Conversation

@dellis1972
Copy link
Contributor

Commit b716173 added the ability to generate the workload.json file. However there was a bug where the $(DotNetStableTargetFramework) was not being defined for the workload-dependencies.csproj. This would resolve in the following error

bin/Release/dotnet/sdk/9.0.100-rtm.24512.1/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(96,5): error NETSDK1013: The TargetFramework value '' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly.

The problem was that the DotNetStableTargetFramework property was not being passed on to the dotnet run call in WorkloadDependencies.proj. The CI build was working because we define the DotNetStableTargetFramework as an environment variable at

- name: DotNetStableTargetFramework
value: net9.0
.

The fix is to pass the DotNetStableTargetFramework property to the call to dotnet run.

Commit b716173 added the ability to generate the workload.json file.
However there was a bug where the `$(DotNetStableTargetFramework)`
was not being defined for the workload-dependencies.csproj. This
would resolve in the following error

```
bin/Release/dotnet/sdk/9.0.100-rtm.24512.1/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(96,5): error NETSDK1013: The TargetFramework value '' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly.
```

The problem was that the `DotNetStableTargetFramework` property was
not being passed on to the `dotnet run` call in WorkloadDependencies.proj.
The CI build was working because we define the `DotNetStableTargetFramework`
as an environment variable at https://github.com/dotnet/android/blob/6b37563d39d4357069ed59ca046d4c2a154937f4/build-tools/automation/yaml-templates/variables.yaml#L52-L53.

The fix is to pass the `DotNetStableTargetFramework` property to the
call to `dotnet run`.
@dellis1972 dellis1972 requested a review from jonpryor as a code owner January 6, 2025 14:18
@jonathanpeppers
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jonathanpeppers jonathanpeppers merged commit 679bb84 into dotnet:main Jan 6, 2025
59 checks passed
@dellis1972 dellis1972 deleted the fixbuild1 branch January 6, 2025 16:55
grendello added a commit that referenced this pull request Jan 7, 2025
* main: (25 commits)
  [CI] Break "Linux Tests" into 2 parallel jobs. (#9642)
  Fix `WorkloadDependencies.proj` build. (#9648)
  [CI] Set "WearOS Tests" parallelization to 2 agents. (#9639)
  [CI] Break "Package Tests" into 2 parallel jobs. (#9638)
  Bump to DevDiv/android-platform-support@3b4e16f1 (#9632)
  [NativeAOT] improve build logic, part 2 (#9631)
  Bump to dotnet/java-interop@2c06b3c2 (#9633)
  [NativeAOT] improve build logic, part 1 (#9614)
  [build] Generate `WorkloadDependencies.json` (#9613)
  [monodroid] remove `monodroid_get_log_categories()` (#9625)
  [monodroid] remove `_monodroid_get_identity_hash_code` (#9622)
  Bump to dotnet/java-interop@f800ea52 (#9607)
  [XABT] Break BuildApk into individual tasks for each content type. (#9612)
  [Mono.Android] Bind Android API-Baklava DP1 (#9594)
  [Xamarin.Android.Build.Tasks] Extract `BuildArchive` from `BuildApk` (#9556)
  [NativeAOT] MSBuild-related logic to get projects to build (#9583)
  [build] remove remnants of `OpenTK-1.0.dll` (#9610)
  [build] remove `Xamarin.Android.CSharp.targets` (#9609)
  [build] runtime "flavors" part 2 (#9598)
  Bump com.android.tools.build:manifest-merger to 31.7.3 (#9600)
  ...
grendello added a commit that referenced this pull request Jan 7, 2025
* dev/grendel/use-libc++: (25 commits)
  [CI] Break "Linux Tests" into 2 parallel jobs. (#9642)
  Fix `WorkloadDependencies.proj` build. (#9648)
  [CI] Set "WearOS Tests" parallelization to 2 agents. (#9639)
  [CI] Break "Package Tests" into 2 parallel jobs. (#9638)
  Bump to DevDiv/android-platform-support@3b4e16f1 (#9632)
  [NativeAOT] improve build logic, part 2 (#9631)
  Bump to dotnet/java-interop@2c06b3c2 (#9633)
  [NativeAOT] improve build logic, part 1 (#9614)
  [build] Generate `WorkloadDependencies.json` (#9613)
  [monodroid] remove `monodroid_get_log_categories()` (#9625)
  [monodroid] remove `_monodroid_get_identity_hash_code` (#9622)
  Bump to dotnet/java-interop@f800ea52 (#9607)
  [XABT] Break BuildApk into individual tasks for each content type. (#9612)
  [Mono.Android] Bind Android API-Baklava DP1 (#9594)
  [Xamarin.Android.Build.Tasks] Extract `BuildArchive` from `BuildApk` (#9556)
  [NativeAOT] MSBuild-related logic to get projects to build (#9583)
  [build] remove remnants of `OpenTK-1.0.dll` (#9610)
  [build] remove `Xamarin.Android.CSharp.targets` (#9609)
  [build] runtime "flavors" part 2 (#9598)
  Bump com.android.tools.build:manifest-merger to 31.7.3 (#9600)
  ...
@github-actions github-actions bot locked and limited conversation to collaborators Feb 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants