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

Avalonia designer stuck with "Waiting for IntelliSense to finish initializing..." message when opening axaml-files during debugging #429

Open
sinatrocious opened this issue Dec 6, 2023 · 1 comment
Labels

Comments

@sinatrocious
Copy link

sinatrocious commented Dec 6, 2023

Describe the bug

If I run Avalonia desktop application first and then try to open axaml-file, then in opened Avalonia Xaml Editor tab I see the following message

Waiting for IntelliSense to finish initializing...
You can continue working.

The message stays until I stop debugging.

Obviously I can't "continue working" to edit/view axaml-files. I need at least stop and then start debugging again.

What could possibly be the reason? It ocurrs (100% of times) in the big project.

To Reproduce

I am unable to reproduce it. With the new Avalonia Desktop project the axaml-files can be opened during debugging without problems.

AvaloniaVS plugin version

11.5

Avalonia version

11.0

Visual Studio version

17.7.7

Relevant log output

Nothing is added into "Avalonia Diagnostics" when opening axaml-file.

Additional context

No response

@BinToss
Copy link
Contributor

BinToss commented Apr 18, 2024

AvaloniaVS, AvaloniaVSCode, and AvaloniaRider all rely on the CompletionEngine project in the AvaloniaVS repo.
This assembly grabs the references plain text file in your workspace project's IntermediateOutput and loads...one of the Avalonia assemblies from either your IntermediateOutput or Debug Output.
However, it cannot load the assembly if the assembly is already in use by another process and waits for the file handle to be or (on Windows) be opened/loaded without the FileOpenShare flag READ denied by any File handle.
The classic "this file is open in another process" issue that can be prevented or even overriden (steal the handle from the kernel, duplicate it, and close all copied of the handle; as seen in Handles/Handles64 and System Informer).
As implied earlier, a file can be opened by multiple processes so long as none of the file handles are opened without explicitly specifying the FILE_SHARE_READ shared-access permission. However, this Windows API is abstracted in .NET's LoadLibrary/DllImport implementation. The default way of loading NET assemblies does not make it easy to specify FILE_OPEN and FILE_SHARE flags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants