I am consistently encountering this compile time error for a solution in Visual Studio 2017:
Could not copy the file "C:\pagefile.sys" because it was not found.
This began after fixing a previous warning that DotNetCompilerPlatform
could not be found in the same project. This was occurring because the path to packages
was actually one level higher than where the .csproj
file indicated. I speculate that happened during a reorganization of project folders prior to my involvement.
Anyway, once fixed I cleaned the project and ran Rebuild All. The foregoing error cropped up for the first time.
The issue seems similar to these questions:
- Error MSB3027: Could not copy “C:\pagefile.sys” to “bin\roslyn\pagefile.sys”
- Strange Build error after upgrading to Visual studio 2015 wants to copy pagefile.sys
However, I am dealing with a more recent version, 1.0.3
, of DotNetCompilerPlatform
. So, falling back does not seem like a good option and I am not sure how much of the answers to those questions apply to this scenario.