Forum Discussion
PeterS1
Apr 15, 2025Copper Contributor
Enable .Net ImageFormat.WebP in VS 2022 Prof ASPX Web.Config
Hi.
I am developing C# ASPX Web sites in VS Professional 2022 (64 bit).
I want to access the System.Drawing.Imaging.ImageFormat.WebP property so I can manipulate WebP files. I believe this requires .Net 4.8.
I know there are 3rd party libraries out there - I would prefer to keep as much native MS code as possible.
I am unable to get System.Drawing.Imaging.ImageFormat.WebP as a selection option for the ImageFormat.
I can get all of the other formats e.g. TheImageFormat = System.Drawing.Imaging.ImageFormat.Jpeg/Gif/Png etc. WebP is not shown as an option.
I have Web.Config set as:
<compilation optimizeCompilations="true" debug="true" targetFramework="4.8.1"> <assemblies> <add assembly="System.Net, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /> <add assembly="System.Numerics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> </assemblies> </compilation> <httpRuntime targetFramework="4.8.1" executionTimeout="240" maxRequestLength="20480" requestValidationMode="2.0" />
The Targeting Packs & SDK seem to be installed & enabled as per the screen snap below.
Any help in resolving this is greatly appreciated.
Many thanks, Peter.
No RepliesBe the first to reply