System.Drawing.Icon NotSupportedException (Project is FooBar'ed)

G

Guest

Today after recompiling a referenced .dll in one of my compact framework
projects I began getting a 'System.Drawing.Icon NotSupportedException' on
this line in my mainform.designer.cs file...

this.imageListStatus.Images.Add(((System.Drawing.Icon)(resources.GetObject("resource"))));

I have found two posts that talk about this exact issue with CF projects
with no solution so far except to remake a new project and build all the UI
components again and paste the code. This will take me days, so Im seeing if
anyone has a shorter solution. At this point, I really can't see that
recreating it will actually do any good anyway, see below about my restore.

So, some background. VS2005 (not converted from 2003). PocketPC 2003
Emulator. All references are to 2.0 assemblies. I removed and recreated all
references. I have hard reset my EMU, rebooted my dev computer and still get
the error. I even tried restoring my project from last night so I could just
apply my changes for the day and I *still* get the exception on a project
that worked just fine yesterday. Something must be hosed with my dev pc???

Some things I noticed...

1. When deploying, It takes considerably longer than it used to. I get
messages such as 'deploying
c:\windows\GAC_MSIL\System.Drawing.2.0.0.0_b757475636362727\System.Drawing.dll'. Im pretty sure that I didn't have the long ambiguous file path previously.

2. If I comment out the image list resource loads, I get an error on the
app.icon resource load... this.Icon =
((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); ... so, something
is somehow messed up with the project resources. I restored my .resx file
from last night as well, no change. Examining the .resx file, everything
looks normal with the resource names above showing just fine.

Any thoughts????? Help!!!

thank you.
 
G

Guest

A little more info....

The issue with the assemblies loading from the path...

c:\windows\GAC_MSIL\System.Drawing.2.0.0.0_b75747563

was not related. This came from the fact that one my referenced assemblies
had a dependency on some non PPC .net assemblies. Removing that dependency,
fixed the long deployments to the PPC emulator.

Also, I completely removed all items (Imagelists, PicturedBoxes, etc) that
used embedded resources for their image sources. The application compiled and
ran fine. I then re-added a single image list and added two images through
the PropertyGrid, and then I received the same GetObject error as above when
the imageList attempted to load it's images from the resource at runtime.

Also, I created a new Smart Device project/solution and added an imagelist
with image through the propertygrid and it ran fine. So, the problem appears
to be project/solution specific to my problem application only. I dug around
in the project and solution files looking for oddities but did not see
anything.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top