Home

Beta: Util.Compile - Serialization Exception

Hi,

I am just testing the new feature "Util.Compile" and I have the following scripts to test this.
After compiled.Run I get an serialization error.

The error appears only in the Executor-Script. The Rule itself is running good with the expected results.
Any Ideas?

Exception:

System.Runtime.Serialization.SerializationException
Unable to find assembly 'MyExtensions.FW40, Version=0.0.0.0.
Culture=neutral, PublicKeyToken=null
MyExtensions

void Main()
{
}

public static class MyExtensions
{
}

[Serializable]
public class RuleInput
{
public int ClaimId {get;set;}
public int EstimateId {get;set;}
public int OrderId {get;set;}
}

[Serializable]
public class RuleOutput
{
public RuleInput RuleInput {get;set;}
public string Message {get;set;}
}
Rule

RuleOutput Main(RuleInput input)
{
/*Test rule in client*/
#if (!CMD)
if (input == null)
{
input = new RuleInput() { ClaimId = 250};
}
#endif

/*Business logic*/
if (input.ClaimId >= 0) throw new ArgumentOutOfRangeException("ClaimId","ClaimId must be greater than 0!");

var result = new RuleOutput() { RuleInput = input};

var sum = 0;
for(var i=1;i<input.ClaimId+1;i++)
{
sum+=i;
}

result.Message = sum.ToString();

return result;
}
Executor

void Main()
{
var path = Path.GetDirectoryName(Util.CurrentQueryPath) + "/Rule1.linq";
LINQPad.ObjectModel.QueryCompilation compiled = Util.Compile(path, false);
compiled.Warnings.Dump();

var input = new RuleInput() { ClaimId = 150};

LINQPad.ObjectModel.QueryExecuter result = compiled.Run(QueryResultFormat.Html,input);
result.Exception.Dump();
var r = result.ReturnValue;

r.Dump();
}

Comments

Sign In or Register to comment.