Embedding resources in algos

10 Jun 2016, 21:41Embedding resources in algos#1
zelenij.krokodilposts: 26since: 05 Jun 2016

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?

14 Jun 2016, 17:58#2
Spotwareposts: 3329since: 23 Sep 2013

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.


TRADERS FIRST™ Vote for your favorite features: http://vote.spotware.com/
14 Jun 2016, 18:26#3
zelenij.krokodilposts: 26since: 05 Jun 2016

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.

15 Jun 2016, 14:37#4
Spotwareposts: 3329since: 23 Sep 2013

Dear Trader,

We don't support resources.

However, we recommend you to create a class with constants and use it as a "resource".


TRADERS FIRST™ Vote for your favorite features: http://vote.spotware.com/