File locking

I have a large C# 6.0 project using .NET 4.6. I am able to debug my main solution item -- my server application. But it locks the files so that I cannot debug any other solution items, such as my client application, while the server is running. This is not an issue in Visual Studio, where I am able to debug other solution items while debugging the main server application.

 

Microsoft.Common.CurrentVersion.targets(4187, 5): [MSB3027] Could not copy "obj\x64\Debug\EDC Library.dll" to "..\..\Debug\EDC Library.dll". Exceeded retry count of 10. Failed. The file is locked by: "JetBrains JetBrains.Debugger.Worker (37004), AIMS Server (28532)"


Microsoft.Common.CurrentVersion.targets(4187, 5): [MSB3021] Unable to copy file "obj\x64\Debug\EDC Library.dll" to "..\..\Debug\EDC Library.dll". The process cannot access the file '..\..\Debug\EDC Library.dll' because it is being used by another process.

 

0
11 comments

Hi Dan,

 

Could you clarify what happens if you build the entire solution (Build->Build Solution) before debugging the server or the client? In case your solution contains too many projects, please build both debug targets - the server and the client.

0

Hi Kirill Filin. The same error occurs when I build the entire solution before debugging. I also just discovered that if I try running the client application through Rider, it doesn't load and throws no errors.

0

Dan, could you send us Rider logs with additional tracing information? To collect the logs, please follow the steps described below:

  1. Enable Debugger, MsBuildTask and SolutionBuilder scenarios under Help->Diagnostic Tools->Choose Trace Scenarios
  2. Reproduce both issues - first try to run just the Client app and then try to debug both Client and the Server
  3. Collect the logs (Help->Collect Logs) and disable the tracing scenarios

You can send the logs via the Upload Service. Please let us know the Upload ID generated by the service.

0

Kirill Filin The upload id is for running my AIMS Admin app after running AIMS Server 2020_10_21_7UMPXQGy4aTgMobC

The upload id for running my AIMS Server app, stopping it, and running AIMS Admin is 2020_10_21_NEdBvVfYYUtXuhkH

The debugger says it can't find the assemblies -- but this is all working accordingly in Visual Studio Pro

0

Hello Dan,

 

Thank you for the logs. Would it be possible to send us the .csproject files of the Client and the Server as well?

0

2020_10_29_GbmVAAdLwQfEnrUY

2020_10_29_CdNx4PA4KiXiA6vf 

0

Thank you for the project files Dan!

 

We're looking into the build events you are using, and it seems like we'll need one more .csproj - the one that belongs to EDC Library (DLLs\EDC Library\EDC Library.csproj). Would it be possible to send us this file?

0

2020_11_10_AoGZAKEZEjNjKu6v

0

Dan, we've looked into your project and, it seems that every time you build AIMS Server and AIMS Admin (and any other project that depends on EDC Library), MSBuild will attempt to copy the EDC Library DLL to the <OutputPath>. This is unnecessary because EDC Library will be copied to the output directory once the EDC Library project is built.

 

To avoid this, please add the <ReferenceOutputAssembly> metadata to the .csproj of the projects that reference this library. The <ProjectReference> of EDC Library will look like this:

    <ProjectReference Include="..\DLLs\EDC Library\EDC Library.csproj">
<Project>{DDE83CC1-9454-4105-A8BC-1A499854D76B}</Project>
<Name>EDC Library</Name>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>

 

Let us know if the debugging issue persists once you alter the ProjectReferences.

0

That change breaks all my projects, which will no longer build.

0

Hello Dan,

 

Thank you for the update. I'm sorry to hear that the ReferenceOutputAssembly change did not help. Could you temporarily add <ReferenceOutputAssembly>false</ReferenceOutputAssembly> to the projects, build the solution, and collect the Rider logs so that we could look into the build failure?

 

In the meantime, you can remove the "Build project" action executed before launch from all Run configurations and build the projects or the solution independently before debugging the projects with Rider. I realize that this approach is frustrating and inconvenient, but this is the only workaround we have at this time.

 

0

Please sign in to leave a comment.