restore force does not properly clear FileListAbsolute
See original GitHub issueDescription
paket restore -f
does not clear obj\release\netstandard2.0<project name>.fsproj.FileListAbsolute.txt, but rather it appears to rely on appending to the file.
For most purposes this does not seem to cause problems, but some corner cases will fail. Specifically, the build target in my build script works, but it fails in doc generation looking for the wrong path to document templates.
Repro steps
I sync my source repos between 2 machines. The root paths on the machines differ.
paket restore on machine 1
go to machine 2, paket restore -f
Expected behavior
All files should be initialized for machine 2
Actual behavior
Paths to both machine 1 and machine 2 are in file
<machine 1 root>\DependentTypes\src\DependentTypes\bin\Release\netstandard2.0\DependentTypes.deps.json
<machine 1 root>\DependentTypes\src\DependentTypes\bin\Release\netstandard2.0\DependentTypes.dll
<machine 1 root>\DependentTypes\src\DependentTypes\bin\Release\netstandard2.0\DependentTypes.pdb
<machine 1 root>\DependentTypes\src\DependentTypes\bin\Release\netstandard2.0\DependentTypes.xml
<machine 1 root>\DependentTypes\src\DependentTypes\obj\Release\netstandard2.0\DependentTypes.fsprojAssemblyReference.cache
<machine 1 root>\DependentTypes\src\DependentTypes\obj\Release\netstandard2.0\DependentTypes.dll
<machine 1 root>\DependentTypes\src\DependentTypes\obj\Release\netstandard2.0\DependentTypes.xml
<machine 1 root>\DependentTypes\src\DependentTypes\obj\Release\netstandard2.0\DependentTypes.pdb
<machine 2 root>\DependentTypes\src\DependentTypes\bin\Release\netstandard2.0\DependentTypes.deps.json
<machine 2 root>\DependentTypes\src\DependentTypes\bin\Release\netstandard2.0\DependentTypes.dll
<machine 2 root>\DependentTypes\src\DependentTypes\bin\Release\netstandard2.0\DependentTypes.pdb
<machine 2 root>\DependentTypes\src\DependentTypes\bin\Release\netstandard2.0\DependentTypes.xml
<machine 2 root>\DependentTypes\src\DependentTypes\obj\Release\netstandard2.0\DependentTypes.fsprojAssemblyReference.cache
<machine 2 root>\DependentTypes\src\DependentTypes\obj\Release\netstandard2.0\DependentTypes.dll
<machine 2 root>\DependentTypes\src\DependentTypes\obj\Release\netstandard2.0\DependentTypes.xml
<machine 2 root>\DependentTypes\src\DependentTypes\obj\Release\netstandard2.0\DependentTypes.pdb
Known workarounds
Manually clear obj folders.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
msbuild - What is the proper way to add a file to XYZ.csproj. ...
OK, I found it. Just add the file to the FileWrites item list, like this:
Read more >Chronic problem checking in even when clearing cache
I unbound the Valid binds in VS 2010 and rebinded and when doing so I was forced to login to the Vault server...
Read more >'The process cannot access the file' during CI build ...
This has been happening a few times recently. It's odd because BlazorTemplates.Tests doesn't depend on Microsoft.DotNet.Web.Spa.
Read more >Pro Addins not working anymore once built with MSVS 2019
Solved: Hello, I have a toolbar Addin which stopped working once we moved from Visual Studio 2017 to VS 2019.
Read more >Troubleshooting NuGet Package Restore in Visual Studio
You may encounter build errors due to missing files, with a message saying to use NuGet restore to download them. However, running a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FileListAbsolute is an attempt at listing files produced in past and future builds so that Clean will clean them up. It is not consumed (only produced) during a normal build, you can see its usage here: https://github.com/Microsoft/msbuild/blob/b3f9eeab651c92bade6e4f64d11b59aa39e149cb/src/Tasks/Microsoft.Common.CurrentVersion.targets#L5011. If you have a bug where the documentation generation step is getting the wrong file, it’s unlikely to be from this file.
Come to think of it, bottom up is also an incorrect strategy. The right thing to do is test for path existence, not just pattern matching.