DotNetCoreBuild: DLL being used by another process, build fails #3041
-
Using dotnet 5.0.102 and cake.tool 0.38.5. Building via cake results in:
about every other time I run
The directories being cleaned are in the root of the working directory, while the code being built and the solution file are at "./src/" so the CleanDirectory should not be touching anything in the src folder. I have also tried changing the NoRestore, NoIncremental settings and removing them. This happens both locally and on my build machine, and also when I run the command from as administrator. I also tried to explicitly set the WorkingDirectory, same issue. Has anyone else been experiencing something like this? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
@fbd Cake does not do anything special. This is related to the dotnet process not shutting down properly. Try adding this to your script: Teardown(ctx => {
Information("Shutting down .NET core SDK tooling...");
DotNetCoreBuildServerShutdown(
new DotNetCoreBuildServerSettings {
MSBuild = true
});
}); |
Beta Was this translation helpful? Give feedback.
-
Thanks for the help! Although your suggested fixed increased the odds of success (not scientifically measured) I do encounter this error occasionally, but a direct call to |
Beta Was this translation helpful? Give feedback.
-
Thanks for your help! This is definitely not related to Cake like you say, I get those errors if I explicitly use the Thanks again. |
Beta Was this translation helpful? Give feedback.
@fbd Cake does not do anything special. This is related to the dotnet process not shutting down properly.
Microsoft added the
dotnet build-server
command just for this.Try adding this to your script: