Skip to content
This repository has been archived by the owner on Mar 17, 2024. It is now read-only.

System.NullReferenceException: "StartupManager" StartupItems was null. #902

Open
BurntDog opened this issue Dec 28, 2020 · 6 comments
Open

Comments

@BurntDog
Copy link

BurntDog commented Dec 28, 2020

Clicking Quit will show errors then
close apps one at a time client first server last Debug Mode: https://prnt.sc/wbsaoq
Exception thrown on Line 140 "foreach (var item in StartupItems)"

https://prnt.sc/wbjer1
https://prnt.sc/wbjg1c
https://prnt.sc/wbjgzg

Describe the bug
Startup manager will crash before it populates
the form

To Reproduce
Steps to reproduce the behavior:
Try to view Startup Manager
Crashes with errors

Expected behavior
Startup Manager should open and populate

System

  • Server OS: [e.g. Windows 10]
  • Client OS: [e.g. Windows 10]
  • Server installed .NET Framework version: v4.8]
  • Client installed .NET Framework version: v4.8]
  • Quasar Version: 1.4.0.0 Newest available
  • Build configuration: Release

Installed

dotnet-sdk-5.0.101-win-x64 <--- installed from Visual Studio
ndp48-devpack-enu.exe

on both Client/Server Windows10 OS


Additional context
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at Quasar.Server.Forms.FrmStartupManager.StartupItemsChanged(Object sender, List`1 startupItems)

************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4300.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll

Quasar
Assembly Version: 1.4.0.0
Win32 Version: 1.4.0
CodeBase: file:///C:/Users/cyclo/Desktop/Quasar-master/bin/Release/net452/Quasar.exe

System
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4300.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4270.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4190.0 built by: NET48REL1LAST_B
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4300.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll

System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

Quasar.Common
Assembly Version: 1.4.0.0
Win32 Version: 1.4.0
CodeBase: file:///C:/Users/cyclo/Desktop/Quasar-master/bin/Release/net452/Quasar.Common.DLL

System.Management
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Management/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Management.dll

Open.Nat
Assembly Version: 1.0.0.0
Win32 Version: 1.1.0.0
CodeBase: file:///C:/Users/cyclo/Desktop/Quasar-master/bin/Release/net452/Open.Nat.DLL

System.Security
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4261.0 built by: NET48REL1LAST_B
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Security/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Security.dll

Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll

System.Data.SqlXml
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Data.SqlXml/v4.0_4.0.0.0__b77a5c561934e089/System.Data.SqlXml.dll

System.Configuration.Install
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration.Install/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.Install.dll

protobuf-net
Assembly Version: 2.4.0.0
Win32 Version: 2.4.6.0
CodeBase: file:///C:/Users/cyclo/Desktop/Quasar-master/bin/Release/net452/protobuf-net.DLL

Anonymously Hosted DynamicMethods Assembly
Assembly Version: 0.0.0.0
Win32 Version: 4.8.4300.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/mscorlib/v4.0_4.0.0.0__b77a5c561934e089/mscorlib.dll

Mono.Cecil
Assembly Version: 0.11.2.0
Win32 Version: 0.11.2.0
CodeBase: file:///C:/Users/cyclo/Desktop/Quasar-master/bin/Release/net452/Mono.Cecil.DLL

Vestris.ResourceLib
Assembly Version: 2.1.0.0
Win32 Version: 2.1.0.0
CodeBase: file:///C:/Users/cyclo/Desktop/Quasar-master/bin/Release/net452/Vestris.ResourceLib.DLL

Gma.System.MouseKeyHook
Assembly Version: 5.6.130.0
Win32 Version: 5.6.130.0
CodeBase: file:///C:/Users/cyclo/Desktop/Quasar-master/bin/Release/net452/Gma.System.MouseKeyHook.DLL

************** Exception Text **************
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.ArrayList.ArrayListEnumeratorSimple.MoveNext()
at System.Windows.Forms.Application.ExitInternal()
at System.Windows.Forms.Application.ThreadContext.OnThreadException(Exception t)
at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4300.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll

Quasar
Assembly Version: 1.4.0.0
Win32 Version: 1.4.0
CodeBase: file:///C:/Users/cyclo/Desktop/Quasar-master/bin/Release/net452/Quasar.exe

System
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4300.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4270.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4190.0 built by: NET48REL1LAST_B
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4300.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll

System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

Quasar.Common
Assembly Version: 1.4.0.0
Win32 Version: 1.4.0
CodeBase: file:///C:/Users/cyclo/Desktop/Quasar-master/bin/Release/net452/Quasar.Common.DLL

System.Management
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Management/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Management.dll

Open.Nat
Assembly Version: 1.0.0.0
Win32 Version: 1.1.0.0
CodeBase: file:///C:/Users/cyclo/Desktop/Quasar-master/bin/Release/net452/Open.Nat.DLL

System.Security
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4261.0 built by: NET48REL1LAST_B
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Security/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Security.dll

Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll

System.Data.SqlXml
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Data.SqlXml/v4.0_4.0.0.0__b77a5c561934e089/System.Data.SqlXml.dll

System.Configuration.Install
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration.Install/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.Install.dll

protobuf-net
Assembly Version: 2.4.0.0
Win32 Version: 2.4.6.0
CodeBase: file:///C:/Users/cyclo/Desktop/Quasar-master/bin/Release/net452/protobuf-net.DLL

Anonymously Hosted DynamicMethods Assembly
Assembly Version: 0.0.0.0
Win32 Version: 4.8.4300.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/mscorlib/v4.0_4.0.0.0__b77a5c561934e089/mscorlib.dll

Mono.Cecil
Assembly Version: 0.11.2.0
Win32 Version: 0.11.2.0
CodeBase: file:///C:/Users/cyclo/Desktop/Quasar-master/bin/Release/net452/Mono.Cecil.DLL

Vestris.ResourceLib
Assembly Version: 2.1.0.0
Win32 Version: 2.1.0.0
CodeBase: file:///C:/Users/cyclo/Desktop/Quasar-master/bin/Release/net452/Vestris.ResourceLib.DLL

@BurntDog BurntDog changed the title Startup Manager crashes, unusable option System.NullReferenceException: StartupManager StartupItems was null. Dec 30, 2020
@BurntDog BurntDog changed the title System.NullReferenceException: StartupManager StartupItems was null. System.NullReferenceException: "StartupManager" StartupItems was null. Dec 30, 2020
@BurntDog
Copy link
Author

OK, this is not a proper fix but a Band-Aid
Code needs a proper fix because a Exception is thrown when there is no data at all to be read
in these locations:

lstStartupItems.Groups.Add(new ListViewGroup("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run")

        lstStartupItems.Groups.Add(new ListViewGroup("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce")
 
        lstStartupItems.Groups.Add(new ListViewGroup("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run")
      
        lstStartupItems.Groups.Add(new ListViewGroup("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce")

        lstStartupItems.Groups.Add(new ListViewGroup("%APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\Startup")

===================================================================================
The Quick and dirty fix/Band-Aid, below

private void StartupItemsChanged(object sender, List StartupItems)
{
lstStartupItems.Items.Clear();
try
{
foreach (var item in StartupItems)
{
var i = lstStartupItems.Groups.Cast().First(x => (StartupType)x.Tag == item.Type);
ListViewItem lvi = new ListViewItem(new[] { item.Name, item.Path }) { Group = i, Tag = item };
lstStartupItems.Items.Add(lvi);
}
}
catch (NullReferenceException)
{

        }
        ///foreach (var item in StartupItems)

            ///{
            ///var i = lstStartupItems.Groups.Cast<ListViewGroup>().First(x => (StartupType)x.Tag == item.Type);
            ///ListViewItem lvi = new ListViewItem(new[] {item.Name, item.Path}) {Group = i, Tag = item};
            ///lstStartupItems.Items.Add(lvi);
        ///}
    }

I wish I was better then a good Script kiddie but, that's my reality I just don't have the brain power I guess.
Hope this helps some of you until a proper fix comes..

@BurntDog
Copy link
Author

BurntDog commented Dec 31, 2020

"Made separate Bug report for this" Almost forgot to mention, when you try to add a startup entry in Path field using "Startup Manager" it won't
let you use special characters ie.. : \ " you're forced to copy and paste. "Made separate Bug report for this"

@BurntDog
Copy link
Author

BurntDog commented Dec 31, 2020

"Made separate Bug report for this" I noticed that Startup Manger does not search these locations.
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\RunOnce
Will these be added back in future release? "Made separate Bug report for this"

@MaxXor
Copy link
Contributor

MaxXor commented Jan 1, 2021

I noticed that Startup Manger does not search these locations.
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\RunOnce
Will these be added back in future release?

Please create a separate bug report for this.

@BurntDog
Copy link
Author

BurntDog commented Jan 1, 2021

I noticed that Startup Manger does not search these locations.
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\RunOnce
Will these be added back in future release?

Please create a separate bug report for this.

OK, thanks and Happy New Year @MaxXor

@BurntDog BurntDog closed this as completed Jan 1, 2021
@BurntDog BurntDog reopened this Jan 1, 2021
@BurntDog
Copy link
Author

BurntDog commented Jan 1, 2021

Closed by mistake....

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants