5

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:

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.

Trevor Reid
  • 3,310
  • 4
  • 27
  • 46

1 Answers1

1

So, I noticed that multiple versions of DotNetCompilerPlatform were installed in the same solution:

enter image description here

The compile-time error went away after updating both projects to 1.0.7, though I do not have a lot to say on the how and why.

I also note that there are more up to date versions DotNetCompilerPlatform: 1.0.8, 2.0.0, and 2.0.1. For the time being though, I'm content with the smallest update that solves the problem at hand.

Update [2019-05-30]: Eventually, I did bring all projects up to the latest version of DotNetCompilerPlatform and the issue remained resolved so long as all versions in the solution were in sync.

Trevor Reid
  • 3,310
  • 4
  • 27
  • 46