This issue occurs due to missing or misconfigured **.runtimeconfig.json or .deps.json **files, incorrect framework references in the project.
Here are some steps which may be helpful
1.Ensure Proper Runtime Configuration
Make sure your Cli.dll is accompanied by:
-
Cli.runtimeconfig.json -
Cli.deps.json
2.Use FrameworkReference Instead of PackageReference
If you're using a non-SDK-style project or manually referencing DLLs, switch to using FrameWorkReference.
3.Manually Set Runtime Path
If you're running the app manually, set the runtime path explicitly
4.Avoid --no-install-recommends
When installing the SDK, avoid stripping recommended packages