Ok, I had a weird situation. I had changed my namespace in code but not in the project properties. I was following these solutions and not getting anywhere until I went to my project properties and realized the Assembly name and Default Namespace needed to be changed to my new name!
Kickstart your startup firm with our staggering digital marketing and SEO services.
14 October 2022 at 14:11
If like me you're having problems accessing an embedded (assembly) resource using GetManifestResourceStream(), then read on:
GetManifestResourceStream was returning null even though I was pre-fixing the resource name with the namespace, i.e. NameSpace.Resource.ext.
The problem turned out to be the sub directory was missing from the name, in my example my resource lived under a folder (in the solution explorer) called Resources, so changing the qualified name to be:
"GetManifestResourceStream() returns NULL"
9 Comments -
Thank-you!!
21 May 2012 at 20:49
Thank you. That answered my query
29 October 2012 at 16:27
thanks a lot I would say !
30 January 2013 at 13:54
Brilliant....that has me stumped for about 5 seconds :)
4 April 2013 at 09:35
Thanks!! This solved it for me
27 December 2013 at 10:58
Thank you, that solved my problem!
15 April 2015 at 21:26
From this article :
http://stackoverflow.com/questions/21637830/getmanifestresourcestream-returns-null
string[] array = this.GetType().Assembly.GetManifestResourceNames();
string[] array2 = Assembly.GetExecutingAssembly().GetManifestResourceNames();
Will help you to get resource name.
26 July 2015 at 21:10
Ok, I had a weird situation. I had changed my namespace in code but not in the project properties. I was following these solutions and not getting anywhere until I went to my project properties and realized the Assembly name and Default Namespace needed to be changed to my new name!
7 September 2017 at 22:14
Kickstart your startup firm with our staggering digital marketing and SEO services.
14 October 2022 at 14:11