。net标准库项目中的资源?

问题描述 投票:0回答:1

我打算在Xamarin应用中使用javascript传感器融合库-可能还会在手表项目中使用。在我的网络标准库中,我有:

enter image description here

Ahrs文件包含:

public class Ahrs
{
    static ScriptEngine engine = new ScriptEngine();
    static FileScriptSource fileScript = new FileScriptSource("./index.js"); // <-- invalid file path
    public static double Run()
    { // file notfound
        engine.Evaluate(fileScript);
        return engine.CallGlobalFunction<double>("update", 0, 0, 0, 1, 1, 1);
    }
}

...我尝试在update文件中使用js调用方法Jurassic的位置>

有什么方法可以将index.js文件添加到我的网络标准库中,然后从Ahrs文件中的所有文件中运行它?

我打算在Xamarin应用中使用javascript传感器融合库-可能还会在手表项目中使用。在我的网络标准库中,我具有:Ahrs文件包含:公共类Ahrs {...

xamarin .net-standard
1个回答
0
投票

[如果我使用路径"index.js"而不是"./index.js",似乎对我有用

public class Ahrs
{
    static ScriptEngine engine = new ScriptEngine();
    static FileScriptSource fileScript = new FileScriptSource("index.js"); // <-- invalid file path
    public static double Run()
    { // file notfound
        engine.Evaluate(fileScript);
        return engine.CallGlobalFunction<double>("update", 0, 0, 0, 1, 1, 1);
    }
}  
© www.soinside.com 2019 - 2024. All rights reserved.