L
Lucvdv
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.
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.