Skip to content

Conversation

@khalidabuhakmeh
Copy link
Contributor

Updated the media-player and webview quickstart documentation to include examples of packageSourceMapping.

Without the package source mapping, build tools can be confused about where to search for certain packages when central package management is used. Adding a package source mapping helps resolve any ambiguity and lets those tools build successfully.

I ran into this issue when using Cake to build using dotnet cake.

https://learn.microsoft.com/en-us/nuget/consume-packages/package-source-mapping#enabling-package-source-mapping

@maxkatz6
Copy link
Member

Does it work fine, if you include Avalonia.Controls.DataGrid, for example? Which isn't part of this feed.

@khalidabuhakmeh
Copy link
Contributor Author

@maxkatz6 You're right, I didn't realize there were other packages that use the same prefix.

  <packageSourceMapping>
    <!-- key value for <packageSource> should match key values from <packageSources> element -->
    <packageSource key="avalonia-accelerate">
      <package pattern="Avalonia.Controls.MediaPlayer" />
      <package pattern="Avalonia.Controls.WebView" />
    </packageSource>
    <packageSource key="nuget.org">
      <package pattern="*" />
    </packageSource>
  </packageSourceMapping>

The package source pattern has to be more explicit then. Not sure if this is good for the docs as it would need to be updated as packages go into and out of the accelerate feed.

What are your thoughts?

Updated the media-player and webview quickstart documentation to include examples of packageSourceMapping.
@khalidabuhakmeh khalidabuhakmeh force-pushed the package-source-mapping branch from 4b43659 to 0fd8845 Compare April 25, 2025 14:49
@maxkatz6
Copy link
Member

@khalidabuhakmeh we are going to eventually move these new packages to the public nuget, since our licensing is done via msbuild task. So, this problem is going to be solved automatically.

Meanwhile, explicit pattern is probably fine as a temporary workaround.

Copy link
Member

@maxkatz6 maxkatz6 left a comment

Choose a reason for hiding this comment

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

Thanks!

@maxkatz6 maxkatz6 merged commit e38e5e3 into AvaloniaUI:main Apr 28, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants