Attention: We are retiring the ASP.NET Community Blogs. Learn more >


"Knowledge has to be improved, challenged, and increased constantly, or it vanishes."

Resolving 'System.Drawing.Image' Errors After Upgrading to .NET 9

Microsoft recently released .NET 9, the latest version of its popular development platform. This release brings several enhancements, including improved performance, enhanced developer productivity tools, and updated runtime features. With a focus on streamlining application development and introducing new capabilities, .NET 9 continues to solidify its position as a powerful framework for modern software development.

Being excited about the new .NET 9 release, I decided to upgrade one of the projects I was working on from .NET Core 8 to .NET 9. However, to my surprise, I encountered the following error while building the application:

The type name 'Image' could not be found in the namespace 'System.Drawing'. This type has been forwarded to assembly 'System.Drawing.Common, Version=0.0.0.0 Consider adding a reference to that assembly.

See the screenshot of the error shown in the Visual Studio.

image

By clicking on the error, I discovered that the following line of code was causing the issue:

System.Drawing.Image img = System.Drawing.Image.FromStream(memoryStream);

At first, I didn’t have a clear idea about what was causing the issue. Searching online didn’t yield much helpful information at the time. After some trial and error, I decided to check the NuGet Package Manager to see if there was a package named System.Drawing.Common, as hinted in the error message.

image

I found the package in the NuGet Package Manager and installed it. To my relief, this resolved the error, and the application started building successfully. The best part? There was no need to modify any existing namespaces or references in my code. Simply adding the System.Drawing.Common package fixed the issue seamlessly.

Summary

The error was caused because .NET 9 does not include the System.Drawing.Common library by default. In previous versions like .NET 8, this library was automatically referenced in certain project templates, allowing developers to use classes like System.Drawing.Image seamlessly. With .NET 9, this behavior has changed, requiring developers to explicitly include the System.Drawing.Common NuGet package when these features are needed.

14 Comments

  • I’ve been using essaypro app recently, and as a student, it has been a real lifesaver. The app is intuitive, making it easy to place orders and communicate with writers directly. The essay I received was high-quality, well-researched, and met all my requirements. I really appreciate how simple the process is, and it has saved me so much time during busy weeks.

  • Upgrading to .NET 9 always comes with surprises, and handling compatibility issues like missing references can be frustrating. When dealing with complex systems, a smooth experience is essential—not just in development but in entertainment as well. For those who appreciate precision and strategy, I’ve found that this site provides an excellent roulette experience. The platform ensures seamless gameplay, fair mechanics, and a variety of options to suit different strategies. Whether you're into classic or live roulette, it’s a reliable choice for a top-tier gaming experience.







  • Usually they don't have many glitches after an update, but sometimes there are some snags

  • Thank you for sharing this helpful information! I recently upgraded to .NET 9 as well, and I faced a similar issue with the System.Drawing.Image class after the upgrade. The error message you encountered was exactly the same. I wasn’t sure what the issue was at first either, but your suggestion to check the NuGet Package Manager for System.Drawing.Common was spot on.

    Once I added the System.Drawing.Common package to my project, everything worked perfectly. It's great to see these issues documented so clearly, as it saves a lot of time for developers troubleshooting after upgrades. Keep up the good work!

  • I didn't think that gambling could be such an interesting pastime, but I accidentally came across Casino https://odds96.in/en/blog/what-is-aviator-game and decided to try it. I made a couple of bets, I thought it would just be fun, but I didn't expect that luck would be on my side! A couple of wins and a quick withdrawal of funds made the evening much more interesting. It was unexpectedly pleasant.

  • I didn't think that gambling could be such an interesting pastime, but I accidentally came across Casino <a href="https://odds96.in/en/blog/what-is-aviator-game">https://odds96.in/en/blog/what-is-aviator-game</a> and decided to try it. I made a couple of bets, I thought it would just be fun, but I didn't expect that luck would be on my side! A couple of wins and a quick withdrawal of funds made the evening much more interesting. It was unexpectedly pleasant.

  • Discover more knowledge and unique moments

  • Great post! It's always refreshing to see how agencies tailor strategies for different platforms instead of using a one-size-fits-all approach. If you're looking for reliable web development in Florida, there are top-tier services for custom software, marketplace platforms, API integrations, and enterprise solutions to help your business grow.

  • Great post! If you need reliable dryer vent cleaning in Pennsylvania, top professionals offer expert services to boost safety and efficiency in your home or business.

  • Great post! For reliable sliding door repair in Miami, Florida, expert technicians are available to restore smooth operation and security for your home or business.

  • The Aviator game, developed by Spribe, is considered unique in the online casino landscape primarily due to its "crash game" mechanics and its emphasis on player control, transparency, and social interaction. site- https://www.aviatorregistration.com/

  • One of the most thrilling and enjoyable betting alternatives available today is sports betting. Because sports are so popular in our nation, games and sports are the main betting options for the majority of bettors. Since we at Mahadev Betting App are the ones who understand this attitude the best, we provide you with a wide range of betting possibilities.

  • There are many great websites where you can Games Live Play without downloading anything! Here are some of the most popular and well-known options.
    http://www.dibiz.com/gamesliveplayin
    http://www.proko.com/@gamesliveplay/activity
    http://www.rockurlife.net/user/gamesliveplay/?profiletab=main
    http://www.myminifactory.com/users/gamesliveplay
    http://www.gweb.com/games-live-play-online-games-%f0%9f%8e%ae-play-online-for-free/
    http://peatix.com/user/27014931/view
    http://justpaste.it/u/Games_Live_Play
    http://www.notebook.ai/users/1097547
    http://bulkwp.com/support-forums/users/gamesliveplay/
    http://shootinfo.com/author/gamesliveplay/?pt=ads
    http://www.ilmercatinodelcamionista.it/author/gamesliveplay/
    http://coub.com/gamesliveplay
    http://www.ebluejay.com/feedbacks/view_feedback/Gamesliveplay
    http://www.sportjim.com/gamesliveplay
    http://interestpin.com/user/81600/Gamesliveplay
    http://www.moviebreak.de/users/Gamesliveplay
    http://www.civocracy.org/user/46230
    http://decidim.rezero.cat/profiles/Gamesliveplay/activity
    http://haveagood.holiday/users/425279
    http://kitsu.app/users/gamesliveplay
    http://www.beatstars.com/gamesliveplay
    http://lovelinetapes.com/members/gamesliveplay/profile/
    http://git.guildofwriters.org/Gamesliveplay?tab=activity
    http://photoclub.canadiangeographic.ca/profile/21629758
    http://share.pkbigdata.com/Gamesliveplay?tab=activity
    http://www.producthunt.com/@games_play2
    http://www.fundable.com/user-1178010
    http://onlinevetjobs.com/author/gamesliveplay/
    http://jobs.emiogp.com/author/Gamesliveplay/
    http://buyerseller.xyz/user/gamesliveplay/
    http://calgarybusinesses.ca/dashboard/listings/Gamesliveplay/
    http://experiment.com/users/gliveplay
    http://www.mazafakas.com/user/profile/7114968
    http://schoolido.lu/user/gamesliveplay/
    http://www.gifthero.com/gift-hero--281927385
    http://crowdsourcer.io/profile/9Gwe0CBE
    http://socialsocial.social/user/gamesliveplay/
    http://www.youcamapps.com/profile/292193472554020191
    http://www.gamerlaunch.com/community/users/blog/6676456
    http://files.fm/gamesliveplay.in/info
    http://anunt-imob.ro/user/profile/813003
    http://maker.wiznet.io/Gamesliveplay
    http://www.babelcube.com/user/games-live-play
    http://savee.it/gamesliveplayin/
    http://caribbeanfinder.com/profile/games-live-play/
    http://casualgamerevolution.com/user/gamesliveplay
    http://decidim.santjaumedelsdomenys.cat/profiles/Gamesliveplay/activity
    http://www.papercall.io/speakers/gamesliveplay
    http://veterinarypracticetransition.com/author/gamesliveplay/
    http://roomstyler.com/users/gamesliveplay
    http://mecabricks.com/en/user/Gamesliveplay
    http://expathealthseoul.com/profile/games-live-play/
    http://expatguidekorea.com/profile/games-live-play/
    http://divisionmidway.org/jobs/author/gamesliveplay/
    http://www.checkli.com/gamesliveplay
    http://dojour.us/u/gamesliveplay
    http://www.zerohedge.com/user/SnA4mNOkyiV4KPshc1DJPwq1kc13
    http://morguefile.com/creative/gamesliveplay
    http://www.bikemap.net/en/u/gamesliveplayin/routes/created/
    http://code.antopie.org/Gamesliveplay?tab=activity
    http://myarticles.io/members/gamesliveplay/profile/
    http://www.longisland.com/profile/Gamesliveplay
    http://git.entryrise.com/Gamesliveplay?tab=activity
    http://so-geht.digital/author/Gamesliveplay/
    http://www.chambresapart.fr/user/gamesliveplayin
    http://daybyme.com/games-live-play
    http://www.grepmed.com/gamesliveplayin
    http://www.eltianguisvirtual.net/author/Gamesliveplay/
    http://aprenderfotografia.online/usuarios/gamesliveplay/profile/
    http://getdata.io/community-profiles/46856-games-play
    http://anyflip.com/homepage/qupxc/preview
    http://fun4friends.com/profile-3619476
    http://www.bitsdujour.com/profiles/E8EpwC
    http://laojobsvacancy.com/author/gamesliveplay/
    http://themindfulnessclinic.com.au/forums/users/gamesliveplay/

  • Thanks for addressing this! The System.Drawing.Image issues after moving to .NET 9 had me scratching my head for hours—this explanation really helped. On a different note, if you’re ever in need of a break from debugging, I highly recommend trying out axe throwing in Libertyville at TimberJaxe. It’s a great way to blow off steam!

Add a Comment

As it will appear on the website

Not displayed

Your website