Bug 54966 - Infinite build with errors "Could not write lines to file FileListAbsolute.txt"
Summary: Infinite build with errors "Could not write lines to file FileListAbsolute.txt"
Status: RESOLVED DUPLICATE of bug 54467
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: General ()
Version: 4.4.0 (15.1)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-04-10 14:37 UTC by Borisov
Modified: 2017-04-11 06:02 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Borisov 2017-04-10 14:37:24 UTC
Problem: new xamarin version cannot build our project. Build hangs forever.
* If I press Ctrl+Break during the build, output appears. There are thousands of errors: 34>C:\Program Files (x86)\MSBuild\14.0\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets(38,3): warning MSB3491: Could not write lines to file "obj\Debug\somename.csproj.FileListAbsolute.txt". The process cannot access the file 'somepath\somename\obj\Debug\somename.csproj.FileListAbsolute.txt' because it is being used by another process.
* Disabling parallel build doesn't help
* Xamarin didn't have such issue
* Files "FileListAbsolute.txt" contain thousands of lines
* It is not machine specific. Problem is observed on every PC where we updated Xamarin.

Unfortunately, I cannot send you source code. I tried to reproduce this issue in new project. Created several PCLs with thousand of classes, played with references between them, but without success. Problem is seen only with our project.

I compared Xamarin.Common.targets from current and version. The only difference is a dependence on target _SplitProjectReferencesByFileExistence. 

I replaced

After that, problem disappered. I'm not sure that it is correct fix, but if it is, please do it on your side. Fixing .targets after every xamarin update on every machine is not suitable solution.

Thank you.
Comment 1 Brendan Zagaeski (Xamarin Team, assistant) 2017-04-10 15:32:36 UTC
> The only difference is a dependence on target _SplitProjectReferencesByFileExistence.

For reference, the addition of that element is the fix for Bug 52760.

## Note to the Xamarin team

Perhaps this is a duplicate of Bug 54467?

## To the reporter (@Borisov)

If you get a chance to try applying the change from Bug 54467, Comment 13, that might be a quick way to check if this is indeed a duplicate of Bug 54467.

Here's the information about that change for reference:

For VS2017:
Edit the C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Microsoft.Common.Targets\ImportAfter\Xamarin.Common.targets

For VS2015:
Edit the C:\Program Files (x86)\MSBuild\14.0\Microsoft.Common.Targets\ImportAfter\Xamarin.Common.targets

(you'll need to be an administrator to edit either one)

Update the `GetBuiltProjectOutputRecursive` Target to contain the following nodes instead of the current ones:

			<_GetBuiltOutputProject Include="@(_MSBuildProjectReferenceExistent)"
									Condition="$(_BuiltProjectOutputs.Contains('%(_MSBuildProjectReferenceExistent.FullPath)')) == 'false'" />

			<!-- Add all the top-level projects that will be added by the @(BuiltProjectOutputGroupKeyOutput) further below -->
			<_BuiltProjectOutputs>$(_BuiltProjectOutputs)|$(MSBuildProjectFullPath)|@(_MSBuildProjectReferenceExistent->'%(FullPath)', '|')</_BuiltProjectOutputs>
Comment 2 Borisov 2017-04-11 06:02:49 UTC
Hello Brendan Zagaeski,

Thank you for your prompt reply. I tried your fix and it works! Do you have any ETA when it will be released?

*** This bug has been marked as a duplicate of bug 54467 ***