2017-08-16 108 views
1

将Web项目发布到文件夹时,以下错误在日志中弹出。Visual Studio 2017将Web项目发布到文件夹失败

.... 
Publishing folder /... 
Publishing folder bin... 
Publishing folder bin/es... 
Publishing folder bin/roslyn... 
Unable to add 'bin/roslyn/System.IO.FileSystem.dll' to the Web site. Unable to add file 'bin\roslyn\System.IO.FileSystem.dll'. The process cannot access the file because it is being used by another process. 
Unable to add 'bin/roslyn/System.IO.FileSystem.Primitives.dll' to the Web site. Unable to add file 'bin\roslyn\System.IO.FileSystem.Primitives.dll'. The process cannot access the file because it is being used by another process. 
Unable to add 'bin/roslyn/System.Reflection.Metadata.dll' to the Web site. Unable to add file 'bin\roslyn\System.Reflection.Metadata.dll'. The process cannot access the file because it is being used by another process. 
Unable to add 'bin/roslyn/System.Security.Cryptography.Algorithms.dll' to the Web site. Unable to add file 'bin\roslyn\System.Security.Cryptography.Algorithms.dll'. The process cannot access the file because it is being used by another process. 
Unable to add 'bin/roslyn/System.Security.Cryptography.Primitives.dll' to the Web site. Unable to add file 'bin\roslyn\System.Security.Cryptography.Primitives.dll'. The process cannot access the file because it is being used by another process. 
Unable to add 'bin/roslyn/System.ValueTuple.dll' to the Web site. Unable to add file 'bin\roslyn\System.ValueTuple.dll'. The process cannot access the file because it is being used by another process. 
Unable to add 'bin/roslyn/VBCSCompiler.exe' to the Web site. Unable to add file 'bin\roslyn\VBCSCompiler.exe'. The process cannot access the file because it is being used by another process. 
Publishing folder bin/zh... 
... 
Publishing folder Views/WFDefs... 
Publish failed. Target file://machine/d$/PATH. 

如果我使用网络发布发布它的作品,但真正的目标不支持网络发布。

注意:VBCSCompiler未运行。

回答

0

在Visual Studio 2017社区版中有这个相同的问题。由于你的问题出现在谷歌,但没有答案,我想我会加入它。

我发现Process Explorer来自Sysinternals帮了我一大堆。

打开sysinternals并转到查找 - >查找句柄或DLL ...或(Ctrl + F)并搜索保持打开的文件。在我的情况下“System.IO.FileSystem.dll”

搜索结果显示两个MSBuild实例和一个VBCSCompiler挂在文件上。最糟糕的情况是,我刚刚杀死了进程树,建立了这个项目,一切都恢复得很好。

相关答案:https://serverfault.com/questions/1966/how-do-you-find-what-process-is-holding-a-file-open-in-windows

2

我有同样的问题,我与Visual Studio 2017年社区应用在我的情况下,溶液简单,我只是删除了目录的bin(C里面的所有文件:\项目\ DotNet \ ApplicationName \ bin)和我重新编译应用程序后。

我希望它能帮助你。

0

如果您尝试发布asp.net web应用程序在Azure和得到上面的错误然后尝试更新Microsoft.CodeDom.Providers.DotNetCompilerPlatform包V1.0.7或更高版本。最初,在您的应用程序中,会出现Microsoft.CodeDom.Providers.DotNetCompilerPlatform 1.0.5版,然后卸载,然后安装最新版本V1.0.7或更高版本的。清理您的解决方案并构建。现在,您将能够使用Visual Studio 2017在Azure中发布您的Web应用程序。

相关问题