AvaloniaVS
AvaloniaVS copied to clipboard
Designer not loading
I simply created new avalonia project on visual studio 2017 and the designer didn't load (checked it for about an hour)
when I ran it, It gave me this error
The program '[7864] dotnet.exe' has exited with code -2147450751 (0x80008081).
Me too on VS2019 16.5.4
Me too on VS2019 16.16.0
Same issue on VS2019 16.7.4
13:36:17.698 [Information] Avalonia Package initialized
17:04:36.725 [Information] 0 Starting previewer process for '"D:\Documents\Visual Studio 2019\Projects\MyApp\MyApp\bin\x86\Debug\netcoreapp3.1\MyApp.dll"'
17:04:36.730 [Information] 18296 Started previewer process for '"D:\Documents\Visual Studio 2019\Projects\MyApp\MyApp\bin\x86\Debug\netcoreapp3.1\MyApp.dll"'. Waiting for connection to be initialized.
17:04:37.056 [Information] 18296 Connection initialized
17:04:37.114 [Error] 18296 <= "Unhandled exception. System.IO.FileLoadException: Could not load file or assembly 'MyApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'."
17:04:37.117 [Error] 18296 <= " at System.Runtime.Loader.AssemblyLoadContext.LoadFromPath(IntPtr ptrNativeAssemblyLoadContext, String ilPath, String niPath, ObjectHandleOnStack retAssembly)"
17:04:37.118 [Error] 18296 <= " at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)"
17:04:37.119 [Error] 18296 <= " at System.Reflection.Assembly.LoadFile(String path)"
17:04:37.120 [Error] 18296 <= " at Avalonia.DesignerSupport.Remote.RemoteDesignerEntryPoint.Main(String[] cmdline)"
17:04:37.120 [Error] 18296 <= " at Avalonia.Designer.HostApp.Program.Main(String[] args)"
17:04:38.728 [Information] Process exited
17:04:38.729 [Information] Stopping previewer process
VS2022 MVVM Avalonia
13:27:55.911 [Error] 243192 <= " at NoisePower.ViewModels.MainWindowViewModel..ctor()" 13:27:55.915 [Error] 243192 <= " at Builder_3597e0c6f0f040bf9c0bfa3bd40fe54f_avares://NoisePower/Designer/Fake.xaml.__AvaloniaXamlIlPopulate(System.IServiceProvider, NoisePower.Views.MainWindow)" 13:27:55.917 [Error] 243192 <= " at NoisePower.Views.MainWindow.!XamlIlPopulateTrampoline(NoisePower.Views.MainWindow)" 13:27:55.921 [Error] 243192 <= " at NoisePower.Views.MainWindow.InitializeComponent()" 13:27:55.924 [Error] 243192 <= " at NoisePower.Views.MainWindow..ctor()"
same here VS 16.11.8 Designer ls loading...
@BadKiko problem in your code, NoisePower.ViewModels.MainWindowViewModel fails. @exe2k please check logs, with high probability there is a problem in your code.
Same problem on vs 2019 16.11.18, lastest avaloniavs extension
Designer was working fine recently, and now keep being stuck at "Designer loading". Logs (setup as verbose log) show no error. My app can be build and run correctly. The designer keep showing a "error" (!) logo on left top corner, with an empty textbox when hovering it.
To check what's going on, I just did a fresh install with all latest version of everything and now the designer just keep failing at load with no error.
For me it helped to run VS as administrator. This has the background that my application developed inside VS requires admin permission. I haven't opened this project on the Windows 10 VM before, but propably the admin requirement has some influence on this issue. Since I'm running VS as administrator, the designer works well.
Still a bit strange, since it just shows the "!" on the top without any message what exactly went wrong, also not in the output window.
Same problem, has nothing to do with my code. Visual Studio 2022. Running as admin didn't help. I also get the red ! in the top left of the screen with no message.
I ran into this problem too. What fixed it for me was opening the app via the project/solution rather than the folder view. Using Visual Studio 2022 go to File -> Open -> Project/Solution -> click on your myApp.csproj file.
My screen is just like this, anyone can help?
I had this issue and none of the answers solved it. However, just running the project, then stopping it, allowed the designer to load.
same problem on Visual Studio 2022 17.5
Interesting, I had the same problem when working on the solution, but as @woodske mentioned opening the csproj directly seems to work.
I'm using Visual Studio Community 2022, v17.5.4
When opening by clicking on the sln file
When opening the csproj file
Visual studio cannot find your dll. This is because designer doesn't build the application for you (at least the first time round). Just hit build and the red exclamation symbol should go away and designer should pop up. This is why somebody got rid of the problem by running the application (that builds it first).
I have a very large project built off Avalonia that had been built many times. The designer only works for custom controls, user controls never work and I'm always staring at the red exlamation mark. I've just gotten use to it.
On Mon, Apr 24, 2023, 8:29 AM caotoce @.***> wrote:
Visual studio cannot find your dll. This is because designer doesn't build the application for you (at least the first time round). Just hit build and the red exclamation symbol should go away and designer should pop up. This is why somebody got rid of the problem by running the application (that builds it first).
— Reply to this email directly, view it on GitHub https://github.com/AvaloniaUI/AvaloniaVS/issues/132#issuecomment-1520067354, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE2TCF6JGSW7JVF3EO6M5KLXCZW2JANCNFSM4KID66HQ . You are receiving this because you commented.Message ID: @.***>
@caotoce Building didn't fix it for me, as I mentioned I instead had to open the csproj directly
A valid build is required for the designer to be displayed. If you get any error (no matter if it has to do with the designer or anything else) no preview can be shown. At least it was like that in my case.
@caotoce & @lugeneu I used Avalonia for a long time and just let me say this is a huge design problem. Even if the build works and the whole app is built in all configuration, the designer is failing silently in background.
Today the designer works in a clean install for a bit and then when you start adding few components to an app it just doesn't work anymore (and yes even after building in all configuration with no error or even warnings).
This is a serious bug and just ruin the whole usage of avalonia.
If anybody has this error again, please open a new issue with the attached logs.
@caotoce & @lugeneu I used Avalonia for a long time and just let me say this is a huge design problem. Even if the build works and the whole app is built in all configuration, the designer is failing silently in background.
Today the designer works in a clean install for a bit and then when you start adding few components to an app it just doesn't work anymore (and yes even after building in all configuration with no error or even warnings).
This is a serious bug and just ruin the whole usage of avalonia.
100% agree
If anybody has this error again, please open a new issue with the attached logs.
i kept ran into this problem, how should i generate a log?
vs2022 x86app has the same problem. Unhandled exception. System.IO.FileLoadException: Could not load file or assembly
x64 app is Ok.