Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7492151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:22:42+00:00 2026-05-29T16:22:42+00:00

I am getting a FileNotFoundException on a Windows Forms Application project, with the following

  • 0

I am getting a FileNotFoundException on a Windows Forms Application project, with the following message:

Could not load file or assembly 'System.Drawing, Version=4.0.0.0, 
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. 
The system cannot find the file specified.

To replicate the problem:

  • Select New, Project, choose .Net Framework 2.0 as the target and pick Windows Forms Application as the project type.
  • On the properties of the form created by default, select a value for the Icon property. Any .ico file will do. This will embed the file on the resx file.
  • Compile and run the application.

When I do this, the program stops on the line this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); with the following exception:

System.IO.FileNotFoundException was unhandled
  Message=Could not load file or assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
  Source=mscorlib
  FileName=System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

I’m getting this on Visual Studio 2010 SP1, recently installed on Windows 8 Developer Preview. If I change the project properties to target .Net Framework 4, the error goes away.

On the Form1.resx file, I can see that the version of the System.Drawing assembly is explicitly stated as 2.0:

<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T16:22:43+00:00Added an answer on May 29, 2026 at 4:22 pm

    I’ve found a possible solution, please try this:

    Open the resx File in the Designer and set the accessmodifier from public to no code generation.

    Edit: there’s a workaround, but very annoying though.

    1. Open Form in Designer and make needed GUI changes. Close designer and save
    2. Compile project and receive RESX compile error (only forms with Imagelist should have this problem)
    3. Double-click resx compile error to open resx file.
    4. Scroll to top of imagestream.
    5. Edit the top line of the Image stream:
      AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
      TO
      AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
    6. Close and save resx file and recompile.

    **NOTE: the only difference are the characters at end “j00LjAuMC4w’ to “j0yLjAuMC4w”
    This needs to be done EVERY TIME you open the form in Designer mode.

    Microsoft says they are going to fix it in the next VS version…

    Source: http://connect.microsoft.com/VisualStudio/feedback/details/532584/error-when-compiling-resx-file-seems-related-to-beta2-bug-5252020

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting an exception with this code; InnerException: System.InvalidOperationException Message=The specified type was not
I'm getting the following error when starting up Selenium on XP java.lang.RuntimeException: Could not
I am getting FileNotFoundException when I make the following call: IsolatedStorageFileStream rootFile = store.CreateFile(abc.txt);
I am using following tutorial to upload image file to webserver. and getting file
I am getting what I think is a bogus File Not Found error when
When rendering a view in an ASP.NET MVC application, I am getting the following
I'm getting a suprising FileNotFoundException although i'm sure that the file exists. I simply
I'm getting a FileNotFoundException when I'm trying to download the file http://tfob.azstarnet.com/images/authors/Alcal%C3%A1_Kathleen_small.jpg . The
I'm getting the filenotfoundexception on my apps directory but my directory clearly exists. I'm
Getting the above error in following code. How to rectify it. Thanks. Please look

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.