Skip to content

Conversation

MackinnonBuck
Copy link
Member

@MackinnonBuck MackinnonBuck commented Jul 23, 2025

Summary

Fixes an issue where project templates would sometimes reference nonexistent versions of packages defined internally within the dotnet/extensions repo.

Fixes #6604

Description

This fix works by executing a target to directly extract the package version from each internal project referenced by the project templates. This enables us to avoid having to "guess" the version of internal packages via the $(Version) property, which may differ from project to project.

Microsoft Reviewers: Open in CodeFlow

@Copilot Copilot AI review requested due to automatic review settings July 23, 2025 20:55
@MackinnonBuck MackinnonBuck requested review from a team as code owners July 23, 2025 20:55
@github-actions github-actions bot added the area-ai-templates Microsoft.Extensions.AI.Templates label Jul 23, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where project templates would sometimes reference nonexistent versions of packages defined internally within the dotnet/extensions repo. The fix replaces static version property references with a dynamic system that extracts package versions directly from internal project files.

Key changes include:

  • Replaces manual package version mapping with automated extraction from project files
  • Updates template variable names to be more specific (e.g., MicrosoftExtensionsAI_PreviewMicrosoftExtensionsAIOpenAI)
  • Removes conditional logic for "just-built packages" detection

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Directory.Build.targets.in Removes conditional logic for detecting just-built packages
ChatWithCustomData-CSharp.Web.csproj.in Updates package reference variable names to use new specific naming convention
GeneratedContent.targets Replaces static package version properties with dynamic extraction system
GenerateTemplateContent.csproj Adds MSBuild target to compute package versions from referenced projects
Packaging.targets Adds helper target to extract package version information from projects

Copy link
Member

@jeffhandley jeffhandley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate how surgical the changes are for consuming the versions in this new way.

@MackinnonBuck MackinnonBuck merged commit d892c51 into main Jul 24, 2025
6 checks passed
@MackinnonBuck MackinnonBuck deleted the mbuck/fix-aichatweb-refs branch July 24, 2025 19:26
This was referenced Aug 13, 2025
joakimia pushed a commit to heimdallpower/api-sdk that referenced this pull request Aug 21, 2025
Updated
[Microsoft.Extensions.Http.Resilience](https://github.com/dotnet/extensions)
from 9.7.0 to 9.8.0.

<details>
<summary>Release notes</summary>

_Sourced from [Microsoft.Extensions.Http.Resilience's
releases](https://github.com/dotnet/extensions/releases)._

## 9.8.0

## What's Changed
* Align EventId generation with M.E.Logging source-gen by @​xakep139 in
dotnet/extensions#6566
* Add resiliency mechanism to CPU and memory utilization checks by
@​amadeuszl in dotnet/extensions#6528
* Suppress flaky test until fixed by @​joelverhagen in
dotnet/extensions#6568
* Create a project template for an MCP server by @​joelverhagen in
dotnet/extensions#6547
* Use dnx instead of dotnet tool exec in MCP server template README by
@​joelverhagen in dotnet/extensions#6571
* Add reporting tests that show NLP results. by @​peterwald in
dotnet/extensions#6574
* Branding updates for 9.8.0 by @​joperezr in
dotnet/extensions#6573
* Fix `ConfigureEvaluationTests.ps1` script when `$ConfigRoot` is not
supplied by @​peterwald in
dotnet/extensions#6575
* Refactor Resource Monitoring by @​evgenyfedorov2 in
dotnet/extensions#6554
* Update McpServer template for 0.3.0-preview.2 by @​stephentoub in
dotnet/extensions#6578
* Add container.cpu.time metric by @​evgenyfedorov2 in
dotnet/extensions#5806
* Add netstandard2.0 compatibility to
Microsoft.Extensions.Diagnostics.Testing and dependencies by @​bdovaz in
dotnet/extensions#6219
* Add netstandard2.0 compatibility to Microsoft.Extensions.Telemetry and
dependencies by @​bdovaz in
dotnet/extensions#6218
* Simplify Http.Diagnostics by @​pentp in
dotnet/extensions#6174
* Add netstandard2.0 compatibility to
Microsoft.Extensions.Http.Resilience and dependencies by @​bdovaz in
dotnet/extensions#6582
* Ingore null loggers returned by LogProviders in ELoggerFactory by
@​petrroll in dotnet/extensions#6585
* Merging changes from internal by @​joperezr in
dotnet/extensions#6588
* [Logging] Fixes LogProperties and LogPropertyIgnore attributes to work
if an object being logged resides in a different assembly than the
logging method by @​iliar-turdushev in
dotnet/extensions#6600
* Add memory usage metric by @​evgenyfedorov2 in
dotnet/extensions#6586
* Add schema version to server.json in MCP template by @​joelverhagen in
dotnet/extensions#6606
* Merge release/9.7 into main by @​joperezr in
dotnet/extensions#6589
* Update MCP server template readme to show both VS Code and Visual
Studio notes by @​Copilot in
dotnet/extensions#6591
* Update Azure Open AI package referenced by eval integration tests by
@​shyamnamboodiripad in dotnet/extensions#6609
* Target .NET 8 for more stable runtime requirement by @​joelverhagen in
dotnet/extensions#6617
* Add support for new Azure AI Foundry project type for Safety evals by
@​shyamnamboodiripad in dotnet/extensions#6621
* M.E.AI.AzureAIInference - Azure.AI.Inference Package Bump by
@​rogerbarreto in dotnet/extensions#6624
* Add DataContent.Name property by @​stephentoub in
dotnet/extensions#6616
* Fix handling of multiple responses messages by @​stephentoub in
dotnet/extensions#6627
* Expose additional chat model conversion helpers by @​stephentoub in
dotnet/extensions#6629
* [main] Update dependencies from dotnet/arcade by @​dotnet-maestro[bot]
in dotnet/extensions#6633
* [Http.Resilience] The DisableFor method should try to retrieve the
request object from the resilience context by @​iliar-turdushev in
dotnet/extensions#6618
* Bump Package validation baseline version to 9.7.0 by @​Copilot in
dotnet/extensions#6650
* Fix internal package version detection for project templates by
@​MackinnonBuck in dotnet/extensions#6651
* Remove `Microsoft.Extensions.AI.Ollama` by @​MackinnonBuck in
dotnet/extensions#6655
* Fix M.E.AI package refs by @​stephentoub in
dotnet/extensions#6654
* Add [Description] to DataContent.Uri by @​stephentoub in
dotnet/extensions#6615
* Fix duplicate solution file when creating an AI Chat Web app from VS
by @​MackinnonBuck in dotnet/extensions#6653
* Add ChatMessage.CreatedAt by @​stephentoub in
dotnet/extensions#6657
* Add TextContent.Annotations by @​stephentoub in
dotnet/extensions#6619
* Add FunctionInvokingChatClient.AdditionalTools by @​stephentoub in
dotnet/extensions#6661
* Fix unintentional test env var change by @​stephentoub in
dotnet/extensions#6660
* Add more openai conversion helpers by @​stephentoub in
dotnet/extensions#6662
* Add OriginalRepoCommitHash to assemblies by @​BrennanConroy in
dotnet/extensions#6667
* Include a trivial items keyword if missing. by @​eiriktsarpalis in
dotnet/extensions#6669
* Add resolution of function parameter level data annotation attributes.
by @​eiriktsarpalis in dotnet/extensions#6671
* Fix issue with NetSourceIndexStage1 for dependency conflict versions
by @​joperezr in dotnet/extensions#6672
* Expose streaming conversion utility methods by @​stephentoub in
dotnet/extensions#6636
* Couple of fixes for MEAI.Evaluation by @​shyamnamboodiripad in
dotnet/extensions#6673
* Fix one more version conflict on the docs transport package by
@​joperezr in dotnet/extensions#6675
 ... (truncated)

## 9.7.2

## Packages Released

* [Microsoft.Extensions.AI.Templates
9.7.2-preview.3.25366.2](https://www.nuget.org/packages/Microsoft.Extensions.AI.Templates/9.7.2-preview.3.25366.2)

## What's Changed

* Target .NET 8 for more stable runtime requirement by @​joelverhagen in
#​6617

**Full Changelog**:
dotnet/extensions@v9.7.1...v9.7.2

## 9.7.1

## Packages Released

* [Microsoft.Extensions.AI
9.7.1](https://www.nuget.org/packages/Microsoft.Extensions.AI/9.7.1)
* [Microsoft.Extensions.AI.Abstractions
9.7.1](https://www.nuget.org/packages/Microsoft.Extensions.AI.Abstractions/9.7.1)
* [Microsoft.Extensions.AI.OpenAI
9.7.1-preview.1.25365.4](https://www.nuget.org/packages/Microsoft.Extensions.AI.OpenAI/9.7.1-preview.1.25365.4)
* [Microsoft.Extensions.AI.AzureAIInference
9.7.1-preview.1.25365.4](https://www.nuget.org/packages/Microsoft.Extensions.AI.AzureAIInference/9.7.1-preview.1.25365.4)
* [Microsoft.Extensions.AI.Templates
9.7.1-preview.3.25365.4](https://www.nuget.org/packages/Microsoft.Extensions.AI.Templates/9.7.1-preview.3.25365.4)

## What's Changed

* Merging changes from internal by @​joperezr in #​6588
* Bump FunctionInvokingChatClient.MaximumIterationsPerRequest from 10 to
40 by @​stephentoub in #​6599
* Expose M.E.AI.OpenAI input message conversions by @​stephentoub in
#​6601
* Add schema version to server.json in MCP template by @​joelverhagen in
#​6606
* Update MCP server template readme to show both VS Code and Visual
Studio notes by @​jeffhandley in #​6591
* Fix schema generation for Nullable<T> function parameters. by
@​eiriktsarpalis in #​6596
* Branding updates for 9.7.1 by @​joperezr in
dotnet/extensions#6611
* Add DelegatingAIFunction by @​stephentoub in
dotnet/extensions#6565
* Add FunctionInvokingChatClient.FunctionInvoker delegate by
@​stephentoub in dotnet/extensions#6564
* Enable specifying "strict" for OpenAI clients via ChatOptions by
@​stephentoub in dotnet/extensions#6552
* AIFunctionFactory: tolerate JSON string function parameters. by
@​eiriktsarpalis in dotnet/extensions#6572
* AIFunctionFactory: add test coverage for JSON comments. by
@​eiriktsarpalis in dotnet/extensions#6576
* Update M.E.AI.OpenAI for latest OpenAI release by @​stephentoub in
dotnet/extensions#6577
* Update OpenTelemetry semantic conventions version from 1.35 to 1.36 by
@​Copilot in dotnet/extensions#6579
* AIFunctionFactory: add a flag for disabling return schema generation.
by @​eiriktsarpalis in dotnet/extensions#6551
* Bump FunctionInvokingChatClient.MaximumIterationsPerRequest from 10 to
40 by @​stephentoub in dotnet/extensions#6599
* Expose M.E.AI.OpenAI input message conversions by @​stephentoub in
dotnet/extensions#6601
* Fix schema generation for Nullable<T> function parameters. by
@​eiriktsarpalis in dotnet/extensions#6596


**Full Changelog**:
dotnet/extensions@v9.7.0...v9.7.1

Commits viewable in [compare
view](dotnet/extensions@v9.7.0...v9.8.0).
</details>

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Microsoft.Extensions.Http.Resilience&package-manager=nuget&previous-version=9.7.0&new-version=9.8.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@github-actions github-actions bot locked and limited conversation to collaborators Aug 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-ai-templates Microsoft.Extensions.AI.Templates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The aichatweb project template references nonexistent preview version of M.E.AI
3 participants