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 UI Preview do not work #110

Closed
Prakash19921206 opened this issue Sep 18, 2020 · 1 comment
Closed

Avalonia UI Preview do not work #110

Prakash19921206 opened this issue Sep 18, 2020 · 1 comment

Comments

@Prakash19921206
Copy link

i'm new to Avalonia and dot net core.
using visual studio 2019 version 16.7.3
installed dot net core 3.1 sdk
installed avalonia extension for visual studio 2019 from here

when i open xaml designer(Core2d.UI/Views/AboutControl.xaml), it says "Process Exited. The previewer process exited unexpectedly. See the output windows for more information"

below is the log from 'Avalonia Diagnostics'

11:03:00.377 [Information] Starting previewer process for '"D:\Git_Projects\Core2D-0.10.0-preview4\src\Core2D.Desktop\bin\Debug\netcoreapp3.1\Core2D.Desktop.dll"'
11:03:00.399 [Information] 19188 Started previewer process for '"D:\Git_Projects\Core2D-0.10.0-preview4\src\Core2D.Desktop\bin\Debug\netcoreapp3.1\Core2D.Desktop.dll"'. Waiting for connection to be initialized.
11:03:00.712 [Information] 19188 Connection initialized
11:03:02.447 [Error] 19188 <= "Unhandled exception. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation."
11:03:02.448 [Error] 19188 <= " ---> System.TypeInitializationException: The type initializer for 'Core2D.UI.App' threw an exception."
11:03:02.449 [Error] 19188 <= " ---> System.NullReferenceException: Object reference not set to an instance of an object."
11:03:02.450 [Error] 19188 <= " at Core2D.Factory.CreatePathShape(IShapeStyle style, IPathGeometry geometry, Boolean isStroked, Boolean isFilled) in D:\Git_Projects\Core2D-0.10.0-preview4\src\Core2D\ViewModels\Factory.cs:line 722"
11:03:02.451 [Error] 19188 <= " at Core2D.UI.Designer.DesignerContext.InitializeContext(IServiceProvider serviceProvider) in D:\Git_Projects\Core2D-0.10.0-preview4\src\Core2D.UI\Designer\DesignerContext.cs:line 310"
11:03:02.452 [Error] 19188 <= " at Core2D.UI.App.InitializeDesigner() in D:\Git_Projects\Core2D-0.10.0-preview4\src\Core2D.UI\App.xaml.cs:line 84"
11:03:02.453 [Error] 19188 <= " at Core2D.UI.App..cctor() in D:\Git_Projects\Core2D-0.10.0-preview4\src\Core2D.UI\App.xaml.cs:line 71"
11:03:02.454 [Error] 19188 <= " --- End of inner exception stack trace ---"
11:03:02.454 [Error] 19188 <= " at Core2D.UI.App..ctor()"
11:03:02.455 [Error] 19188 <= " --- End of inner exception stack trace ---"
11:03:02.456 [Error] 19188 <= " at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean wrapExceptions, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& hasNoDefaultCtor)"
11:03:02.457 [Error] 19188 <= " at System.RuntimeType.CreateInstanceDefaultCtorSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean fillCache)"
11:03:02.458 [Error] 19188 <= " at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, Boolean wrapExceptions)"
11:03:02.458 [Error] 19188 <= " at System.Activator.CreateInstanceT"
11:03:02.459 [Error] 19188 <= " at Avalonia.Controls.AppBuilderBase1.<>c__451.b__45_0()"
11:03:02.459 [Error] 19188 <= " at Avalonia.Controls.AppBuilderBase1.Setup()" 11:03:02.460 [Error] 19188 <= " at Avalonia.Controls.AppBuilderBase1.SetupWithoutStarting()"
11:03:02.461 [Error] 19188 <= " at Avalonia.DesignerSupport.Remote.RemoteDesignerEntryPoint.AppInitializer`1.ConfigureApp(IAvaloniaRemoteTransportConnection transport, CommandLineArgs args, Object obj)"
11:03:02.461 [Error] 19188 <= " at Avalonia.DesignerSupport.Remote.RemoteDesignerEntryPoint.Main(String[] cmdline)"
11:03:02.462 [Error] 19188 <= " at Avalonia.Designer.HostApp.Program.Main(String[] args)"

None of the xaml file's designer preview opens.
All xaml files are giving null exception at Factory.cs while loading the UI.
However no error while building or running the app.

(Creating new Avalonia Application with TargetFramework netcoreapp3.1 shows the designer preview)
Am i missing anything?

Thanks

@Prakash19921206
Copy link
Author

switching build target from AnyCPU to x64 helped!
now its showing preview in designer.

Thanks

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