1. This forum is archived for reference. For support & bug reports visit the help section of forums.stardewvalley.net

Bug/Issue Game won't launch (Sequence contains no elements)

Discussion in 'Support' started by Nobbele, Aug 1, 2018.

  1. Nobbele

    Nobbele Space Hobo

    When i try and launch the game(tried both steam or standalone) nothing happens, steam says playing for a moment and then goes back to online. The ErrorLogs log says this

    Message: Sequence contains no elements
    Stack Trace: at System.Linq.Enumerable.Last[TSource](IEnumerable`1 source)
    at StardewValley.Options.setToDefaults() in C:\Users\gitlab-runner\gitlab-runner\builds\5c0f9387\0\chucklefish\stardewvalley\Farmer\Farmer\Options.cs:line 257
    at StardewValley.Options..ctor() in C:\Users\gitlab-runner\gitlab-runner\builds\5c0f9387\0\chucklefish\stardewvalley\Farmer\Farmer\Options.cs:line 154
    at StardewValley.Game1.LoadContent() in C:\Users\gitlab-runner\gitlab-runner\builds\5c0f9387\0\chucklefish\stardewvalley\Farmer\Farmer\Game1.cs:line 1229
    at Microsoft.Xna.Framework.Game.Initialize()
    at StardewValley.Game1.Initialize() in C:\Users\gitlab-runner\gitlab-runner\builds\5c0f9387\0\chucklefish\stardewvalley\Farmer\Farmer\Game1.cs:line 1139
    at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
    at StardewValley.Program.Main(String[] args) in C:\Users\gitlab-runner\gitlab-runner\builds\5c0f9387\0\chucklefish\stardewvalley\Farmer\Farmer\Program.cs:line 144

    I have 2 monitors(up to date drivers) and when i set monitor 2(integrated gpu) as main monitor, the game launches but the screen is white. I have managed to get the game running by setting the main monitor to monitor 2, starting the game and quickly setting main monitor to monitor 1 but the resolution get weird so it's unplayable.

    On closer inspection i see that it's in options.cs and method setToDefaults(), i found this github https://github.com/sndcode/stardewvalleycode and went looking and i highly suspect it's these 2 lines
    this.preferredResolutionY = GraphicsAdapter.DefaultAdapter.SupportedDisplayModes.Last<DisplayMode>().Height;
    this.preferredResolutionX = GraphicsAdapter.DefaultAdapter.SupportedDisplayModes.Last<DisplayMode>().Width;
    GraphicsAdapter.DefaultAdapter.SupportedDisplayModes probably returns a 0 length ienumerable. System.Linq.Enumerable.Last[TSource](IEnumerable`1 source) even says Last() as it does in the code
    • Nobbele

      Nobbele Space Hobo

      Solved it by uninstalling my graphics drivers completely
      • Nobbele

        Nobbele Space Hobo

        but now other games don't work :/

        Share This Page