错误MSB3027:无法复制"C:\ pagefile.sys".到"bin \ roslyn \ pagefile.sys".重试计数超过10.失败 [英] Error MSB3027: Could not copy "C:\pagefile.sys" to "bin\roslyn\pagefile.sys". Exceeded retry count of 10. Failed

查看:843
本文介绍了错误MSB3027:无法复制"C:\ pagefile.sys".到"bin \ roslyn \ pagefile.sys".重试计数超过10.失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VS 2013中始终遇到此错误:

无法将"C:\ pagefile.sys"复制到"bin \ roslyn \ pagefile.sys". 重试计数超过10.失败.无法复制文件 将"C:\ pagefile.sys"更改为"bin \ roslyn \ pagefile.sys".该过程不能 访问文件

请帮助我.

解决方案

Pramod的评论中的答案所示,问题源自 Microsoft.CodeDom.Providers.DotNetCompilerPlatform nuget程序包,特别是从版本 1.0.0 升级到 1.0.1 .

但是,对我而言,使用Visual Studio降级会导致进一步的构建错误.为了解决该问题,我不得不手动编辑csproj和packages.config文件,删除对 Microsoft.Net.Compilers Microsoft.CodeDom.Providers.DotNetCompilerPlatform 的所有引用./p>

具体来说,这意味着:

  • 删除两个库的所有版本的相关<Import Project="...部分(通常在csproj的开头)
  • 删除两个库的两个版本的<Reference Include="...部分
  • EnsureNuGetPackageBuildImports目标部分中删除两个库的两个版本的<Error Condition="!Exists(...部分
  • 从packages.config中删除所有Microsoft.CodeDom.Providers.DotNetCompilerPlatformMicrosoft.Net.Compilers软件包.

然后,我能够在VS和(按顺序)中管理项目nuget包:

  • 添加 Microsoft.Net.Compilers 版本 1.2.2
  • 添加 Microsoft.CodeDom.Providers.DotNetCompilerPlatform 版本 1.0.1

这解决了页面文件构建错误和运行时错误,这些错误促使我首先尝试升级.

I am consistently getting this error with VS 2013:

Could not copy "C:\pagefile.sys" to "bin\roslyn\pagefile.sys". Exceeded retry count of 10. Failed. Unable to copy file "C:\pagefile.sys" to "bin\roslyn\pagefile.sys". The process cannot access the file

Please help me.

解决方案

As indicated in this answer from Pramod's comment the problem stems from the Microsoft.CodeDom.Providers.DotNetCompilerPlatform nuget package, specifically upgrading from version 1.0.0 to 1.0.1.

For me however, downgrading using Visual Studio caused further build errors. To solve the problem I had to manually edit my csproj and packages.config files, removing all references to Microsoft.Net.Compilers and Microsoft.CodeDom.Providers.DotNetCompilerPlatform.

Specifically, this meant:

  • Removing the relevant <Import Project="... sections for all versions of both libraries (usually towards the beginning of the csproj)
  • Removing the <Reference Include="... sections for both versions of both libraries
  • Removing the <Error Condition="!Exists(... sections for both versions of both libraries from within the EnsureNuGetPackageBuildImports target section
  • Removing all Microsoft.CodeDom.Providers.DotNetCompilerPlatform and Microsoft.Net.Compilers packages from the packages.config.

I was then able to manage the projects nuget packages in VS and (in order) :

  • Add Microsoft.Net.Compilers version 1.2.2
  • Add Microsoft.CodeDom.Providers.DotNetCompilerPlatform version 1.0.1

This solved the pagefile build error, and the runtime error which prompted me to try and upgrade in the first place.

这篇关于错误MSB3027:无法复制"C:\ pagefile.sys".到"bin \ roslyn \ pagefile.sys".重试计数超过10.失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆