i am having a problem in adding the image files to project namespace. I’m trying to do this like……..
Step 1:Going to add existing item menu.
Step 2:Then browsing to the file that i want to add and simply adding it.
But when I’m trying to read this file by this method——-
Assembly myAssembly = Assembly.GetExecutingAssembly();
Stream myStream = myAssembly
.GetManifestResourceStream("namespace.filename.fileExtension");
img = new Bitmap(myStream);
I get null in myStream. I think there is some other way to add files to the namespace of the project because previously I have added some files and the same method is working for those files.
Anybody knowing the answer please help.
Rregards,
Madhup
Have you marked those files to be an embedded resource (solution explorer)? Also – try it without the extension. You can use
GetManifestResourceNamesto check what is available.