Embedding resources in algos
Created at 10 Jun 2016, 21:41
ZE
Embedding resources in algos
10 Jun 2016, 21:41
Looks like embedded resources are stripped from the algos during the build process? I would like to have a config file embedded, rather than try to refer to it on the disk (which is my current solution). Is this possible?
Replies
zelenij.krokodil
14 Jun 2016, 18:26
I have a text file in my algo project in Visual Studio. I set the build action to Embedded Resource. In a regular .NET assembly I could read it with code similar to this:
var assembly = Assembly.GetExecutingAssembly(); var resourceName = "MyCompany.MyProduct.MyFile.txt"; using (Stream stream = assembly.GetManifestResourceStream(resourceName)) using (StreamReader reader = new StreamReader(stream)) { string result = reader.ReadToEnd(); }
But the algo building process must be stripping resources, I guess, because mine isn't there.
@zelenij.krokodil
Spotware
14 Jun 2016, 17:58
Dear Trader,
Could you please provide us with more details regarding your question?
What kind of configuration file do you want to embed in our code?
You can contact us at feedback@spotware.com, if you like.
@Spotware