当我向项目添加新视图并尝试构建它时,会发生以下错误:
`System.Xaml.XamlException: No precompiled XAML found for Test.Views.SchemesView, make sure to specify x:Class and include your XAML file as AvaloniaResource
17:59:18.882 [Error]  Exception caught by FireAndForget
System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at AvaloniaVS.Services.PreviewerProcess.<OnMessageAsync>d__37.MoveNext() in D:\a\1\s\AvaloniaVS\Services\PreviewerProcess.cs:line 433
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object.
   at AvaloniaVS.Services.PreviewerProcess.<OnMessageAsync>d__37.MoveNext() in D:\a\1\s\AvaloniaVS\Services\PreviewerProcess.cs:line 433<---
`如何解决这一问题?
发布于 2020-06-12 08:08:54
此错误意味着Avalonia编译器MSBuild任务没有为SchemesView处理任何XAML。这可能是由以下几个原因造成的:
您还没有添加EmbeddedResource
x:Class文件的AvaloniaResource或AvaloniaResource指令,或者Avalonia包。由于与缺乏0.9.x支持的.NET Core2.1SDK兼容,因此需要直接引用buildTransitive。这一限制可能会在0.10.中取消。
https://stackoverflow.com/questions/62330728
复制相似问题