VitalElement / AvalonStudio

Cross platform IDE and Shell
GNU Lesser General Public License v3.0
1.62k stars 237 forks source link

AvalonStudio fall with exception on opening XAML view #712

Closed Keroosha closed 5 years ago

Keroosha commented 5 years ago

OS: Windows 10 Pro for Workstations Runtime: 2.2.200-preview-009648 Build: Debug (and release too) Console output:

Automatically selecting netstandard2.0 as TargetFramework
Automatically selecting netstandard2.0 as TargetFramework
Automatically selecting netcoreapp2.1 as TargetFramework
Automatically selecting netstandard2.0 as TargetFramework
Automatically selecting netstandard2.0 as TargetFramework

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at AvalonStudio.Languages.Xaml.XamlLanguageService.RegisterEditor(ITextEditor editor) in D:\Kitchen\AvalonStudio\AvalonStudio\AvalonS
tudio.Languages.Xaml\XamlLanguageService.cs:line 111
   at AvalonStudio.Extensibility.Editor.CodeEditorViewModel.RegisterLanguageService(ISourceFile sourceFile) in D:\Kitchen\AvalonStudio\A
valonStudio\AvalonStudio.Extensibility\Editor\CodeEditorViewModel.cs:line 312
   at AvalonStudio.Extensibility.Editor.CodeEditorViewModel..ctor(ITextDocument document, ISourceFile file) in D:\Kitchen\AvalonStudio\A
valonStudio\AvalonStudio.Extensibility\Editor\CodeEditorViewModel.cs:line 47
   at AvalonStudio.Languages.Xaml.XamlEditorViewModel..ctor(ITextDocument document, ISourceFile file) in D:\Kitchen\AvalonStudio\AvalonS
tudio\AvalonStudio.Languages.Xaml\XamlEditorViewModel.cs:line 11
   at AvalonStudio.Languages.Xaml.XamlEditorProvider.CreateViewModel(ISourceFile file) in D:\Kitchen\AvalonStudio\AvalonStudio\AvalonStu
dio.Languages.Xaml\XamlEditorProvider.cs:line 30
   at AvalonStudio.Studio.StudioViewModel.OpenDocumentAsync(ISourceFile file) in D:\Kitchen\AvalonStudio\AvalonStudio\AvalonStudio.Studi
o\StudioViewModel.cs:line 325
   at AvalonStudio.Studio.StudioViewModel.OpenDocumentAsync(ISourceFile file, Int32 line, Int32 startColumn, Int32 endColumn, Boolean de
bugHighlight, Boolean selectLine, Boolean focus) in D:\Kitchen\AvalonStudio\AvalonStudio\AvalonStudio.Studio\StudioViewModel.cs:line 343

   at AvalonStudio.Controls.Standard.SolutionExplorer.SolutionExplorerViewModel.<>c.<<-ctor>b__7_2>d.MoveNext() in D:\Kitchen\AvalonStud
io\AvalonStudio\AvalonStudio.Controls.Standard\SolutionExplorer\SolutionExplorerViewModel.cs:line 52
--- End of stack trace from previous location where exception was thrown ---
   at Avalonia.Threading.JobRunner.RunJobs(Nullable`1 priority)
   at Avalonia.Win32.Win32Platform.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
   at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& lpmsg)
   at Avalonia.Win32.Win32Platform.RunLoop(CancellationToken cancellationToken)
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken)
   at Avalonia.Application.Run(Window mainWindow)
   at AvalonStudio.Shell.Shell.StartShellApp[TAppBuilder,TMainWindow](TAppBuilder builder, String appName, IDockFactory layoutFactory, F
unc`1 dataContextProvider) in D:\Kitchen\AvalonStudio\AvalonStudio.Shell\src\AvalonStudio.Shell\Shell.cs:line 14
   at AvalonStudio.App.Main(String[] args) in D:\Kitchen\AvalonStudio\AvalonStudio\AvalonStudio\App.paml.cs:line 43

How to reproduce

danwalmsley commented 5 years ago

@Keroosha it worked for me, are you sure you built the develop branch?

Keroosha commented 5 years ago

@Keroosha it worked for me, are you sure you built the develop branch?

Yeah, Develop branch

danwalmsley commented 5 years ago

@Keroosha does it work if you right click on Tel.Egram project and click set as default project before opening a view?

Then to get previewer to work you will need to target Avalonia 0.7.1-cibuild0001329-beta or above.

kazouke commented 5 years ago

I had the same issue, then set my project as default project but now it says "Unable to Load the Previewer" (I have last nightly Avalonia build) and the error is "The application to execute does not exist: 'C:......'" with wrong path.

danwalmsley commented 5 years ago

Going to do a release soon so will fix this shortly

danwalmsley commented 5 years ago

fixed the startup project issue on develop branch