Highly Type object to Util.Compile error
I'm having an issue passing in a highly type object to another script with the following code. I have extracted out my real logic into a test script that replicates the error.
In my parent script I have the following code
in the SubTestQuery script I have the following code
but I get the following error
System.Runtime.Serialization.SerializationException
Unable to find assembly 'query_fewoae, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
but if I place the TestObject class into my extensions I am able to run the parent script just fine. Is it possible to not have this class extension? I wish to pass around my scripts and it would be easier to define it in my scripts
In my parent script I have the following code
void Main() { var test = new TestObject { t1 = "asdf", t2 = 3 } ; var compiledQuery = Util.Compile(@".\SubTestQuery.linq", false); var retVal = compiledQuery.Run(QueryResultFormat.Html, test); retVal.AsString(); } [Serializable] public class TestObject { public string t1 { get; set; } public int t2 { get; set; } }
in the SubTestQuery script I have the following code
async Task Main(TestObject input) { "In sub query".Dump(); await doSomething(); } async Task<int> doSomething() { return 1; } // Define other methods and classes here [Serializable] public class TestObject { public string t1 { get; set; } public int t2 { get; set; } }
but I get the following error
System.Runtime.Serialization.SerializationException
Unable to find assembly 'query_fewoae, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
but if I place the TestObject class into my extensions I am able to run the parent script just fine. Is it possible to not have this class extension? I wish to pass around my scripts and it would be easier to define it in my scripts
Comments
To tag for code, click the 'C' (code) icon on the toolbar.
I was hoping that this could work like web traffic in which you can define the client and server data model in their own system. Perhaps I will go down the assembly route.