Skip to content

Commit 46b82a7

Browse files
author
Emmanuel Assumang
committed
samples/cs: align packaging with main, revert CI band-aid
Restore nuget.config and Directory.Packages.props to match main's local-sdk packaging approach.
1 parent 2a86613 commit 46b82a7

17 files changed

Lines changed: 28 additions & 62 deletions

File tree

samples/cs/Directory.Packages.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<CentralPackageFloatingVersionsEnabled>true</CentralPackageFloatingVersionsEnabled>
55
</PropertyGroup>
66
<ItemGroup>
7-
<PackageVersion Include="Microsoft.AI.Foundry.Local" Version="1.1.0-dev.202605010202" />
8-
<PackageVersion Include="Microsoft.AI.Foundry.Local.WinML" Version="1.1.0-dev.202605010202" />
7+
<PackageVersion Include="Microsoft.AI.Foundry.Local" Version="*-*" />
8+
<PackageVersion Include="Microsoft.AI.Foundry.Local.WinML" Version="*-*" />
99
<PackageVersion Include="Betalgo.Ranul.OpenAI" Version="9.2.0" />
1010
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.15" />
1111
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="9.0.15" />

samples/cs/audio-transcription-example/AudioTranscriptionExample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<!-- Windows: target Windows SDK for WinML hardware acceleration -->
1010
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
11-
<TargetFramework>net9.0-windows10.0.26100</TargetFramework>
11+
<TargetFramework>net9.0-windows10.0.18362.0</TargetFramework>
1212
<Platforms>ARM64;x64</Platforms>
1313
<WindowsPackageType>None</WindowsPackageType>
1414
<EnableCoreMrtTooling>false</EnableCoreMrtTooling>

samples/cs/embeddings/Embeddings.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<!-- Windows: target Windows SDK for WinML hardware acceleration -->
1010
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
11-
<TargetFramework>net9.0-windows10.0.26100</TargetFramework>
11+
<TargetFramework>net9.0-windows10.0.18362.0</TargetFramework>
1212
<Platforms>ARM64;x64</Platforms>
1313
<WindowsPackageType>None</WindowsPackageType>
1414
<EnableCoreMrtTooling>false</EnableCoreMrtTooling>

samples/cs/foundry-local-web-server/FoundryLocalWebServer.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<!-- Windows: target Windows SDK for WinML hardware acceleration -->
1010
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
11-
<TargetFramework>net9.0-windows10.0.26100</TargetFramework>
11+
<TargetFramework>net9.0-windows10.0.18362.0</TargetFramework>
1212
<Platforms>ARM64;x64</Platforms>
1313
<WindowsPackageType>None</WindowsPackageType>
1414
<EnableCoreMrtTooling>false</EnableCoreMrtTooling>

samples/cs/live-audio-transcription/LiveAudioTranscriptionExample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<!-- Windows: target Windows SDK for WinML hardware acceleration -->
1010
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
11-
<TargetFramework>net9.0-windows10.0.26100</TargetFramework>
11+
<TargetFramework>net9.0-windows10.0.18362.0</TargetFramework>
1212
<Platforms>ARM64;x64</Platforms>
1313
<WindowsPackageType>None</WindowsPackageType>
1414
<EnableCoreMrtTooling>false</EnableCoreMrtTooling>

samples/cs/model-management-example/ModelManagementExample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<!-- Windows: target Windows SDK for WinML hardware acceleration -->
1010
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
11-
<TargetFramework>net9.0-windows10.0.26100</TargetFramework>
11+
<TargetFramework>net9.0-windows10.0.18362.0</TargetFramework>
1212
<Platforms>ARM64;x64</Platforms>
1313
<WindowsPackageType>None</WindowsPackageType>
1414
<EnableCoreMrtTooling>false</EnableCoreMrtTooling>

samples/cs/native-chat-completions/NativeChatCompletions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<!-- Windows: target Windows SDK for WinML hardware acceleration -->
1010
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
11-
<TargetFramework>net9.0-windows10.0.26100</TargetFramework>
11+
<TargetFramework>net9.0-windows10.0.18362.0</TargetFramework>
1212
<Platforms>ARM64;x64</Platforms>
1313
<WindowsPackageType>None</WindowsPackageType>
1414
<EnableCoreMrtTooling>false</EnableCoreMrtTooling>

samples/cs/nuget.config

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
<packageSources>
44
<clear />
55
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
6-
<add key="ORT-Nightly" value="https://pkgs.dev.azure.com/aiinfra/PublicPackages/_packaging/ORT-Nightly/nuget/v3/index.json" />
6+
<!-- CI builds the SDK to local-packages/ before building samples.
7+
For local dev, run: dotnet pack sdk/cs/src -o local-packages /p:Version=0.9.0-dev -->
8+
<add key="local-sdk" value="../../local-packages" />
79
</packageSources>
8-
9-
1010
<packageSourceMapping>
1111
<packageSource key="nuget.org">
1212
<package pattern="*" />
13-
<package pattern="Microsoft.AI.Foundry.Local*" />
13+
<package pattern="Microsoft.AI.Foundry.Local.Core*" />
1414
</packageSource>
15-
<packageSource key="ORT-Nightly">
15+
<packageSource key="local-sdk">
1616
<package pattern="Microsoft.AI.Foundry.Local*" />
1717
</packageSource>
1818
</packageSourceMapping>
19-
</configuration>
19+
</configuration>

samples/cs/private-catalog/PrivateCatalog.csproj

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,14 @@
3333
<RuntimeIdentifier>$(NETCoreSdkRuntimeIdentifier)</RuntimeIdentifier>
3434
</PropertyGroup>
3535

36-
<!--
37-
Reference the in-repo SDK by project, not a published NuGet package. This sample
38-
exercises private-catalog APIs (AddCatalogAsync / PrivateCatalogOptions) that are
39-
newer than the latest published Microsoft.AI.Foundry.Local package, so a
40-
PackageReference fails to compile in CI until the next SDK release. Building
41-
against the SDK source keeps the sample green on every platform and self-validates
42-
the new surface. Other samples keep their PackageReference because they only use
43-
already-published APIs.
36+
<!-- Windows: WinML for hardware acceleration -->
37+
<ItemGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
38+
<PackageReference Include="Microsoft.AI.Foundry.Local.WinML" />
39+
</ItemGroup>
4440

45-
Note: this does not pull Microsoft.AI.Foundry.Local.WinML like the other Windows
46-
samples, so it runs on the default execution provider rather than WinML hardware
47-
acceleration. The WinML build is a separate target framework
48-
(net8.0-windows10.0.18362.0) that can't be selected through a ProjectReference
49-
without breaking restore (NETSDK1005).
50-
-->
51-
<ItemGroup>
52-
<ProjectReference Include="..\..\..\sdk\cs\src\Microsoft.AI.Foundry.Local.csproj" />
41+
<!-- Non-Windows: standard SDK -->
42+
<ItemGroup Condition="!$([MSBuild]::IsOSPlatform('Windows'))">
43+
<PackageReference Include="Microsoft.AI.Foundry.Local" />
5344
</ItemGroup>
5445

5546
<!--

samples/cs/private-catalog/nuget.config

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)