By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,475 Members | 1,058 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,475 IT Pros & Developers. It's quick & easy.

Compiler won't include resources for all forms

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.