Closed brunomuratore closed 4 months ago
Hi @brunomuratore
Normally we wouldn't support issues raised against previous major versions (we're on v3 now) but I'm not sure what target frameworks UWP support.
The issue itself is not an ImageSharp one but rather appears to me to be a bug in the compiler.
@Sergio0694 Apologies for the tag but you know a lot more about UWP than me. What are your thoughts?
"I'm not sure what target frameworks UWP support"
UWP is picking up the .NET Standard 2.0 target (it uses the uap
TFM, which is a weird ~.NET Core 2.1 TFM, but with all Span<T>
APIs missing from its ref assembly... It's a whole thing 😅), long story short it only accepts either code targeting uap
specifically, or otherwise any .NET Standard <= 2.0 TFM.
"The issue itself is not an ImageSharp one but rather appears to me to be a bug in the compiler."
Yeah this is a weird one, especially because it also repros with sideloaded Release packages (meaning ones you compiled locally), yet it doesn't with a normal Release build from VS. Impossible to say exactly what's causing that without just debugging the app. I do remember using ImageSharp on UWP in the past, and it worked (my app Legere is using 1.0.0-beta0010
).
...Honestly I think your best bet for UWP right now is try downgrading the ImageSharp package step by step until you find a previous release that happens to work 🙃
Thanks @Sergio0694 appreciate it!!
@brunomuratore when you say the following
Any image, any format.
I'm assuming you mean input images. Does saving as other image formats (jpg, png, etc) work?
Shouldn't UWP users be migrating to WinUI 3?
Prerequisites
DEBUG
andRELEASE
modeImageSharp version
2.1.6
Other ImageSharp packages and versions
none
Environment (Operating system, version and so on)
Win 11 and Win 10 on any* version
.NET Framework version
UWP x64 app (Target: win11 22H2, Min: win10 1903), c# 9.0
Description
IndexOutOfRangeException is thrown when running
SaveAsWebpAsync
on a published UWP app, independently of which image is loaded into the stream, any image will fail, any format will fail. The same code runs fine when running the UWP app directly from Visual Studio, either Debug or Release.Steps to Reproduce
The code work fine when running the app from Visual Studio, either from Debug or Release modes.
But it will fail only if:
If I try to create a sample app to try demostrate the issue, it works, although the code is being tested is virtually the same.
Images
Any image, any format.