AvalonStudio icon indicating copy to clipboard operation
AvalonStudio copied to clipboard

A crash occurs when you try to open a solution on C#

Open ava57r opened this issue 6 years ago • 7 comments

I compiled AvalonStudio from the develop branch Tried to open the solution https://github.com/EvilBeaver/OneScript

uname -a

Linux 4.13.0-32-generic #35~16.04.1-Ubuntu SMP Thu Jan 25 10:13:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -a
No LSB modules are available.
Distributor ID:	LinuxMint
Description:	Linux Mint 18.3 Sylvia
Release:	18.3
Codename:	sylvia

Exception

andreevlex ~/dev-pro/AvalonStudio/AvalonStudio/AvalonStudio/bin/Debug/netcoreapp2.0 $ dotnet ./AvalonStudio.dll
  Restoring packages for /home/andreevlex/.templateengine/AvalonStudio/1.0.0/scratch/restore.csproj...
  Installing VitalElement.AvalonStudio.Templates 0.4.2.
  Generating MSBuild file /home/andreevlex/.templateengine/AvalonStudio/1.0.0/scratch/obj/restore.csproj.nuget.g.props.
  Generating MSBuild file /home/andreevlex/.templateengine/AvalonStudio/1.0.0/scratch/obj/restore.csproj.nuget.g.targets.
  Restore completed in 150,21 ms for /home/andreevlex/.templateengine/AvalonStudio/1.0.0/scratch/restore.csproj.


(dotnet:11889): Gtk-CRITICAL **: gtk_window_resize: assertion 'width > 0' failed
Automatically selecting net452 as TargetFramework
"/usr/share/dotnet/sdk/2.1.4/MSBuild.dll" /p:AvaloniaIdePort=45787 /home/andreevlex/dev-pro/AvalonStudio/AvalonStudio/AvalonStudio/bin/Debug/netcoreapp2.0/host.csproj
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.

(dotnet:11889): GLib-GObject-CRITICAL **: g_object_set_qdata: assertion 'G_IS_OBJECT (object)' failed

(dotnet:11889): GLib-GObject-WARNING **: instance with invalid (NULL) class pointer

(dotnet:11889): GLib-GObject-CRITICAL **: g_signal_handlers_destroy: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(dotnet:11889): GLib-GObject-WARNING **: instance with invalid (NULL) class pointer

(dotnet:11889): GLib-GObject-CRITICAL **: g_signal_handlers_destroy: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
Automatically selecting net452 as TargetFramework
"/usr/share/dotnet/sdk/2.1.4/MSBuild.dll" /p:AvaloniaIdePort=51019 /home/andreevlex/dev-pro/AvalonStudio/AvalonStudio/AvalonStudio/bin/Debug/netcoreapp2.0/host.csproj

Unhandled Exception: System.Reflection.TargetInvocationException: System.Exception: Build failed
   at Avalonia.Ide.LanguageServer.MSBuild.AvaloniaIdeTask.Handle(ProjectInfoRequest req) in /home/andreevlex/dev-pro/AvalonStudio/AvalonStudio/Avalonia.Ide/src/Avalonia.Ide.LanguageServer.MSBuild/Task.cs:line 82
   at Avalonia.Ide.LanguageServer.MSBuild.AvaloniaIdeTask.Execute() in /home/andreevlex/dev-pro/AvalonStudio/AvalonStudio/Avalonia.Ide/src/Avalonia.Ide.LanguageServer.MSBuild/Task.cs:line 48
   at AvalonStudio.Projects.OmniSharp.MSBuild.MSBuildHost.SendRequest[TRes](RequestBase`1 req) in /home/andreevlex/dev-pro/AvalonStudio/AvalonStudio/AvalonStudio.Projects.OmniSharp/MSBuild/MSBuildHost.cs:line 87
   at AvalonStudio.Projects.OmniSharp.MSBuild.MSBuildHost.<>c__DisplayClass11_0.<LoadProject>b__0() in /home/andreevlex/dev-pro/AvalonStudio/AvalonStudio/AvalonStudio.Projects.OmniSharp/MSBuild/MSBuildHost.cs:line 146
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at AvalonStudio.Projects.OmniSharp.MSBuild.MSBuildHost.<LoadProject>d__11.MoveNext() in /home/andreevlex/dev-pro/AvalonStudio/AvalonStudio/AvalonStudio.Projects.OmniSharp/MSBuild/MSBuildHost.cs:line 127
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at RoslynPad.Roslyn.RoslynWorkspace.<AddProject>d__13.MoveNext() in /home/andreevlex/dev-pro/AvalonStudio/AvalonStudio/AvalonStudio.Projects.OmniSharp/Roslyn/RoslynWorkspace.cs:line 129
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at AvalonStudio.Projects.OmniSharp.OmniSharpProject.<Create>d__1.MoveNext() in /home/andreevlex/dev-pro/AvalonStudio/AvalonStudio/AvalonStudio.Projects.OmniSharp/OmniSharpProject.cs:line 24
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at AvalonStudio.Projects.OmniSharp.ProjectTypes.DotNetCoreCSharpProjectType.<LoadAsync>d__11.MoveNext() in /home/andreevlex/dev-pro/AvalonStudio/AvalonStudio/AvalonStudio.Projects.OmniSharp/ProjectTypes/DotNetCoreCSharpProjectType.cs:line 30
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at AvalonStudio.Projects.Project.<LoadProjectFileAsync>d__1.MoveNext() in /home/andreevlex/dev-pro/AvalonStudio/AvalonStudio/AvalonStudio.Extensibility/Projects/Project.cs:line 34
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at AvalonStudio.Extensibility.Projects.VisualStudioSolution.<LoadProjectsAsyncImpl>d__18.MoveNext() in /home/andreevlex/dev-pro/AvalonStudio/AvalonStudio/AvalonStudio.Extensibility/Projects/VisualStudioSolution.cs:line 147
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at AvalonStudio.Extensibility.Projects.VisualStudioSolution.<LoadProjectsAsync>d__13.MoveNext() in /home/andreevlex/dev-pro/AvalonStudio/AvalonStudio/AvalonStudio.Extensibility/Projects/VisualStudioSolution.cs:line 79
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at AvalonStudio.ShellViewModel.<OpenSolutionAsync>d__157.MoveNext() in /home/andreevlex/dev-pro/AvalonStudio/AvalonStudio/AvalonStudio/ShellViewModel.cs:line 774
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at AvalonStudio.Controls.Standard.SolutionExplorer.SolutionExplorerViewModel.<OpenSolution>d__24.MoveNext() in /home/andreevlex/dev-pro/AvalonStudio/AvalonStudio/AvalonStudio.Controls.Standard/SolutionExplorer/SolutionExplorerViewModel.cs:line 164
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Avalonia.Threading.JobRunner.RunJobs(Nullable`1 priority)
   at Avalonia.Gtk3.Gtk3Platform.<>c__DisplayClass28_0.<Signal>b__0()
   at Avalonia.Gtk3.Interop.GlibTimeout.Handler(IntPtr data)
   at Avalonia.Gtk3.Gtk3Platform.RunLoop(CancellationToken cancellationToken)
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken)
   at AvalonStudio.App.Main(String[] args) in /home/andreevlex/dev-pro/AvalonStudio/AvalonStudio/AvalonStudio/App.paml.cs:line 39
Aborted (core dumped)

ava57r avatar Feb 23 '18 06:02 ava57r

Thanks I will investigate what the issue is :)

danwalmsley avatar Feb 23 '18 09:02 danwalmsley

I think I know what the problem is, I will try to push a fix soon.

danwalmsley avatar Feb 24 '18 10:02 danwalmsley

@kekekeks in this case, where someone loads. Net462 project on Linux what would you expect to happen?

Load mono version of msbuild, and parse normally?

danwalmsley avatar Feb 24 '18 10:02 danwalmsley

@andreevlex a workaround for now should be to remove your <targetframework>net462</targetframework>

Tag from csproj and replace with <targetframeworks>netcoreapp2.0;net462</targetframeworks>

Use netstandard2.0 if it's a class library, this will allow you to open it in Avalon Studio, we will work to support Net462 on Linux shortly.

danwalmsley avatar Feb 24 '18 10:02 danwalmsley

Todo

  • [x] don't crash when project evaluation fails!

  • [ ] support full netframework evaluation on Linux and Windows.

  • [ ] support full. Net debugging on Linux

Support full. Net debugging on windows

danwalmsley avatar Feb 24 '18 10:02 danwalmsley

fixed? can try?

ava57r avatar Aug 02 '18 18:08 ava57r

It should open now, it wont support full. Net projects yet, only netstandard and netcore

danwalmsley avatar Aug 02 '18 21:08 danwalmsley