Rider/Azure: hostpolicy.dll not found

When running/debugging an Azure Functions project locally, I get the error: 

C:\Users\wsieburgh\AppData\Local\JetBrains\Toolbox\apps\Rider\ch-0\202.7660.16\plugins\dpa\DotFiles\JetBrains.DPA.Runner.exe --handle=5724 --backend-pid=1504 --detach-event-name=dpa.detach.5724 "C:\Program Files\dotnet\dotnet.exe" Y:/RiderProjects/invoicesintegration/source/Functions/bin/Debug/netcoreapp3.1/bin/Invoicing.Functions.dll A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'Y:\RiderProjects\invoicesintegration\source\Functions\bin\Debug\netcoreapp3.1\bin\ '.

 

This was when running Rider on a Windows 10 machine.

On that same machine, the same project runs find in Visual Studio.

 

 

6 comments
Comment actions Permalink

Hello Wouter,

Does it work if you try to run it with dotnet run or somehow else outside of Rider? Similar issue was discussed in the following thread, and seems to be related to entry point issue. 

0
Comment actions Permalink

Was this ever solved? I have the same issue and I cannot find anything online. My Azure function App runs ok in Visual Studio but gets this error when I use rider. 

 

0
Comment actions Permalink

I have the same issue and can't figure out how to resolve it.

On Visual Studio it works fine even though I do not have the runtimeconfig.json file. In dotnet cli it runs also. This is the error in Rider:

The library 'hostpolicy.dll' required to execute the application was not found in '{path}\bin\Debug\net6.0\'.
Failed to run as a self-contained app.
  - The application was run as a self-contained app because '{path}\{projectName}Function.runtimeconfig.json' was not found.
  - If this should be a framework-dependent app, add the runtimeconfig.json file and specify the appropriate framework.

0
Comment actions Permalink

I tried to reproduce it with template projects, but have not faced such an issue. Would it be possible to share a sample project using which I could try again? You can send it with a new issue on our tracker. Thank you in advance!

0
Comment actions Permalink

I had the same issue because Rider was configured to launch the project using ".Net Launch Settings Profile", when I switched it to "Azure Function host" the project started properly.

1
Comment actions Permalink

I also get this issue, it's fine with some projects, but not for other. I ended up upgrading Rider to the latest version. the problem is gone. Not sure if something wrong in old Rider version is cleared or the new version fixed the issue.

0

Please sign in to leave a comment.