You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
My best guess here would be to check the dependencies of TestarFemyou.dll and make sure that they are all included in TestarFemyou.fmu
Missing dependencies is a common case of dll loading error.
I have not used MS Windows for a long time but, if I remember correctly, a free tool such as DependenciesWalker could help : https://dependencywalker.com/
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!
The text was updated successfully, but these errors were encountered: