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

Preview locks libs - Unable to use dotnet watch #447

Open
PerfectlyFineCode opened this issue Oct 22, 2024 · 2 comments
Open

Preview locks libs - Unable to use dotnet watch #447

PerfectlyFineCode opened this issue Oct 22, 2024 · 2 comments
Labels
kind:enhancement New feature or request status:help-wanted This issue could use help from the external contributors

Comments

@PerfectlyFineCode
Copy link

PerfectlyFineCode commented Oct 22, 2024

The previewer locks the xaml loader library which makes dotnet watch unable to start unless you kill the processes.
dotnet watch is required and the best option for HotAvalonia if you use .NET 7.0+

The file is locked by: ".NET Host (13984), .NET Host (37484)" [T:\source\Demo\Demo\Demo.csproj]
C:\Program Files\dotnet\sdk\8.0.400\Microsoft.Common.CurrentVersion.targets(5034,5): warning MSB3026: Could not copy "C:\Users\Redacted\.nuget\packages\avalonia.markup.xaml.loader\11.1.3\lib\net8.0\Avalonia.Markup.Xaml.Loader.dl
l" to "bin\Debug\net8.0\Avalonia.Markup.Xaml.Loader.dll". Beginning retry 2 in 1000ms. The process cannot access the file 'T:\source\Demo\Demo\bin\Debug\net8.0\Avalonia.Markup.Xaml.Loader.dll' because it is being used by 
 another process. The file is locked by: ".NET Host (13984), .NET Host (37484)" [T:\source\Demo\Demo\Demo.csproj]
C:\Program Files\dotnet\sdk\8.0.400\Microsoft.Common.CurrentVersion.targets(5034,5): warning MSB3026: Could not copy "C:\Users\Redacted\.nuget\packages\avalonia.markup.xaml.loader\11.1.3\lib\net8.0\Avalonia.Markup.Xaml.Loader.dl
l" to "bin\Debug\net8.0\Avalonia.Markup.Xaml.Loader.dll". Beginning retry 3 in 1000ms. The process cannot access the file 'T:\source\Demo\Demo\bin\Debug\net8.0\Avalonia.Markup.Xaml.Loader.dll' because it is being used by 
 another process. The file is locked by: ".NET Host (13984), .NET Host (37484)" [T:\source\Demo\Demo\Demo.csproj]
@ForNeVeR
Copy link
Owner

Well, yes, it does. The previewer needs to load the assembly, and on Windows this causes it to lock it on the disk, preventing recompilation.

Does HotAvalonia has any signal for the previewer to temporarily stop while it is recompiling the assembly?

@ForNeVeR ForNeVeR added kind:enhancement New feature or request status:help-wanted This issue could use help from the external contributors labels Oct 22, 2024
@PerfectlyFineCode
Copy link
Author

PerfectlyFineCode commented Oct 22, 2024

Well, yes, it does. The previewer needs to load the assembly, and on Windows this causes it to lock it on the disk, preventing recompilation.

Does HotAvalonia has any signal for the previewer to temporarily stop while it is recompiling the assembly?

Hmm .. Don't think it does (?).

As far as I'm aware it just uses FileSystemWatcher's notifications

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:enhancement New feature or request status:help-wanted This issue could use help from the external contributors
Projects
None yet
Development

No branches or pull requests

2 participants