I have a XML called british-english-dictionary.xml loaded in my Solution Explorer. It is set as an Embedded Resource under the Build Action.
I’m trying to read it using the following code:
Dim asm = Assembly.GetExecutingAssembly()
Dim var = asm.GetManifestResourceStream("MyNamespace.british-english-dictionary.xml")
The problem is that it isn’t loading; I believe it is because the MyNamespace part it incorrect, but how do I find out what the MyNamespace should be replaced with?
The important setting is Project + Properties, Application tab, Default namespace. That’s the name that prefixes the name of the file.
You can always double-check the actual name as used in the assembly manifest by using Ildasm.exe. Double-click the Manifest in the main window and locate the .mresource statement. A sample program I created with the default namespace set to “Foo” and test.xml added as an embedded resource produced this output in Ildasm.exe: