无法删除 in oslynVBCSCompiler.exe - 访问被拒绝 [英] Can not delete in oslynVBCSCompiler.exe - Access is denied

查看:35
本文介绍了无法删除 in oslynVBCSCompiler.exe - 访问被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正面临来自 roslyn 编译器的一个奇怪问题.有时,当我构建解决方案时,我会在错误列表中遇到一个奇怪的问题,该问题不允许我构建解决方案.这是错误:

I am facing a strange issue from roslyn compiler. Sometimes when I build the solution I face a strange issue in error list which does not let me build the solution. Here is the error:

严重性代码描述项目文件行抑制状态错误无法将文件D:Sealogical New WebsiteSealogicalWebsitepackagesMicrosoft.Net.Compilers.1.0.0 oolscsc.exe"复制到bin oslyncsc.exe".拒绝访问路径bin oslyncsc.exe".Sealogical网站

Severity Code Description Project File Line Suppression State Error Unable to copy file "D:Sealogical New WebsiteSealogicalWebsitepackagesMicrosoft.Net.Compilers.1.0.0 oolscsc.exe" to "bin oslyncsc.exe". Access to the path 'bin oslyncsc.exe' is denied. SealogicalWebsite

严重性代码描述项目文件行抑制状态错误 无法将文件D:Sealogical New WebsiteSealogicalWebsitepackagesMicrosoft.Net.Compilers.1.0.0 oolsVBCSCompiler.exe"复制到bin oslynVBCSCompiler.exe".拒绝访问路径bin oslynVBCSCompiler.exe".Sealogical网站

Severity Code Description Project File Line Suppression State Error Unable to copy file "D:Sealogical New WebsiteSealogicalWebsitepackagesMicrosoft.Net.Compilers.1.0.0 oolsVBCSCompiler.exe" to "bin oslynVBCSCompiler.exe". Access to the path 'bin oslynVBCSCompiler.exe' is denied. SealogicalWebsite

  1. 我尝试清理解决方案并重建它,但再次不起作用.

  1. I try to clean the solution and rebuild it but does not work again.

尝试手动删除文件但再次显示错误指出我没有执行此操作的正确权限:

Tried to delete files manually but again shows an error pointing out I do not have right permissions to do this:

尝试从 CMD 中删除,但再次显示相同的错误:

Tried deleting from CMD but again shows the same error:

删除 roslyn 生成的文件的唯一方法是重新启动 PC,重新启动后,我可以毫无问题地手动删除它们.

The only way to delete roslyn generated files is by restarting the PC and when restarted I can delete them manually without a problem.

我是我电脑的管理员,所以我猜这没有问题.

I am administrator in my PC so there is no problem with that I guess.

这个问题似乎发生在 Visual Studi0 2015 和 Visual Studio 2017 中.

This problem seems to happen in Visual Studi0 2015 and Visual Studio 2017.

我不喜欢每天重启电脑 4-5 次或更多次,这就是我在这里问的原因.

I dont like restarting the PC 4-5 times a day or more thats why I am asking here.

其他一些细节:

  • 我是创建这个项目的人,所以理论上它不应该做这个动作有问题.

  • I am the one who created this project so theoretically it should not be a problem to do this action.

当项目第一次创建时,我确实在管理员模式,就像我现在所做的一样.

When the project first created I did run the Visual Studion in Administrator Mode as I am doing now.

我可以找到从 web.config 中删除这部分的解决方案,这样它就不会生成这些文件:

I could find a solution to remove this part from web.config so it does not generate those files:

<compilers>
  <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
  <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=&quot;Web&quot; /optionInfer+" />
</compilers>

但是此解决方案会导致新的 c# 6 功能出现问题,因此我无法删除此部分.....

But this solution would cause problem with new c# 6 features so I can not remove this section.....

此外,我在 CMD 中尝试了此命令以查看是否有进程锁定此文件,但无论如何它根本没有显示任何进程:

Furthermore I tried this command in CMD to see if there is a process locking this file but anyway it did not show me any process at all:

C:WINDOWSsystem32>tasklist /m D:SealogicalNewWebsiteSealogicalWebsiteSealogicalWebsitein
oslyncsc.exe
INFO: No tasks are running which match the specified criteria.

有人知道如何处理这个奇怪的问题吗?

Does anybody knows a way how to handle this strange issue ?

推荐答案

同样的问题 - 对我来说解决方案是关闭 VS,打开任务管理器并结束 VBCSCompiler.exe 的所有实例,如下所示:https://developercommunity.visualstudio.com/content/problem/71302/binroslyn-files-locked-during-build.html

Same problem here - solution for me was closing VS, open task manager and end all instances of VBCSCompiler.exe as mentionend here: https://developercommunity.visualstudio.com/content/problem/71302/binroslyn-files-locked-during-build.html

这篇关于无法删除 in oslynVBCSCompiler.exe - 访问被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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