mardi 6 novembre 2018

GetManifestResourceNames returns empty array

I am trying to load an xml file into a method to process it. I have two projects: SignalServer and DbLibrary. Inside DbLibrary there is a class SQLQuery that has a method GetResourceTextFile(string xmlFile). This method gets called in the SignalServer as follows:

SQLQueries.GetResourceTextFile("SignalServer.HubQueries.xml");

Within this method i try to load the resources from the xml file:

using (Stream resourceStream = Assembly.GetCallingAssembly()
                                                   .GetManifestResourceStream(xmlFile)){}

However, the GetManifestResourceStream does not seem to be getting any resources passed to it. In fact, when i use the following to debug:

string [] p = Assembly.GetCallingAssembly().GetManifestResourceNames();

The array is empty.

The file that i am trying to load is within the SignalServer directory. Why is it not seen by GetManifestResourceStreamand how do i fix that? Thanks!





Aucun commentaire:

Enregistrer un commentaire