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

Creating new project (following Beefball tutorial) results in multiple missing dependency errors #1687

Closed
vivid-pixel opened this issue Feb 18, 2025 · 4 comments

Comments

@vivid-pixel
Copy link

vivid-pixel commented Feb 18, 2025

I installed all prerequisites from: https://docs.flatredball.com/flatredball

I'm attempting to follow the tutorial for Beefball: ttps://docs.flatredball.com/flatredball/tutorials/beefball/creating-a-glue-project

I cannot get the project to build in Visual Studio 2022 due to these missing packages:

Severity Code Description Project File Line Suppression State
Error (active) NU1101 Unable to find package MonoGame.Framework.DesktopGL. No packages exist with this id in source(s): C:\Program Files\dotnet\library-packs, Microsoft Visual Studio Offline Packages, Stride Beefball C:\Users\N\OneDrive\Documents\code\c#\Beefball\Beefball\Beefball.csproj 1
Error (active) NU1101 Unable to find package SkiaSharp. No packages exist with this id in source(s): C:\Program Files\dotnet\library-packs, Microsoft Visual Studio Offline Packages, Stride Beefball C:\Users\N\OneDrive\Documents\code\c#\Beefball\Beefball\Beefball.csproj 1
Error (active) NU1101 Unable to find package FlatRedBallDesktopGLNet6. No packages exist with this id in source(s): C:\Program Files\dotnet\library-packs, Microsoft Visual Studio Offline Packages, Stride Beefball C:\Users\N\OneDrive\Documents\code\c#\Beefball\Beefball\Beefball.csproj 1
Error (active) NU1102 Unable to find package Newtonsoft.Json with version (>= 13.0.3)

  • Found 1 version(s) in Microsoft Visual Studio Offline Packages [ Nearest version: 13.0.1 ]
  • Found 0 version(s) in C:\Program Files\dotnet\library-packs
  • Found 0 version(s) in Stride Beefball C:\Users\N\OneDrive\Documents\code\c#\Beefball\Beefball\Beefball.csproj 1
@vchelaru
Copy link
Owner

Can you open your .csproj file and look at which nuget packages are referenced? It looks like you are referencing MonoGame.Framework.DesktopGL but that is missing.

Things to try/do:

  1. Can you paste the contents of your .csproj?
  2. Are you able to add other nuget packages to visual studio projects? What if you create a new console app and add a common library like Newtonsoft JSON.net?
  3. Can you take a screenshot of your nuget sources in Visual Studio?

I'll be happy to answer questions here, but if you want to join discord I may be able to help more quickly too.

@vivid-pixel
Copy link
Author

vivid-pixel commented Feb 18, 2025

csproj file:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <RollForward>Major</RollForward>
    <PublishReadyToRun>false</PublishReadyToRun>
    <TieredCompilation>false</TieredCompilation>
    <EnableDefaultCompileItems>false</EnableDefaultCompileItems>
    <DefineConstants>MONOGAME;DESKTOP_GL;MONOGAME_381</DefineConstants>
  </PropertyGroup>
  <PropertyGroup>
    <ApplicationManifest>app.manifest</ApplicationManifest>
    <ApplicationIcon>Icon.ico</ApplicationIcon>
    <RootNamespace>Beefball</RootNamespace>
  </PropertyGroup>
  <ItemGroup>
    <None Remove="Icon.ico" />
    <None Remove="Icon.bmp" />
    <None Remove="**\*.glsj" />
    <None Remove="**\*.glej" />
    <None Remove="**\*.gluj" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="DataTypes\TileMapInfo.Generated.cs" />
    <Compile Include="FileAliases.Generated.cs" />
    <Compile Include="Game1.cs" />
    <Compile Include="Game1.Generated.cs">
      <DependentUpon>Game1.cs</DependentUpon>
    </Compile>
    <Compile Include="GlobalContent.Generated.cs" />
    <Compile Include="Performance\IEntityFactory.Generated.cs" />
    <Compile Include="Performance\PoolList.Generated.cs" />
    <Compile Include="Program.cs" />
    <Compile Include="Setup\CameraSetup.Generated.cs" />
    <Compile Include="TileCollisions\CollidableListVsTileShapeCollectionRelationship.Generated.cs" />
    <Compile Include="TileCollisions\CollidableVsTileShapeCollectionRelationship.Generated.cs" />
    <Compile Include="TileCollisions\CollisionManagerTileShapeCollectionExtensions.Generated.cs" />
    <Compile Include="TileCollisions\TileShapeCollection.Generated.cs" />
    <Compile Include="TileEntities\TileEntityInstantiator.Generated.cs" />
    <Compile Include="TileGraphics\AbstractMapLayer.Generated.cs" />
    <Compile Include="TileGraphics\AnimationChainContainer.Generated.cs" />
    <Compile Include="TileGraphics\ExternalTileset.Generated.cs" />
    <Compile Include="TileGraphics\LayeredTileMap.Generated.cs" />
    <Compile Include="TileGraphics\LayeredTileMapAnimation.Generated.cs" />
    <Compile Include="TileGraphics\MapDrawableBatch.Generated.cs" />
    <Compile Include="TileGraphics\MapLayer.Generated.cs" />
    <Compile Include="TileGraphics\MapTileset.Generated.cs" />
    <Compile Include="TileGraphics\MapTilesetTile.Generated.cs" />
    <Compile Include="TileGraphics\NamedValue.Generated.cs" />
    <Compile Include="TileGraphics\ReducedTileMapInfo.Generated.cs" />
    <Compile Include="TileGraphics\ReducedTileMapInfo.TiledMapSave.Generated.cs" />
    <Compile Include="TileGraphics\TileAnimation.Generated.cs" />
    <Compile Include="TileGraphics\TileAnimationFrame.Generated.cs" />
    <Compile Include="TileGraphics\TiledMapSave.Conversion.Generated.cs" />
    <Compile Include="TileGraphics\TiledMapSave.Serialization.Generated.cs" />
    <Compile Include="TileGraphics\TiledMapToShapeCollectionConverter.Generated.cs" />
    <Compile Include="TileGraphics\TileNodeNetworkCreator.Generated.cs" />
    <Compile Include="TileGraphics\Tileset.Generated.cs" />
    <Compile Include="TileGraphics\TilesetExtensionMethods.Generated.cs" />
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="Icon.ico" />
    <EmbeddedResource Include="Icon.bmp" />
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="FlatRedBallDesktopGLNet6" Version="2025.2.17.738" />
    <PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.1.303" />
    <PackageReference Include="Newtonsoft.Json">
      <Version>13.0.3</Version>
    </PackageReference>
    <PackageReference Include="SkiaSharp" Version="2.88.6" />
  </ItemGroup>
  <ItemGroup>
    <Reference Include="FlatRedBall.Forms.DesktopGlNet6">
      <HintPath>Libraries\DesktopGl\Debug\FlatRedBall.Forms.DesktopGlNet6.dll</HintPath>
    </Reference>
    <Reference Include="GumCore.DesktopGlNet6">
      <HintPath>Libraries\DesktopGl\Debug\GumCore.DesktopGlNet6.dll</HintPath>
    </Reference>
    <Reference Include="SkiaInGum">
      <HintPath>Libraries\DesktopGl\Debug\SkiaInGum.dll</HintPath>
    </Reference>
    <Reference Include="StateInterpolation.DesktopNet6">
      <HintPath>Libraries\DesktopGl\Debug\StateInterpolation.DesktopNet6.dll</HintPath>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <None Update="Content\Shader.fx">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="Content\shader.xnb">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="Content\ShaderForcePoint.fx">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="Content\ShaderForcePoint.xnb">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
  </ItemGroup>
  <Target Name="RestoreDotnetTools" BeforeTargets="Restore">
    <Message Text="Restoring dotnet tools" Importance="High" />
    <Exec Command="dotnet tool restore" />
  </Target>
</Project>

For the 2nd question, I'm not sure, as I'm new to C# and Visual Studio (not to programming as a whole). This is an out-of-the-box setup for Visual Studio 2022 and Flat Red Ball so I was thinking it's just documentation needing to be updated in some way.

Nuget installed sources ("Package source: All"):

  • FlatRedBallDesktopGLNet6 (2025.2.17.738)
  • MonoGame.Framework.DesktopGL (3.8.1.303)
  • Newtonsoft.Json (13.0.3)
  • SkiaSharp (2.88.6)

Screenshot:
Image

@vchelaru
Copy link
Owner

It seems to be a problem restoring nuget packages:

C:\Users\N\OneDrive\Documents\code\c#\Beefball\Beefball\Beefball.csproj 1
Error (active) NU1102 Unable to find package Newtonsoft.Json with version (>= 13.0.3)

This isn't just a FlatRedBall issue, but seems to be a general configuration issue with Visual Studio.

To check your package sources, you can do this:

  1. Open Visual Studio
  2. Select Tools -> Options
  3. Select NuGet Package Manager -> Package Sources
  4. Post a screenshot of your page. It might look like this:

Image

@vivid-pixel
Copy link
Author

Hey, that was it! I needed to add api.nuget.org as a source like you have in your screenshot.
Stride was the only entry listed for package sources, which is an engine I installed today and then uninstalled. Very nice of it to make a breaking change to VS and then not undo that change on its way out.
Image
Thank you for pointing out the missing piece of the puzzle.

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

No branches or pull requests

2 participants