468,241 Members | 1,428 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,241 developers. It's quick & easy.

Compiler won't include resources for all forms

In an app that was working, all I did was specify an icon for the main
form (through the form designer) and recompile it.

Result: MissingManifestResourceException

After digging around, I found that the compiler generates .resource
files in the debug build of the application, for all forms except the
main one (form1).

The .resx file (with the icon in it) exists in the source directory,
and in the project file it's specified as for "embedded resource" type
compilation, but the compiler still seems to ignore it.

Does anyone have an idea what might cause this?
Cut & paste from the .vbproj file:

<File
RelPath = "Form1.vb"
SubType = "Form"
BuildAction = "Compile"
/>
<File
RelPath = "Form1.resx"
DependentUpon = "Form1.vb"
BuildAction = "EmbeddedResource"
/>

There's no difference between this and similar sections for other
three forms.

Files in the ./obj/debug directory after a full recompile:

App.exe
App.Form2.resources
App.Form3.resources
App.Form4.resources
App.pdb
<DIR> temp
<DIR> TempPE
In the InitializeComponent function, this line fails (single line in
the source):

Me.Icon = CType(resources.GetObject("$this.Icon"),
System.Drawing.Icon)

Resources are opened at the start of that function as (single line):

Dim resources As System.Resources.ResourceManager
= New System.Resources.ResourceManager(GetType(Form1))

The icon is present in form1.resx, named $this.Icon and culture
neutral.

Nov 20 '05 #1
1 1012
On Tue, 27 Apr 2004 18:09:56 +0200, Lucvdv <re**********@null.net>
wrote:
In an app that was working, all I did was specify an icon for the main
form (through the form designer) and recompile it.

Result: MissingManifestResourceException


Sorry, for asking, and here's the solution (I found previous questions
about the same problem, so maybe I'm helping someone):

I had included a small auxiliary class by just inserting the 7 (seven)
lines that define it at the start of Form1.vb.

That was it: all I had to do was move it to a separate source file.
Now Form1.resources is created at compile time, and the application no
longer crashes at startup.
Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

34 posts views Thread by Nikola Skoric | last post: by
13 posts views Thread by Neil Zanella | last post: by
1 post views Thread by Alpha | last post: by
5 posts views Thread by taylorjonl | last post: by
5 posts views Thread by wkaras | last post: by
reply views Thread by Alejandro Gaio | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.