RazorClassLibrary Build Problem : Could not copy my project dll to main project output! The file is locked by "IIS EXpress ...""

Hamed Vaziri 136 Reputation points
2022-12-12T16:55:28.667+00:00

Hi everybody!
I have a main Blazor web project which load all "RazorClassLibrary" project outputs as components dynamically.
It works perfect. But when i open both my mainProject & my rcl project to make some modification(s), when i want to build my rcl project, i'm facing this error druring compile :

Error MSB3027 Could not copy "obj\Debug\net6.0\TestModule01.dll" to "D:\BlazorServerApp3.Web\bin\Debug\net6.0\TestModule01.dll". Exceeded retry count of 10. Failed. The file is locked by: "IIS Express Worker Process (19352)"

How to solve this issue or do you have an idea to avoid this problem?
Thanks in advance..

Developer technologies ASP.NET ASP.NET Core
Developer technologies .NET Blazor
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Washington 921 Reputation points MVP
    2022-12-12T19:00:43.317+00:00

    If the project is configured to show in the local IIS, stopping IIS, when building, resolves this issue.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.