lwchkg / DotNetEditor

A VB/C# text editor with the ability to run code and code snippets.
Other
28 stars 4 forks source link

Version 0.1.0 don't run on some computers #2

Closed lwchkg closed 7 years ago

lwchkg commented 7 years ago

Here's the dump:

應用程式: DotNetEditor.exe Framework 版本: v4.0.30319 描述: 處理序已終止,因為有未處理的例外狀況。

例外狀況資訊: 
System.IO.DirectoryNotFoundException 於 
System.IO.__Error.WinIOError(Int32, System.String) 於 
System.IO.FileStream.Init(System.String, System.IO.FileMode, System.IO.FileAccess, Int32, Boolean, System.IO.FileShare, Int32, System.IO.FileOptions, SECURITY_ATTRIBUTES, System.String, Boolean, Boolean, Boolean) 於 
System.IO.FileStream..ctor(System.String, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare) 於 
Roslyn.Utilities.FileUtilities.OpenFileStream(System.String) 

例外狀況資訊: 
System.IO.FileNotFoundException 於 
Roslyn.Utilities.FileUtilities.OpenFileStream(System.String) 於 
Microsoft.CodeAnalysis.MetadataReference.CreateFromFile(System.String, Microsoft.CodeAnalysis.MetadataReferenceProperties, Microsoft.CodeAnalysis.DocumentationProvider) 於
DotNetEditor.CodeRunner.VBCodeRunner+<>c__DisplayClass1_0.<GetCompilation>b__0(System.String) 於 
System.Linq.Enumerable+WhereSelectEnumerableIterator`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext() 於 
System.Linq.Buffer`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]..ctor(System.Collections.Generic.IEnumerable`1<System.__Canon>) 於 
System.Linq.Enumerable.ToArray[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<System.__Canon>) 於 System.Collections.Immutable.ImmutableArray.CreateRange[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<System.__Canon>) 於 
Microsoft.CodeAnalysis.Compilation.ValidateReferences[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<Microsoft.CodeAnalysis.MetadataReference>) 於 
Microsoft.CodeAnalysis.VisualBasic.VisualBasicCompilation.Create(System.String, Microsoft.CodeAnalysis.VisualBasic.VisualBasicCompilationOptions, System.Collections.Generic.IEnumerable`1<Microsoft.CodeAnalysis.SyntaxTree>, System.Collections.Generic.IEnumerable`1<Microsoft.CodeAnalysis.MetadataReference>, Microsoft.CodeAnalysis.VisualBasic.VisualBasicCompilation, System.Type, System.Type, Boolean) 於 
DotNetEditor.CodeRunner.VBCodeRunner.GetCompilation() 於 
DotNetEditor.CodeRunner.CodeRunnerBase.Run() 於 DotNetEditor.MainWindow.Run_Executed(System.Object, System.Windows.Input.ExecutedRoutedEventArgs) 於 System.Windows.Input.CommandBinding.OnExecuted(System.Object, System.Windows.Input.ExecutedRoutedEventArgs) 於 
System.Windows.Input.CommandManager.ExecuteCommandBinding(System.Object, System.Windows.Input.ExecutedRoutedEventArgs, System.Windows.Input.CommandBinding) 於
System.Windows.Input.CommandManager.FindCommandBinding(System.Windows.Input.CommandBindingCollection, System.Object, System.Windows.RoutedEventArgs, System.Windows.Input.ICommand, Boolean) 於
System.Windows.Input.CommandManager.FindCommandBinding(System.Object, System.Windows.RoutedEventArgs, System.Windows.Input.ICommand, Boolean) 於 
System.Windows.Input.CommandManager.OnExecuted(System.Object, System.Windows.Input.ExecutedRoutedEventArgs) 於
System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object) 於
System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs) 於 
System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean) 於
System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs) 於 
System.Windows.Input.RoutedCommand.ExecuteImpl(System.Object, System.Windows.IInputElement, Boolean) 於 
DotNetEditor.MainWindow..ctor()

例外狀況資訊:
System.Windows.Markup.XamlParseException 於 
System.Windows.Markup.XamlReader.RewrapException(System.Exception, System.Xaml.IXamlLineInfo, System.Uri) 於 
System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri) 於
System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader, Boolean, System.Object, System.Xaml.Permissions.XamlAccessLevel, System.Uri) 於
System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream, System.Windows.Markup.ParserContext, System.Object, Boolean) 於
System.Windows.Application.LoadBamlStreamWithSyncInfo(System.IO.Stream, System.Windows.Markup.ParserContext) 於 
System.Windows.Application.DoStartup() 於 
System.Windows.Application.<.ctor>b__1_0(System.Object) 於
System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) 於 
System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate) 於 
System.Windows.Threading.DispatcherOperation.InvokeImpl() 於 
MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object) 於 
System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) 於
System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) 於 
System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) 於 
MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object) 於 
System.Windows.Threading.DispatcherOperation.Invoke() 於
System.Windows.Threading.Dispatcher.ProcessQueue() 於 
System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) 於 
MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) 於 
MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object) 於 
System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) 於 
System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate) 於 System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32) 於 
MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr) 於
MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef) 於 
System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame) 於
System.Windows.Application.RunDispatcher(System.Object) 於 
System.Windows.Application.RunInternal(System.Windows.Window) 於 
DotNetEditor.App.Main()  
lwchkg commented 7 years ago

Appears to be a missing file when using Roslyn:

An exception of type 'System.IO.FileNotFoundException' occurred in Microsoft.CodeAnalysis.dll but was not handled in user code

Additional information: Could not find a part of the path 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6.2\Microsoft.VisualBasic.dll'. (modified program to reference inexistent .NET 4.6.2.

This could also happen if a bad reference file is to be added. So we'd better handle the exception properly. May need to handle file path searching for the DLL also.

lwchkg commented 7 years ago

Found the root cause: the .NET Developer Pack 4.6.1 is not installed. Without the developer pack it is impossible to compile programs under that .NET Framework, and this happens also for Visual Studio.