Running app (with Hastlayer) using dotnet run fails with a dependency exception #109
-
Good evening, I was tinkering around Hastlayer, or to be more precise I tried to implement a simple all-pairs shortest path algorithm (here is a source code) and I have faced an issue running the application using dotnet run (I wanted to test software implementation to ensure the algorithm is working find). The code fails with the following exception:
I have tried to Google and look through the source code but I had no clue to the source of the issue. The exception is thrown on the line I would appreciate any help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Hmm. This exception tells that some injectable dependencies can't be found (duh), which shouldn't be the case when at least the I would run your code to check this out in more detail, but I have a hard time figuring out the command line parameters. Could you please add a launchSettings.json file that provides everything to be able to run the app with F5 for this test? |
Beta Was this translation helpful? Give feedback.
The problem is not IDE-specific, I can reproduce it in command line as well:
It's related to the current working directory, because Hastlayer expects it to be the executable's location. It's expected for eagerly loading the Hast.*.dll files, but also other build related lookups like the HardwareFramework directory that contains the VHDL framework (Hast_IP). This is not an issue in Visual Studio or Rider because the default working directory is already where the executable is created. I'm not sure why VS code doesn't work like that out of the box.
I will push some improvements to make the build more robust soon, but in the meantime you can fix it by adding
/Debug/net7.0
to thecwd
propert…