Recovering from a system crash, help with project issues required

I will donate $50 to MonoGame via Patreon to get this straightened out.

I had an SSD crash. I’ve downloaded and reinstalled VS 2022 Community. I downloaded and installed MonoGame. I downloaded my source from the bitbucket repo. It’s throwing these errors:

Please note the following:
Content.mgcb in the Content folder but it doesn’t have its cheery icon.
Note the error message at the top of the screen. Here’s the log:

Parameter name: itemsChangedAtUtc ---> System.ArgumentException: Must not be DateTime.MinValue.
Parameter name: itemsChangedAtUtc
   at Microsoft.VisualStudio.ProjectSystem.VS.UpToDate.UpToDateCheckStatePersistence.StoreItemStateAsync(String projectPath, IImmutableDictionary`2 configurationDimensions, Int32 itemHash, Nullable`1 itemsChangedAtUtc, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.ProjectSystem.UpToDate.UpToDateCheckImplicitConfiguredInputDataSource.<>c__DisplayClass7_0.<<LinkExternalInput>g__TransformAsync|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.TransformBlockSlim`2.TransformBlockSlimAsync.<ProcessInputAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.ProjectSystem.DataReceivingBlockSlim`1.<ProcessInputQueueAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
   at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>g__Action|0()
   at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.ArgumentException: Must not be DateTime.MinValue.
Parameter name: itemsChangedAtUtc
   at Microsoft.VisualStudio.ProjectSystem.VS.UpToDate.UpToDateCheckStatePersistence.StoreItemStateAsync(String projectPath, IImmutableDictionary`2 configurationDimensions, Int32 itemHash, Nullable`1 itemsChangedAtUtc, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.ProjectSystem.UpToDate.UpToDateCheckImplicitConfiguredInputDataSource.<>c__DisplayClass7_0.<<LinkExternalInput>g__TransformAsync|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.TransformBlockSlim`2.TransformBlockSlimAsync.<ProcessInputAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.ProjectSystem.DataReceivingBlockSlim`1.<ProcessInputQueueAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
   at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>g__Action|0()
   at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )<---

Note the error message at the bottom of the screen. Here’s the message:

Severity	Code	Description	Project	File	Line	Suppression State
Error	MSB3073	The command "dotnet C:\Users\Ezra\.nuget\packages\monogame.content.builder.task\3.8.0.1641\build\\..\tools\netcoreapp3.1\any\mgcb.dll /quiet /@:"C:\Users\Ezra\Desktop\Bitbucket GS\gsblackpowder\Solution\GSBPGEMG\Content\Content.mgcb" /platform:Windows /outputDir:"C:/Users/Ezra/Desktop/Bitbucket GS/gsblackpowder/Solution/GSBPGEMG/Content/bin/Windows/Content" /intermediateDir:"C:/Users/Ezra/Desktop/Bitbucket GS/gsblackpowder/Solution/GSBPGEMG/Content/obj/Windows/Content" /workingDir:"C:/Users/Ezra/Desktop/Bitbucket GS/gsblackpowder/Solution/GSBPGEMG/Content/"" exited with code -2147450730.	GSBPGEMG	C:\Users\Ezra\.nuget\packages\monogame.content.builder.task\3.8.0.1641\build\MonoGame.Content.Builder.Task.targets	138	

Here’s what the game was looking like before the SSD crash:

I’ve poured my life into this game (see here). I know the source on Bitbucket isn’t corrupted, we just have to straighten out the MonoGame / Visual Studio 2022 environment (this is what I keep telling myself so I don’t do anything drastic).

Again, please help! Thanks! I’m serious about donating $50!

1 Like

Aside> Donate regardless, provided you feel it is something you are happy to support.

Topic> Did you try reloading the project?

And can you copy paste the code by hand to a working solution? Could be the solution got frazzled, just open two VS instances, build the new instance and get CornFlowerBlue, then copy code files and paste into new solution… add the references and see if it works…

If not, someone may be familiar… and post…

Good Luck, and in the mean time, get in the garden while you can… :sake:

So you’re suggesting just to see if I can build the simplest MonoGame program possible? Worth a try. Thanks.

Okay, just did this, and yup, worked fine. HOWEVER, the one thing I noticed was that this time I selected - as per instructions in the Introduction page - using OpenGL, where my big game, I think, was using DirectX. My game just does sprites and type so, graphically, it’s no big deal.

Seems to me that by doing so you’ve accidentally migrated from MG 3.8 to MG 3.8.1 which changes how content pipeline works a bit.

Follow the migration guide to fix your issue and complete migration: MonoGame/migrate_38.md at develop · MonoGame/MonoGame · GitHub

Alternatively uninstall monogame and download MG 3.8.0

MG 3.8.0 is available here: MonoGame 3.8 - #77

2 Likes

Wow! I think that’s it! I’m writing code, dum de dum, never update MonoGame, dum de dum, SSD crashes! Have to reinstall VS, MonoGame, download code from repo. Bam! Excellent deduction.

I’ve uninstalled 3.8.1 but I can’t find 3.8. That link doesn’t seem to go an old download; just 3.8.1

Alternatively, in your package manager select your preferred version here:

I am going to get some sleep, gl!

I did as you suggested and I’m down to MonoGame 3.8:

My project compiles, links and runs and then stops trying to load content. Clearly the Content was never compiled (there’s no MGCB in the Content folder, either).

How do I install the 3.8 MGCB into my project and whatever else needs to be done to compile Content? I think this is the last step to getting this all to work again.

I’ve downloaded the NuGet 3.8 packages for the editor and tried to install them via command line but no luck:

Any help would be appreciated. Thanks!

:ballot_box_with_check: I amended the topic title.

Great. Any idea how to install the MGCB? I’ve downloaded the packages. I tried running the command line and nothing.

I found this weird file in my Content folder:
mgcb in conent
but, obviously, it doesn’t have the right icon. The Content just isn’t being compiled. Everything else is working.

Here is my cs.proj:

<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net6.0-windows</TargetFramework>
    <PublishReadyToRun>false</PublishReadyToRun>
    <TieredCompilation>false</TieredCompilation>
    <UseWindowsForms>False</UseWindowsForms>
  </PropertyGroup>
  <PropertyGroup>
    <ApplicationManifest>app.manifest</ApplicationManifest>
    <ApplicationIcon>generalstaff_arrows_game.ico</ApplicationIcon>
  </PropertyGroup>
  <ItemGroup>
    <Compile Remove="GameLoad.cs" />
  </ItemGroup>
  <ItemGroup>
    <None Remove="Content\Bottom Lancers Trans.png" />
    <None Remove="Content\GeoSlabBold56.spritefont" />
    <None Remove="Content\Inf4Game.png" />
    <None Remove="Content\MainFrame.png" />
    <None Remove="Content\Modern Splash Font.spritefont" />
    <None Remove="Content\ModernSplashFont.spritefont" />
    <None Remove="Content\SmallAvantGarde.spritefont" />
    <None Remove="Content\Splash1.png" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="generalstaff_arrows_game.ico" />
  </ItemGroup>
  <ItemGroup>
    <TrimmerRootAssembly Include="Microsoft.Xna.Framework.Content.ContentTypeReader" Visible="false" />
  </ItemGroup>
  <ItemGroup>
    <MonoGameContentReference Include="Content\Content.mgcb" />
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.0.1641" />
    <PackageReference Include="MonoGame.Framework.WindowsDX" Version="3.8.0.1641" />
    <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\..\ModelLib\ModelLib.csproj" />
    <ProjectReference Include="..\..\TacticalAILib\TacticalAILib.csproj" />
  </ItemGroup>
  <ItemGroup>
    <Reference Include="TacticalAILib">
      <HintPath>..\..\TacticalAILib\bin\Debug\net6.0-windows\TacticalAILib.dll</HintPath>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Compile Update="Properties\Resources.Designer.cs">
      <DesignTime>True</DesignTime>
      <AutoGen>True</AutoGen>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Update="Properties\Resources.resx">
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
    </EmbeddedResource>
  </ItemGroup>
</Project>

And here is the current error message:

Severity	Code	Description	Project	File	Line	Suppression State
Error	MSB3073	The command "dotnet C:\Users\Ezra\.nuget\packages\monogame.content.builder.task\3.8.0.1641\build\\..\tools\netcoreapp3.1\any\mgcb.dll /quiet /@:"C:\Users\Ezra\Desktop\Bitbucket GS\gsblackpowder\Solution\GSBPGEMG\Content\Content.mgcb" /platform:Windows /outputDir:"C:/Users/Ezra/Desktop/Bitbucket GS/gsblackpowder/Solution/GSBPGEMG/Content/bin/Windows/Content" /intermediateDir:"C:/Users/Ezra/Desktop/Bitbucket GS/gsblackpowder/Solution/GSBPGEMG/Content/obj/Windows/Content" /workingDir:"C:/Users/Ezra/Desktop/Bitbucket GS/gsblackpowder/Solution/GSBPGEMG/Content/"" exited with code -2147450730.	GSBPGEMG	C:\Users\Ezra\.nuget\packages\monogame.content.builder.task\3.8.0.1641\build\MonoGame.Content.Builder.Task.targets	138	

I hope there are some clues here. Clearly the problem is compiling the Content and it’s not happening.

Ended up donating $16/month indefinitely.
Just pushed on to the new version 3.8.1. Everything is working.
I certainly didn’t think I could bribe any coder for $50. I just wanted to pay back the community for helping. MonoGame community is so much more friendly than say Stack Overflow.
Anyway, I’m back to writing my GAME!!!

3 Likes

Thanks Ravendarke, the 3.8.0 to 3.8.1 fixed my issue!