AvaloniaVS icon indicating copy to clipboard operation
AvaloniaVS copied to clipboard

Designer not loading

Open DragonlordDrake opened this issue 4 years ago • 9 comments

I simply created new avalonia project on visual studio 2017 and the designer didn't load (checked it for about an hour)

No_load

when I ran it, It gave me this error

The program '[7864] dotnet.exe' has exited with code -2147450751 (0x80008081).

DragonlordDrake avatar Jan 17 '20 07:01 DragonlordDrake

Me too on VS2019 16.5.4

ezruneko avatar Apr 25 '20 09:04 ezruneko

Me too on VS2019 16.16.0

AngelicosPhosphoros avatar May 19 '20 17:05 AngelicosPhosphoros

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

wberdowski avatar Oct 17 '20 15:10 wberdowski

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()"

BadKiko avatar Jan 28 '22 10:01 BadKiko

same here VS 16.11.8 Designer ls loading...

exe2k avatar Jul 23 '22 19:07 exe2k

@BadKiko problem in your code, NoisePower.ViewModels.MainWindowViewModel fails. @exe2k please check logs, with high probability there is a problem in your code.

maxkatz6 avatar Jul 23 '22 20:07 maxkatz6

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.

zlnimda avatar Aug 23 '22 13:08 zlnimda

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.

DMW007 avatar Aug 29 '22 19:08 DMW007

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.

jhimes144 avatar Sep 17 '22 17:09 jhimes144

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.

woodske avatar Oct 30 '22 20:10 woodske

My screen is just like this, anyone can help? image

mossbee avatar Dec 24 '22 10:12 mossbee

I had this issue and none of the answers solved it. However, just running the project, then stopping it, allowed the designer to load.

nigeljm avatar Mar 13 '23 07:03 nigeljm

same problem on Visual Studio 2022 17.5

Ling-YangHui avatar Apr 07 '23 07:04 Ling-YangHui

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

image

When opening the csproj file

image

dgellow avatar Apr 21 '23 10:04 dgellow

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).

caotoce avatar Apr 24 '23 12:04 caotoce

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: @.***>

jhimes144 avatar Apr 24 '23 14:04 jhimes144

@caotoce Building didn't fix it for me, as I mentioned I instead had to open the csproj directly

dgellow avatar Apr 25 '23 14:04 dgellow

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.

lugeneu avatar May 31 '23 08:05 lugeneu

@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.

zlnimda avatar Jun 06 '23 09:06 zlnimda

If anybody has this error again, please open a new issue with the attached logs.

maxkatz6 avatar Jun 09 '23 02:06 maxkatz6

@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

jpgarza93 avatar Jun 13 '23 15:06 jpgarza93

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?

sovzzz avatar Jul 08 '23 10:07 sovzzz

vs2022 x86app has the same problem. Unhandled exception. System.IO.FileLoadException: Could not load file or assembly

x64 app is Ok.

KevinL2015 avatar Jul 11 '23 02:07 KevinL2015