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
@B1337 can you provide diagnostic build output for step 4. I suspect that the IncrementalClean target from MSBuild is deleting the files. We might need to get someone from the MSbuild team to look at this issue.
@B1337 are you able to repo the same issue using a normal console application? I have a feeling this is expected behaviour. If you have binaries that you reference directly I would not put those in the output folder. I put those in a different folder called "References" they will be copied into the output as part of the build process.
After many tries I was unable to reproduce the issue with a normal console app. Where the steps to reproduce are simple the issue should've occurred already.
@B1337 I have been trying to repo this issue using the instructions provided and have been unable too on the latest stable release.
Can you provide a test project which replicates the issue?
Thanks, I can now repo the issue. As I suspected the MSBuild IncrementalClean is causing the problem. The Core.dll and a bunch of other files are removed which you can see in the CleanOrphanFilesDeleted ItemGroup. Now I can figure out how to work around this issue.
@dellis1972 I have included the FixUp.targets and imported in my .csproj, but nothing has changed. IncrementalClean still deletes my .dll and then the build crashes when it can't load it.
Can you share more details on how to implement the workaround?
I tried importing it like this
Double checked the relative path, it's fine, and there's other targets in that same folder that do get hit.
Then i tried moving the .targets file to the same folder as my .csproj, and referecing just like you indicated, even keeping the same file name as you show <Import Project="FixUp.targets" />
but still it keeps failing when building through VSTS
Milos
Can you post the diagnostic output from the build which included the new
fix targets.
We should be able to search through the output and see why its not being
run.
from the command line you get diagnostic output by adding `/v:diag` to the
msbuild invocation.
@jonpryor Would you please share details how to apply your mentioned workaround until 15.7 is released?
To work around this problem we just need to tell the IncrementalClean target to ignore any dll in the $(OutDir). Since
we already have a target in place to handle this we can just expand
the list of files it should be ignoring.
Reacted by Roar Gjøvaag, Keagan Gradidge, Erlend Angelsen and BOSQUET Alexandre
Seems the workaround is simply ignored according to the log:
The target "_RegisterAndroidFilesWithFileWrites" listed in a BeforeTargets attribute at "c:\agent_work\5\s\BuildFails\BuildFails\BuildFails.Android\FixUp.targets (2,29)" does not exist in the project, and will be ignored.
@dellis1972 : Would be great if you could implement your workaround in the repro project I uploaded in bugzilla and share with us the result.
Activity
dellis1972 commentedon Jan 10, 2018
@B1337 can you provide diagnostic build output for step 4. I suspect that the
IncrementalCleantarget from MSBuild is deleting the files. We might need to get someone from the MSbuild team to look at this issue.B1337 commentedon Jan 12, 2018
I updated VS and with Xamarin.Droid version 8.1.3 the issue is still there.
Here is the output from a test project:
Output Test App.txt
dellis1972 commentedon Jan 18, 2018
@B1337 are you able to repo the same issue using a normal console application? I have a feeling this is expected behaviour. If you have binaries that you reference directly I would not put those in the output folder. I put those in a different folder called "References" they will be copied into the output as part of the build process.
B1337 commentedon Jan 19, 2018
I wasn't able to reproduce this by building iOS or UWP so I don't think a console app will either but I will try it anyway.
B1337 commentedon Jan 19, 2018
After many tries I was unable to reproduce the issue with a normal console app. Where the steps to reproduce are simple the issue should've occurred already.
dellis1972 commentedon Jan 22, 2018
@B1337 I have been trying to repo this issue using the instructions provided and have been unable too on the latest stable release.
Can you provide a test project which replicates the issue?
B1337 commentedon Jan 22, 2018
Edit:
Seemed to be missing some projects.
dellis1972 commentedon Jan 22, 2018
@B1337 it seems to be misspend Core.csproj?
B1337 commentedon Jan 22, 2018
Sorry, here is the complete project.
Also included are droid and iOS.
App1.zip
dellis1972 commentedon Jan 22, 2018
Thanks, I can now repo the issue. As I suspected the MSBuild
IncrementalCleanis causing the problem. The Core.dll and a bunch of other files are removed which you can see in theCleanOrphanFilesDeletedItemGroup. Now I can figure out how to work around this issue.7 remaining items
[Xamarin.Android.Build.Tasks] Stop IncrementalClean removing assembli…
irreal commentedon Feb 1, 2018
@dellis1972 I have included the FixUp.targets and imported in my .csproj, but nothing has changed. IncrementalClean still deletes my .dll and then the build crashes when it can't load it.
Can you share more details on how to implement the workaround?
I tried importing it like this
Double checked the relative path, it's fine, and there's other targets in that same folder that do get hit.
Then i tried moving the .targets file to the same folder as my .csproj, and referecing just like you indicated, even keeping the same file name as you show
<Import Project="FixUp.targets" />but still it keeps failing when building through VSTS
Any ideas?
dellis1972 commentedon Feb 1, 2018
modplug commentedon Feb 1, 2018
I also tried to apply the patch without success
alexstrong29 commentedon Feb 1, 2018
I have also tried the workaround but no luck. Although the error is now different but I can't really make sense of it.
quality-catalyst commentedon Feb 2, 2018
@jonpryor Would you please share details how to apply your mentioned workaround until 15.7 is released?
mr-kg commentedon Feb 4, 2018
Also in the same boat here. My CI/CD is halted at the moment .
abosquet commentedon Feb 6, 2018
This workaround doesn't work for me too.
My referenced dlls are still deleted.
I tried to implement it in the minimal repro project I posted initially in bugzilla:
https://bugzilla.xamarin.com/show_bug.cgi?id=61108
Seems the workaround is simply ignored according to the log:
The target "_RegisterAndroidFilesWithFileWrites" listed in a BeforeTargets attribute at "c:\agent_work\5\s\BuildFails\BuildFails\BuildFails.Android\FixUp.targets (2,29)" does not exist in the project, and will be ignored.
@dellis1972 : Would be great if you could implement your workaround in the repro project I uploaded in bugzilla and share with us the result.
alexstrong29 commentedon Feb 6, 2018
@dellis1972 FYI Applying your suggested fix of changing BeforeTargets="IncrementalClean" in the FixUp.targets file worked!
mr-kg commentedon Feb 6, 2018
Thank you! Build success! Perhaps update the Gist (https://gist.github.com/dellis1972/84710bdefedf3d3c48760232071f81a4) ?
modplug commentedon Feb 9, 2018
Thanks. Just got my build working again
[Xamarin.Android.Build.Tasks] Stop IncrementalClean removing assembli…