Hello!
I have a program in C#, running on Visual Studio 2019, with target framework netcoreapp3.1.
I used Open Modelica v1.22.3 (64-bit).
My code:
using System;
using System.Collections.Generic;
using System.Text;
namespace TesteFMU
{
public class Program
{
public static void Main(string[] args)
{
TestFMU test = new TestFMU();
test.Calculation();
Console.Write("Calculation concluded.");
}
}
using System;
using Femyou;
using System.IO;
namespace TestFMU
{
public class TestFMU
{
public void Calculation()
{
string fmuFolder = File.ReadAllText(@"C:\FMUTests\");
using var model = Model.Load(Path.Combine(fmuFolder, "TestFemyou.fmu"));
using var instance = Tools.CreateInstance(model, "test");
var x = model.Variables["x"];
var y = model.Variables["y"];
var z = model.Variables["z"];
Console.WriteLine("x = " + Convert.ToString(x));
}
}
}
However, when I try to load the FMU, it shows this error:
System.IO.FileNotFoundException: 'Could not find or load the native library: C:\Users\10376\AppData\Local\Temp\Femyou\TestarFemyou.fmu\binaries\win64\TestarFemyou.dll
I don't understand why it tries to load a native library and why it fails despite the DLL being available when I manually check the folder.
Could it be a compatibility issue?
The example BouncingBall.fmu works just fine.
Thank you!
Hello!
I have a program in C#, running on Visual Studio 2019, with target framework netcoreapp3.1.
I used Open Modelica v1.22.3 (64-bit).
My code:
However, when I try to load the FMU, it shows this error:
I don't understand why it tries to load a native library and why it fails despite the DLL being available when I manually check the folder.
Could it be a compatibility issue?
The example BouncingBall.fmu works just fine.
Thank you!