Skip to content
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

Enable to access dll because it is being used by another process. #11872

Closed
rmarinho opened this issue Dec 5, 2022 · 3 comments · Fixed by #19140
Closed

Enable to access dll because it is being used by another process. #11872

rmarinho opened this issue Dec 5, 2022 · 3 comments · Fixed by #19140
Assignees
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView area-testing Unit tests, device tests feature-blazor-maui Issues in Blazor in .NET MAUI s/triaged Issue has been reviewed t/bug Something isn't working testing-flakiness

Comments

@rmarinho
Copy link
Member

rmarinho commented Dec 5, 2022

Description

The MAUI repository on net6 used parallel builds to build faster. When moving to .net7.0 we found a couple of issues and had to disable the build in parallel solution wide while we worked on these problems.

One of the last remaining problems only happens when build MauiRazorClassLibrarySample in Release mode and seems to be only on macOS. It complains it can't copy the MauiRazorClassLibrarySample.dll to the bin folder.

Steps to Reproduce

1 - Clone MAUI
2- Checkout the main
3 - Remove the line on MauiRazorClassLibrarySample.csproj <BuildInParallel Condition="'$(Configuration)' == 'Release'">false</BuildInParallel>
4 - Build on release mode on macOS

Link to public reproduction project repository

https://github.com/dotnet/maui/

Version with bug

7.0 (current)

Last version that worked well

6.0.424

Affected platforms

I was not able test on other platforms

Affected platform versions

Did you find any workaround?

Set BuildInParallel to false on MauiRazorClassLibrarySample

Relevant log output

Users/builder/azdo/_work/2/s/bin/dotnet/sdk/7.0.100/Microsoft.Common.CurrentVersion.targets(4685,5): warning MSB3026: Could not copy "obj/Release/net7.0/MauiRazorClassLibrarySample.dll" to "bin/Release/net7.0/MauiRazorClassLibrarySample.dll". Beginning retry 1 in 1000ms. The process cannot access the file '/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/bin/Release/net7.0/MauiRazorClassLibrarySample.dll' because it is being used by another process.  [/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/MauiRazorClassLibrarySample.csproj]
/Users/builder/azdo/_work/2/s/bin/dotnet/sdk/7.0.100/Microsoft.Common.CurrentVersion.targets(4685,5): warning MSB3026: Could not copy "obj/Release/net7.0/MauiRazorClassLibrarySample.dll" to "bin/Release/net7.0/MauiRazorClassLibrarySample.dll". Beginning retry 2 in 1000ms. The process cannot access the file '/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/bin/Release/net7.0/MauiRazorClassLibrarySample.dll' because it is being used by another process.  [/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/MauiRazorClassLibrarySample.csproj]
/Users/builder/azdo/_work/2/s/bin/dotnet/sdk/7.0.100/Microsoft.Common.CurrentVersion.targets(4685,5): warning MSB3026: Could not copy "obj/Release/net7.0/MauiRazorClassLibrarySample.dll" to "bin/Release/net7.0/MauiRazorClassLibrarySample.dll". Beginning retry 3 in 1000ms. The process cannot access the file '/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/bin/Release/net7.0/MauiRazorClassLibrarySample.dll' because it is being used by another process.  [/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/MauiRazorClassLibrarySample.csproj]
/Users/builder/azdo/_work/2/s/bin/dotnet/sdk/7.0.100/Microsoft.Common.CurrentVersion.targets(4685,5): warning MSB3026: Could not copy "obj/Release/net7.0/MauiRazorClassLibrarySample.dll" to "bin/Release/net7.0/MauiRazorClassLibrarySample.dll". Beginning retry 4 in 1000ms. The process cannot access the file '/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/bin/Release/net7.0/MauiRazorClassLibrarySample.dll' because it is being used by another process.  [/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/MauiRazorClassLibrarySample.csproj]
/Users/builder/azdo/_work/2/s/bin/dotnet/sdk/7.0.100/Microsoft.Common.CurrentVersion.targets(4685,5): warning MSB3026: Could not copy "obj/Release/net7.0/MauiRazorClassLibrarySample.dll" to "bin/Release/net7.0/MauiRazorClassLibrarySample.dll". Beginning retry 5 in 1000ms. The process cannot access the file '/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/bin/Release/net7.0/MauiRazorClassLibrarySample.dll' because it is being used by another process.  [/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/MauiRazorClassLibrarySample.csproj]
/Users/builder/azdo/_work/2/s/bin/dotnet/sdk/7.0.100/Microsoft.Common.CurrentVersion.targets(4685,5): warning MSB3026: Could not copy "obj/Release/net7.0/MauiRazorClassLibrarySample.dll" to "bin/Release/net7.0/MauiRazorClassLibrarySample.dll". Beginning retry 6 in 1000ms. The process cannot access the file '/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/bin/Release/net7.0/MauiRazorClassLibrarySample.dll' because it is being used by another process.  [/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/MauiRazorClassLibrarySample.csproj]
/Users/builder/azdo/_work/2/s/bin/dotnet/sdk/7.0.100/Microsoft.Common.CurrentVersion.targets(4685,5): warning MSB3026: Could not copy "obj/Release/net7.0/MauiRazorClassLibrarySample.dll" to "bin/Release/net7.0/MauiRazorClassLibrarySample.dll". Beginning retry 7 in 1000ms. The process cannot access the file '/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/bin/Release/net7.0/MauiRazorClassLibrarySample.dll' because it is being used by another process.  [/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/MauiRazorClassLibrarySample.csproj]
/Users/builder/azdo/_work/2/s/bin/dotnet/sdk/7.0.100/Microsoft.Common.CurrentVersion.targets(4685,5): warning MSB3026: Could not copy "obj/Release/net7.0/MauiRazorClassLibrarySample.dll" to "bin/Release/net7.0/MauiRazorClassLibrarySample.dll". Beginning retry 8 in 1000ms. The process cannot access the file '/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/bin/Release/net7.0/MauiRazorClassLibrarySample.dll' because it is being used by another process.  [/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/MauiRazorClassLibrarySample.csproj]
/Users/builder/azdo/_work/2/s/bin/dotnet/sdk/7.0.100/Microsoft.Common.CurrentVersion.targets(4685,5): warning MSB3026: Could not copy "obj/Release/net7.0/MauiRazorClassLibrarySample.dll" to "bin/Release/net7.0/MauiRazorClassLibrarySample.dll". Beginning retry 9 in 1000ms. The process cannot access the file '/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/bin/Release/net7.0/MauiRazorClassLibrarySample.dll' because it is being used by another process.  [/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/MauiRazorClassLibrarySample.csproj]
/Users/builder/azdo/_work/2/s/bin/dotnet/sdk/7.0.100/Microsoft.Common.CurrentVersion.targets(4685,5): warning MSB3026: Could not copy "obj/Release/net7.0/MauiRazorClassLibrarySample.dll" to "bin/Release/net7.0/MauiRazorClassLibrarySample.dll". Beginning retry 10 in 1000ms. The process cannot access the file '/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/bin/Release/net7.0/MauiRazorClassLibrarySample.dll' because it is being used by another process.  [/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/MauiRazorClassLibrarySample.csproj]
/Users/builder/azdo/_work/2/s/bin/dotnet/sdk/7.0.100/Microsoft.Common.CurrentVersion.targets(4752,5): warning MSB3026: Could not copy "obj/Release/net7.0/MauiRazorClassLibrarySample.pdb" to "bin/Release/net7.0/MauiRazorClassLibrarySample.pdb". Beginning retry 1 in 1000ms. The process cannot access the file '/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/bin/Release/net7.0/MauiRazorClassLibrarySample.pdb' because it is being used by another process.  [/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/MauiRazorClassLibrarySample.csproj]
/Users/builder/azdo/_work/2/s/bin/dotnet/sdk/7.0.100/Microsoft.Common.CurrentVersion.targets(4752,5): warning MSB3026: Could not copy "obj/Release/net7.0/MauiRazorClassLibrarySample.pdb" to "bin/Release/net7.0/MauiRazorClassLibrarySample.pdb". Beginning retry 2 in 1000ms. The process cannot access the file '/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/bin/Release/net7.0/MauiRazorClassLibrarySample.pdb' because it is being used by another process.  [/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/MauiRazorClassLibrarySample.csproj]
/Users/builder/azdo/_work/2/s/bin/dotnet/sdk/7.0.100/Microsoft.Common.CurrentVersion.targets(4752,5): warning MSB3026: Could not copy "obj/Release/net7.0/MauiRazorClassLibrarySample.pdb" to "bin/Release/net7.0/MauiRazorClassLibrarySample.pdb". Beginning retry 3 in 1000ms. The process cannot access the file '/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/bin/Release/net7.0/MauiRazorClassLibrarySample.pdb' because it is being used by another process.  [/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/MauiRazorClassLibrarySample.csproj]
/Users/builder/azdo/_work/2/s/bin/dotnet/sdk/7.0.100/Microsoft.Common.CurrentVersion.targets(4752,5): warning MSB3026: Could not copy "obj/Release/net7.0/MauiRazorClassLibrarySample.pdb" to "bin/Release/net7.0/MauiRazorClassLibrarySample.pdb". Beginning retry 4 in 1000ms. The process cannot access the file '/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/bin/Release/net7.0/MauiRazorClassLibrarySample.pdb' because it is being used by another process.  [/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/MauiRazorClassLibrarySample.csproj]
/Users/builder/azdo/_work/2/s/bin/dotnet/sdk/7.0.100/Microsoft.Common.CurrentVersion.targets(4685,5): error MSB3027: Could not copy "obj/Release/net7.0/MauiRazorClassLibrarySample.dll" to "bin/Release/net7.0/MauiRazorClassLibrarySample.dll". Exceeded retry count of 10. Failed.  [/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/MauiRazorClassLibrarySample.csproj]
/Users/builder/azdo/_work/2/s/bin/dotnet/sdk/7.0.100/Microsoft.Common.CurrentVersion.targets(4685,5): error MSB3021: Unable to copy file "obj/Release/net7.0/MauiRazorClassLibrarySample.dll" to "bin/Release/net7.0/MauiRazorClassLibrarySample.dll". The process cannot access the file '/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/bin/Release/net7.0/MauiRazorClassLibrarySample.dll' because it is being used by another process. [/Users/builder/azdo/_work/2/s/src/BlazorWebView/samples/MauiRazorClassLibrarySample/MauiRazorClassLibrarySample.csproj]
    14 Warning(s)
    2 Error(s)
@rmarinho rmarinho added t/bug Something isn't working area-blazor Blazor Hybrid / Desktop, BlazorWebView feature-blazor-maui Issues in Blazor in .NET MAUI labels Dec 5, 2022
@rmarinho rmarinho added this to the Backlog milestone Dec 5, 2022
@dotnet dotnet deleted a comment Dec 5, 2022
@Eilon Eilon removed this from the Backlog milestone Dec 5, 2022
@homeyf
Copy link
Collaborator

homeyf commented Oct 31, 2023

Verified this issue with VSM 17.6.5 (build 417). Not repro on mac OS and build successfully with sample project.
https://github.com/dotnet/maui/
image

@homeyf homeyf added s/triaged Issue has been reviewed s/try-latest-version Please try to reproduce the potential issue on the latest public version labels Oct 31, 2023
@ghost
Copy link

ghost commented Oct 31, 2023

Hi @rmarinho. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.

You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@rmarinho
Copy link
Member Author

This is still an issue on our repo.

@ghost ghost removed the s/try-latest-version Please try to reproduce the potential issue on the latest public version label Oct 31, 2023
@rmarinho rmarinho added area-testing Unit tests, device tests testing-flakiness labels Nov 30, 2023
@rmarinho rmarinho linked a pull request Nov 30, 2023 that will close this issue
@github-actions github-actions bot locked and limited conversation to collaborators Dec 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView area-testing Unit tests, device tests feature-blazor-maui Issues in Blazor in .NET MAUI s/triaged Issue has been reviewed t/bug Something isn't working testing-flakiness
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants