New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rosyln files locked during deployment(msdeploy) and fails with ERROR_FILE_IN_USE #58
Comments
Posted here according to this thread: https://github.com/dotnet/roslyn/issues/28856#issuecomment-409295213 |
Looks like we have the same problems with nearly the same configurations. Except that we don't use TeamCity when the problem occours and that we publish to our local IIS on the same machine. |
Asp.net runtime compilation uses the Roslyn compiler under bin\roslyn folder to do the dynamic compilation. Based on the error, it looks like that asp.net was compiling the views when you were trying to deploy the app to the IIS. One option is to fully pre-compile the views on the CI machine, so that you don't need to publish Roslyn compiler files. |
Can Roslyn compiler be killed on deploy? Currently, there is no option to kill roslyn compiler from msdeploy or msbuild |
msdeploy won't be able to stop Roslyn compiler on the web server. You can set environment variable VBCSCOMPILER_TTL to reduce TTL of Roslyn compiler process. Or you can precompile all the views on your build machine and then Roslyn compiler won't be used on the web server. |
Version Used:
MVC 5
.Net version 4.6.1
Microsoft.CodeDom.Providers.DotNetCompilerPlatform 2.0.0
Microsoft.Net.Compilers 2.8.2
Windows Server 2016
IIS 10.0.14393.0
TeamCity 2018.1
Steps to Reproduce:
NOTE: I'm doing all this from TeamCity CI
Expected Behavior:
Successfully deployed the site to IIS
Actual Behavior:
Error Code: ERROR_FILE_IN_USE
[16:18:10]More Information: Web Deploy cannot modify the file 'csc.exe' on the destination because it is locked by an external process. In order to allow the publish operation to succeed, you may need to either restart your application to release the lock, or use the AppOffline rule handler for .Net applications on your next publish attempt. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE.
Also: Every file in bin\roslyn folder has same issue. It shows different files being locked on every deployment with that error. My razor views are also using c#6 features.
The text was updated successfully, but these errors were encountered: