Skip to content

Avalonia Designer Preview process exited。 Could not load file or assembly。 #640

Description

@submaie

Describe the bug

The preview window displays error messages。

To Reproduce

The basic window code is Avalonia's default code:

<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
        x:Class="SanxingReport.MainWindow"
        Title="SanxingReport">
    Welcome to Avalonia!
</Window>

AvaloniaVS plugin version

12.1.1.0

Avalonia version

12.0.4

Visual Studio version

18.4.2

Relevant log output

03:17:04.696 [Information] [PreviewerProcess (#16851234)] [33424] Connection initialized
03:17:04.709 [Error] [PreviewerProcess (#16851234)] [33424] <= Unhandled exception. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
03:17:04.709 [Error] [PreviewerProcess (#16851234)] [33424] <=  ---> System.IO.FileNotFoundException: Could not load file or assembly 'Avalonia.Headless, Version=11.2.0.0, Culture=neutral, PublicKeyToken=c8d484a7012f9a8b'. 系统找不到指定的文件。
03:17:04.709 [Error] [PreviewerProcess (#16851234)] [33424] <= File name: 'Avalonia.Headless, Version=11.2.0.0, Culture=neutral, PublicKeyToken=c8d484a7012f9a8b'
03:17:04.709 [Error] [PreviewerProcess (#16851234)] [33424] <=    at AvaloniaUI.Previewer.DesignerSupport.Remote.RemoteDesignerEntryPoint.StartAvaloniaApplication(CommandLineArgs args)
03:17:04.709 [Error] [PreviewerProcess (#16851234)] [33424] <=    at AvaloniaUI.Previewer.DesignerSupport.Remote.RemoteDesignerEntryPoint.StartAvaloniaApplication(CommandLineArgs args)
03:17:04.709 [Error] [PreviewerProcess (#16851234)] [33424] <=    at AvaloniaUI.Previewer.DesignerSupport.Remote.RemoteDesignerEntryPoint.SetupPreviewer(String[] cmdline)
03:17:04.709 [Error] [PreviewerProcess (#16851234)] [33424] <=    at AvaloniaUI.Previewer.DesignerSupport.Remote.RemoteDesignerEntryPoint.Main(String[] cmdline)
03:17:04.709 [Error] [PreviewerProcess (#16851234)] [33424] <=    at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
03:17:04.709 [Error] [PreviewerProcess (#16851234)] [33424] <=    at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
03:17:04.709 [Error] [PreviewerProcess (#16851234)] [33424] <=    --- End of inner exception stack trace ---

Additional context

After inspection, it was found that Avalonia Designer Preview requires Avalonia.Headless, Version=11.2.0.0, but in the local NuGet cache, the version of Avalonia.Headless is only as shown in the picture below:
12.0.0
12.0.3
12.0.4

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions