Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on save all #1598

Closed
greenozon opened this issue Jul 27, 2019 · 11 comments

Comments

@greenozon
Copy link

commented Jul 27, 2019

ILSpy version 5.0.0.4963-preview3

Select all assemblies in left tree view (CTRL + A)
CTRL+S ->

image

---------------------------
Sorry, we crashed
---------------------------
System.ArgumentException: Value does not fall within the expected range.

   at MS.Internal.AppModel.ShellUtil.GetShellItemForPath(String path)

   at Microsoft.Win32.FileDialog.PrepareVistaDialog(IFileDialog dialog)

   at Microsoft.Win32.FileDialog.RunVistaDialog(IntPtr hwndOwner)

   at Microsoft.Win32.CommonDialog.ShowDialog()

   at ICSharpCode.ILSpy.TextView.SaveCodeContextMenuEntry.SelectSolutionFile(String path)

   at ICSharpCode.ILSpy.TextView.SaveCodeContextMenuEntry.Execute(IReadOnlyList`1 selectedNodes)

   at ICSharpCode.ILSpy.MainWindow.SaveCommandExecuted(Object sender, ExecutedRoutedEventArgs e)

   at System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)

   at System.Windows.Input.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)

   at System.Windows.Input.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)

   at System.Windows.Input.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)

   at System.Windows.Input.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)

   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)

   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)

   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)

   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)

   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)

   at System.Windows.Input.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)

   at System.Windows.Input.CommandManager.TranslateInput(IInputElement targetElement, InputEventArgs inputEventArgs)

   at System.Windows.UIElement.OnKeyDownThunk(Object sender, KeyEventArgs e)

   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)

   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)

   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)

   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)

   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)

   at System.Windows.Input.InputManager.ProcessStagingArea()

   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)

   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)

   at System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawKeyboardActions actions, Int32 scanCode, Boolean isExtendedKey, Boolean isSystemKey, Int32 virtualKey)

   at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled)

   at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG& msg, ModifierKeys modifiers)

   at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)

   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
---------------------------
OK   
---------------------------
@siegfriedpammer

This comment has been minimized.

Copy link
Member

commented Aug 4, 2019

I think this error depends on the items in the list of assemblies. It will be hard for me to reproduce this.

@greenozon

This comment has been minimized.

Copy link
Author

commented Aug 4, 2019

It's very easy, steps:
clean left treeview

FIle - Open from GAC
select all assemblies of version 2.0.xxx and 3.0.xxx
then press CTRL +S when you back to main window -> crash

@greenozon

This comment has been minimized.

Copy link
Author

commented Aug 4, 2019

I'm able to reproduce this issue on any >1 items selected.
what is more interesting, if press CTRL +S - error page shown as in 1st post

but if use right click menu "Save Code" item then a bit different error shown (expected the same as this is same action?)

---------------------------
Sorry, we crashed
---------------------------
System.ArgumentException: Value does not fall within the expected range.

   at MS.Internal.AppModel.ShellUtil.GetShellItemForPath(String path)

   at Microsoft.Win32.FileDialog.PrepareVistaDialog(IFileDialog dialog)

   at Microsoft.Win32.FileDialog.RunVistaDialog(IntPtr hwndOwner)

   at Microsoft.Win32.CommonDialog.ShowDialog()

   at ICSharpCode.ILSpy.TextView.SaveCodeContextMenuEntry.SelectSolutionFile(String path)

   at ICSharpCode.ILSpy.TextView.SaveCodeContextMenuEntry.Execute(IReadOnlyList`1 selectedNodes)

   at ICSharpCode.ILSpy.TextView.SaveCodeContextMenuEntry.Execute(TextViewContext context)

   at ICSharpCode.ILSpy.ContextMenuProvider.<>c__DisplayClass12_1.<ShowContextMenu>b__2(Object <p0>, RoutedEventArgs <p1>)

   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)

   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)

   at System.Windows.Controls.MenuItem.InvokeClickAfterRender(Object arg)

   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
---------------------------
OK   
---------------------------

image

Win 7 x64 SP1 Ultimate is my OS.

@dgrunwald

This comment has been minimized.

Copy link
Member

commented Aug 4, 2019

I can't reproduce this.
Have you tried debugging SelectSolutionFile?
What is the path used as initial directory?

The new "Save as solution" feature tries to use one of the selected assemblies' directory as the dlg.InitialDirectory, the old "Save as project" didn't do that.
We might just need to validate the path; though I didn't manage to reproduce any exceptions when I tried it with assemblies in a directory that had since been deleted.

@greenozon

This comment has been minimized.

Copy link
Author

commented Aug 5, 2019

I'm giving it a try (build debug version using VS2017 latest)
I've installed prereq as described on main page (.net 462, core 22 and core 30 p7)

c:\Temp\ILSpy>dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.0.100-preview7-012821
 Commit:    6348f1068a

Runtime Environment:
 OS Name:     Windows
 OS Version:  6.1.7601
 OS Platform: Windows
 RID:         win7-x64
 Base Path:   C:\Program Files\dotnet\sdk\3.0.100-preview7-012821\

Host (useful for support):
  Version: 3.0.0-preview7-27912-14
  Commit:  4da6ee6450

.NET Core SDKs installed:
  2.2.108 [C:\Program Files\dotnet\sdk]
  3.0.100-preview7-012821 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0-preview7.19365.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0-preview7-27912-14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.0.0-preview7-27912-14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

c:\Temp\ILSpy>

but still having issues inside VS, what should I pay attention for in order to build it?

image

@christophwille

This comment has been minimized.

Copy link
Member

commented Aug 5, 2019

I doubt that VS2017 is capable of using the netcore3 tooling to built the project (don't have 2017 on any of my machines any more)

@greenozon

This comment has been minimized.

Copy link
Author

commented Aug 5, 2019

do you say that in order to build current ILSpy a VS2019 is a pre-req?

if yes, then main page "how to build" section shall be updated (it says VS2017 is a minimum)
https://github.com/icsharpcode/ILSpy

also bat files can't find my VS2017 installation (it is there 100%)

c:\Temp\ILSpy>debugbuild.bat
Could not find VS2017 MSBuild

c:\Temp\ILSpy>clean.bat
Could not find VS2017 MSBuild
@christophwille

This comment has been minimized.

Copy link
Member

commented Aug 5, 2019

For the requirements, yes, that needs updating (@dgrunwald @siegfriedpammer anyone of you still have VS2017 on your machines to double-check?)

Bat Files: again @dgrunwald @siegfriedpammer any of you use those recently? (like in the past couple of years?)

@siegfriedpammer

This comment has been minimized.

Copy link
Member

commented Aug 5, 2019

C:\Users\sie_p\Projects\ILSpy master>debugbuild.bat
Could not find VS2017 MSBuild

I don't have VS2017 installed anymore and I don't use the batch files at all. They were handy in the SharpDevelop days, but nowadays not so much...

dgrunwald added a commit that referenced this issue Aug 5, 2019

Make "Save as solution" logic more similar to "Save as project" logic:
  * don't propose an initial directory (#1598)
  * allow overwriting an existing directory

dgrunwald added a commit that referenced this issue Aug 5, 2019

@greenozon

This comment has been minimized.

Copy link
Author

commented Aug 7, 2019

Thanks for updating main page steps

regarding issue - I"m not able to reproduce it anymore...
it is magically gone
tested on ILSpy version 5.0.0.5049-preview4

PS
I guess it happened after I played with .NET core 2.2 and 3.0p7 install/removes...
closing it.

@greenozon greenozon closed this Aug 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.