You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Visual Studio 17.8, there is a new feature that skips running MSBuild "builds" in some cases during incremental builds.
This currently has an issue in Android projects:
WARNING: Potential build performance issue in 'XamarinTV.Android.csproj'.
The project does not appear up-to-date after a successful build:
Input ResolvedCompilationReference item 'C:\Users\daortin\source\repos\app-xamarintv\XamarinTV.Android\obj\Debug\net8.0-android\_Microsoft.Android.Resource.Designer.dll' (2023-12-11 11:34:12.546) has been modified since the last successful build started
There is a new item group we can add _Microsoft.Android.Resource.Designer.dll to that will solve this problem and improve build performance inside VS.
I've taken a look at the ItemGroups, I'm not sure which ones we should be using. Most of them are about files which MSBuild does NOT know about. But in this case it does.
I'll read through the source code and see what they are actually doing.
1>FastUpToDate: Adding ResolvedCompilationReference inputs: (MauilClassLibrary)
1>FastUpToDate: D:\src\MauiBuildAcceleration\MauilClassLibrary\obj\Debug\net8.0-android\_Microsoft.Android.Resource.Designer.dll (MauilClassLibrary)
1>FastUpToDate: Input ResolvedCompilationReference item 'D:\src\MauiBuildAcceleration\MauilClassLibrary\obj\Debug\net8.0-android\_Microsoft.Android.Resource.Designer.dll' (2024-01-04 09:13:06.818) has been modified since the last successful build started (2024-01-04 09:13:05.405), not up-to-date. (MauilClassLibrary)
After playing with this more, the current behavior is:
First build: as usual.
Second (incremental) build, VS & FUTDC will run MSBuild due to the message above.
Third (incremental) build, VS & FUTDC will skip running MSBuild.
Had some conversation with the project system team, and I think we could try:
Hook into the CollectResolvedCompilationReferencesDesignTime target, remove the _Microsoft.Android.Resource.Designer.dll file from @(ReferencePathWithRefAssemblies):
Verify that MSBuild will still run again if you change an AndroidResource. If it doesn't, we may need to add all AndroidResource files to @(UpToDateCheckInput).
Activity
[-]Support Visual Studio "Build Acceleration[/-][+]Support Visual Studio "Build Acceleration"[/+]dellis1972 commentedon Jan 4, 2024
I've taken a look at the ItemGroups, I'm not sure which ones we should be using. Most of them are about files which MSBuild does NOT know about. But in this case it does.
I'll read through the source code and see what they are actually doing.
jonathanpeppers commentedon Jan 4, 2024
I tested in VS 17.9 Preview 2.1 with this setting:
This project also has some instructions to cause it:
https://github.com/jonathanpeppers/MauiBuildAcceleration
jonathanpeppers commentedon Jan 9, 2024
After playing with this more, the current behavior is:
Had some conversation with the project system team, and I think we could try:
CollectResolvedCompilationReferencesDesignTimetarget, remove the_Microsoft.Android.Resource.Designer.dllfile from@(ReferencePathWithRefAssemblies):https://github.com/dotnet/project-system/blob/e617a12f5f3e1e77ddcd7bffcbe292c706a8affe/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/DesignTimeTargets/Microsoft.Managed.DesignTime.targets#L442-L443
See if that helps no. 2 above.
Verify that MSBuild will still run again if you change an
AndroidResource. If it doesn't, we may need to add allAndroidResourcefiles to@(UpToDateCheckInput).dellis1972 commentedon Feb 8, 2024
Odd I can't seem to repo on the latest Preview of VS...
Support Visual Studio "Build Acceleration"
dellis1972 commentedon Jun 19, 2024
PR is up #9042
Support Visual Studio "Build Acceleration"
[Xamarin.Android.Build.Tasks] Support VS "Build Acceleration" (dotnet…
[Xamarin.Android.Build.Tasks] Support VS "Build Acceleration" (#9042)