CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 11:07:15 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/dotnet/android.git
etag: W/"50c26125210f35c4f669644a866c2885"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=XFpCsvlfJhOnbMNP6hxNfIkJZyvvp%2F3gkrgmqHL3SnoO4kuxOZfY2WnzVKSX5pKtu%2B%2FzIuUPW0AUN8ynsPDjILsDcVmPkBrcYQrTtv3AXYrqZt%2BU7qFZIpFLFlpa3CXYgMby8sdUvqmWFLQHQtcSwmqiK1Ldpi6%2BtTUTtedDHsKbi2%2BEYHL8HPaDPAro0iBSFfOooiQmBjH3z5SQr0E8qb5htOzG068LAfLaIjR0v%2BTynxfyASinB0UiPIUVSwt7fuwyYs5QIO4lbjIbcCXswA%3D%3D--i0B7lJfEzCr6Ag4n--QlsCx5sZVqJ1xmPHrMb0fg%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1758958887.1753614434; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 11:07:14 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 11:07:14 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: C8E2:3E3773:41C1E1:586EA9:68860862
[Xamarin.Android.Build.Tasks] optimize $(AssemblySearchPaths) (#2223) · dotnet/android@e390702 · GitHub
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 555
Commit e390702
[Xamarin.Android.Build.Tasks] optimize $(AssemblySearchPaths) (#2223)
Context: https://docs.microsoft.com/en-us/visualstudio/msbuild/resolveassemblyreference-task?view=vs-2017
Context: https://twitter.com/KirillOsenkov/status/1043725067081764865
@KirillOsenkov added a new analyzer to the Windows binlog viewer,
noting `$(AssemblySearchPaths)` that are unused during a build.
Looking at what we are using currently, it reports:
Unused AssemblySearchPaths locations
{AssemblyFolders}
{AssemblyFoldersFromConfig:C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\AssemblyFolders.config,v9.0}
{CandidateAssemblyFiles}
{Registry:Software\Microsoft\MonoAndroid,v9.0,AssemblyFoldersEx}
bin\Debug\
Luckily, we already had MSBuild logic in place to remove `{GAC}` from
this list.
But we certainly are probing search paths that are nonsensical for
Xamarin.Android:
- `{AssemblyFolders}`: Specifies the task will use the Visual
Studio.NET 2003 finding-assemblies-from-registry scheme.
- `{AssemblyFoldersFromConfig:*}`: this probes the system-wide
config file in the MSBuild / Visual Studio install
- `{CandidateAssemblyFiles}`: The `CandidateAssemblyFiles` property on
`ResolveAssemblyReferences` is blank. Docs say: Assemblies in this
list will be considered when the SearchPaths parameter contains
`{CandidateAssemblyFiles}` as one of the paths to consider.
- `{Registry:*}`: probe the Windows registry...
- `bin\Debug` or `$(OutputPath)`: not needed, and a potential cause of
confusion. This would be if there was an arbitrary extra assembly
sitting in `$(OutputPath)`.
And if we look further, we see odd things:
Primary reference "System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e".
Resolved file path is "C:\Users\myuser\Desktop\Git\xamarin-android\bin\Control\lib\xamarin.android\xbuild-frameworks\MonoAndroid\v1.0\System.dll".
Reference found at search path location "{TargetFrameworkDirectory}".
For SearchPath "{TargetFrameworkDirectory}".
Considered "C:\Users\myuser\Desktop\Git\xamarin-android\bin\Control\lib\xamarin.android\xbuild-frameworks\MonoAndroid\v9.0\System.winmd", but it didn't exist.
Considered "C:\Users\myuser\Desktop\Git\xamarin-android\bin\Control\lib\xamarin.android\xbuild-frameworks\MonoAndroid\v9.0\System.dll", but it didn't exist.
Considered "C:\Users\myuser\Desktop\Git\xamarin-android\bin\Control\lib\xamarin.android\xbuild-frameworks\MonoAndroid\v9.0\System.exe", but it didn't exist.
Considered "C:\Users\myuser\Desktop\Git\xamarin-android\bin\Control\lib\xamarin.android\xbuild-frameworks\MonoAndroid\v1.0\System.winmd", but it didn't exist.
Why are we looking for `.winmd` files? This is a UWP thing...
And then apparently, our build also will look for `.pri` files?
Another UWP thing...
AllowedRelatedFileExtensions
.pdb
.xml
.pri
.dll.config
.exe.config
.dll.mdb
.exe.mdb
So the first fix is to trim `$(AssemblySearchPaths)` to precisely
what Xamarin.Android needs:
<AssemblySearchPaths>
{HintPathFromItem};
{TargetFrameworkDirectory};
{RawFileName};
</AssemblySearchPaths>
We shouldn't be concerned about other system-wide places.
Next, we should only be looking at these file extensions:
<AllowedReferenceAssemblyFileExtensions>
.dll;
</AllowedReferenceAssemblyFileExtensions>
<AllowedReferenceRelatedFileExtensions>
.pdb;
.xml;
.dll.config;
.dll.mdb;
</AllowedReferenceRelatedFileExtensions>
Removing `.winmd` from `$(AllowedReferenceAssemblyFileExtensions)`
and `.pri` from `$(AllowedReferenceRelatedFileExtensions)`. We can
also ignore `.exe*` files, since Xamarin.Android projects only use
`.dll` files.
This makes the log probing for `System.dll` much cleaner:
Primary reference "System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e".
Resolved file path is "C:\Users\myuser\Desktop\Git\xamarin-android\bin\Release\lib\xamarin.android\xbuild-frameworks\MonoAndroid\v1.0\System.dll".
Reference found at search path location "{TargetFrameworkDirectory}".
For SearchPath "{TargetFrameworkDirectory}".
Considered "C:\Users\myuser\Desktop\Git\xamarin-android\bin\Release\lib\xamarin.android\xbuild-frameworks\MonoAndroid\v9.0\System.dll", but it didn't exist.
Here is the log of changes made to these properties here at MSBuild
evaluation time:
Property reassignment: $(AssemblySearchPaths)="
{HintPathFromItem};
{TargetFrameworkDirectory};
{RawFileName};
" (previous value: "
{CandidateAssemblyFiles};
;
{HintPathFromItem};
{TargetFrameworkDirectory};
{AssemblyFoldersFromConfig:C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\AssemblyFolders.config,v9.0};
{Registry:Software\Microsoft\MonoAndroid,v9.0,AssemblyFoldersEx};
{AssemblyFolders};
{GAC};
{RawFileName};
bin\Debug\
") at xamarin-android\bin\Release\lib\xamarin.android\xbuild\Xamarin\Android\Xamarin.Android.Common.targets (338,2)
Property reassignment: $(AllowedReferenceAssemblyFileExtensions)="
.dll;
" (previous value: "
.winmd;
.dll;
.exe
") at xamarin-android\bin\Release\lib\xamarin.android\xbuild\Xamarin\Android\Xamarin.Android.Common.targets (343,2)
Property reassignment: $(AllowedReferenceRelatedFileExtensions)="
.pdb;
.xml;
.dll.config;
.dll.mdb;
" (previous value: "
.pdb;
.xml;
.pri;
.dll.config;
.exe.config
") at xamarin-android\bin\Release\lib\xamarin.android\xbuild\Xamarin\Android\Xamarin.Android.Common.targets (347,2)
~~ Results ~~
I timed the Xamarin.Forms Control Gallery project, since I felt this
change would improve larger projects the most.
Project here:
https://github.com/jonathanpeppers/Xamarin.Forms/tree/msbuild-timing
Before:
1106 ms ResolveAssemblies 2 calls
1401 ms ResolveAssemblyReference 18 calls
After:
909 ms ResolveAssemblies 2 calls
1088 ms ResolveAssemblyReference 18 calls
This seems to directly save ~500ms to these targets in incremental
builds for this project. This project references ~7 other
Xamarin.Android projects.
~~ Upstream ~~
On MacOS, I also see probing for `.winmd` files!
Considered "xamarin-android/bin/Debug/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v9.0/System.winmd", but it didn't exist.
Perhaps we need some upstream changes to MSBuild as well...1 parent 73b93c2 commit e390702Copy full SHA for e390702
File tree
Expand file treeCollapse file tree
1 file changed
+14
-2
lines changedFilter options
- src/Xamarin.Android.Build.Tasks
Expand file treeCollapse file tree
1 file changed
+14
-2
lines changedsrc/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets+14-2Lines changed: 14 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
336 | 336 |
| |
337 | 337 |
| |
338 | 338 |
| |
339 |
| - | |
340 |
| - | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
341 | 353 |
| |
342 | 354 |
| |
343 | 355 |
| |
|
You can’t perform that action at this time.
0 commit comments