Skip to content

Sequence contains more than one matching element #118

@paoloambrosio

Description

@paoloambrosio

Important

When removing a library (storage folder) from the Steam UI, it is not removed from steamapps\libraryfolder.vdf. Until we understand how Steam determines if a library is active or not, and where that information is stored, there is nothing that can be done to fix this.

On startup, CM display this error:

Sequence contains more than one matching element
   at AMS2CM.GUI.App.ThrowingModManager.FetchState() in D:\a\AMS2CM\AMS2CM\src\GUI\App.xaml.cs:line 72
   at AMS2CM.GUI.MainWindow.SyncModListView() in D:\a\AMS2CM\AMS2CM\src\GUI\MainWindow.xaml.cs:line 74
   at AMS2CM.GUI.MainWindow.Root_Loaded(Object sender, RoutedEventArgs e) in D:\a\AMS2CM\AMS2CM\src\GUI\MainWindow.xaml.cs:line 31
   at WinRT._EventSource_global__Microsoft_UI_Xaml_RoutedEventHandler.EventState.<GetEventInvoke>b__1_0(Object sender, RoutedEventArgs e)
   at ABI.Microsoft.UI.Xaml.RoutedEventHandler.Do_Abi_Invoke(IntPtr thisPtr, IntPtr sender, IntPtr e)

Steps to reproduce the issue:

  • On Steam Settings / Storage
    • "Remove Library" where AMS2 is installed
    • Move the SteamLibrary folder to a new location
    • "Add Drive" back, different location ("Choose another location" option)
    • Validate that AMS2 is available on Steam in the new location
  • Start CM

Reason for the error is that steamapps\libraryfolder.vdf still contains the old location despite it having been removed!

"libraryfolders"
{
	"0"
	{
		"path"		"C:\\Program Files (x86)\\Steam"
		"label"		""
		"contentid"		"8836340582293123977"
		"totalsize"		"0"
		"update_clean_bytes_tally"		"465057161"
		"time_last_update_corruption"		"0"
		"apps"
		{
			"228980"		"159585466"
		}
	}
	"1"
	{
		"path"		"X:\\SteamLibrary"
		"label"		""
		"contentid"		"1667562575883360818"
		"totalsize"		"470599856128"
		"update_clean_bytes_tally"		"41364098416"
		"time_last_update_corruption"		"1701430242"
		"apps"
		{
			"1066890"		"123720443666"
		}
	}
	"2"
	{
		"path"		"X:\\Games\\SteamLibrary"
		"label"		""
		"contentid"		"1667562575883360818"
		"totalsize"		"470599856128"
		"update_clean_bytes_tally"		"43860647"
		"time_last_update_corruption"		"0"
		"apps"
		{
			"1066890"		"123720443666"
		}
	}
}

Workarounds:

  • Remove the incorrect entry from steamapps\libraryfolder.vdf
  • Alternatively, configure CM with a fixed game location

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions