Template build error

3
open
ZhiZe-ZG
ZhiZe-ZG
Posted 2 months ago

Template build error #7545

I create a game by

dotnet new mgdesktopgl -o GuessNumber

then build it

cd GuessNumber
dotnet build

and I get

CSC : error CS7065: Error building Win32 resources -- Unable to read beyond the end of the stream. [D:\GuessNumber\GuessNumber.csproj]

Build FAILED.

I'm using visual studio 2022 preview and dotnet 6.0 but I have installed the dotnet core 3.1(mgcb-editor and MonoGame.Templates.CSharp as well).

What version of MonoGame does the bug occur on:

  • MonoGame 3.8

What operating system are you using:

  • Windows 10

What MonoGame platform are you using:

  • DesktopGL
ZhiZe-ZG
ZhiZe-ZG
Created 2 months ago

I fix this by delete

<ApplicationIcon>Icon.ico</ApplicationIcon>

in my GuessNumber.csproj

But I don't know why.

Apostolique
Apostolique
Created 2 months ago

I ran into this issue the other day. I wonder if the icon in the NuGet package got corrupted somehow? You should be able to replace the one in your project with this one; https://github.com/MonoGame/MonoGame/blob/develop/Templates/MonoGame.Templates.CSharp/content/MonoGame.Application.DesktopGL.CSharp/Icon.ico.

Edit: And apparently you also need to replace: https://github.com/MonoGame/MonoGame/blob/develop/Templates/MonoGame.Templates.CSharp/content/MonoGame.Application.DesktopGL.CSharp/Icon.bmp.

ZhiZe-ZG
ZhiZe-ZG
Created 2 months ago

@Apostolique Thanks, it works. But I create the project from template. I'm curious how this happend. (Now I can create normal new project.)