我目前正在尝试使用自定义函数与JUST.Net。
我在一个叫做Foo.JUST.CustomFunctions
的项目中创建了这个函数:
using Newtonsoft.Json.Linq;
namespace CustomFunctions;
public class Normalizer
{
public static object TryUnquote(object value) =>
value is string quotedValue
? JToken.Parse(quotedValue)
: value;
}
我正在尝试将它注册到:
// FIXME: Use Dependency Injection!
JUSTContext context = new();
context.RegisterCustomFunction("Enpal.JUST.CustomFunctions", "CustomFunctions.Normalizer", "TryUnquote", "tryunquote");
但是系统抛出这个异常:
先。FileNotFoundException: '无法加载文件或程序集项目"C: SalesforceEventListenerService Salesforce.EventListener Foo.JUST.CustomFunctions.dll"。系统找不到指定的文件
这是完全有意义的,因为Visual Studio在构建项目时并没有把它放在那里,而是可以在"C:projectsSalesforceEventListenerServiceSalesforce.EventListenerbinDebugnet6.0-windows8.0">
我如何确保系统看起来在正确的地方?
如果有的话,我还需要做些什么来确保它在Azure DevOps CI/CD管道中也能工作?
我可以让它像这样工作:
_ = Assembly.GetAssembly(typeof(Normalizer));
JUSTContext context = new();
context.RegisterCustomFunction("Enpal.JUST.CustomFunctions", "CustomFunctions.Normalizer", "TryUnquote", "tryunquote");