Answered by:
Extension Host failed to load extension DLL

Question
-
Hi Everyone,
I am new to NPS. I am using Windows Server 2008 R2. I have developed an Authentication Extension DLL which is basically a MFC Extension DLL for custom authentication in NPS. (http://msdn.microsoft.com/en-us/library/windows/desktop/bb892024(v=vs.85).aspx)
Now, to apply this Extension DLL at NPS I have used following steps:-
- I have put that DLL in %System Root%\System32\radius.dll folder.
- I have create HKLM\System\CurrentControlSet\Services\AuthSrv\Parameters\ registry key and set path of DLL as described here http://msdn.microsoft.com/en-us/library/windows/desktop/bb892024(v=vs.85).aspx
Now, when I am restarting NPS server I am getting following error:-
"Extension Host is failed to load DLL.Path %System Root%\System32\radius.dll".
- Edited by Deepak153096 Tuesday, March 5, 2013 9:26 AM
Monday, March 4, 2013 11:35 AM
Answers
-
Hi Deepak,
Thanks for your reply.
The registry setting seems to be correct.
However, consider that the error code 0x7e indicates that the specified module could not be found. I suspect that certain required modules may be missing from your DLL.
I am not familiar with development. However, have you checked that “NPS Extension DLLs must export at least one of the following callback functions: RadiusExtensionProcess,RadiusExtensionProcessEx, or RadiusExtensionProcess2.” in Invoking the Extension DLLs (Windows)?
In addition, Dependency Walker can find out module dependencies which might help to troubleshoot the issue.
Hope this helps.
Jeremy Wu
TechNet Community SupportWednesday, March 6, 2013 2:08 PM
All replies
-
Hi Deepak153096,
Based on my research, the error code 0x7e may indicate that the specified module could not be found by Windows.
If so, would you please double check the registry setting. Also, you can export the whole registry key “AuthSrv” for us to check.
More reference:
[TechNet Thread] IAS extension dll for using sql server as radius authentication
Hope this helps.
Jeremy Wu
TechNet Community Support- Edited by Jeremy_Wu Tuesday, March 5, 2013 9:04 AM
Tuesday, March 5, 2013 9:02 AM -
Hi Jeremy_Wu
Thanks For Reply..!!
I have updated my post with my current registry setting for "AuthSrv". Please check it.
Regards
Deepak
Tuesday, March 5, 2013 9:22 AM -
Hi Deepak,
Thanks for your reply.
The registry setting seems to be correct.
However, consider that the error code 0x7e indicates that the specified module could not be found. I suspect that certain required modules may be missing from your DLL.
I am not familiar with development. However, have you checked that “NPS Extension DLLs must export at least one of the following callback functions: RadiusExtensionProcess,RadiusExtensionProcessEx, or RadiusExtensionProcess2.” in Invoking the Extension DLLs (Windows)?
In addition, Dependency Walker can find out module dependencies which might help to troubleshoot the issue.
Hope this helps.
Jeremy Wu
TechNet Community SupportWednesday, March 6, 2013 2:08 PM -
Did anything ever come of this?
I'm having the *exact* same issues and I'm driving myself insane trying to find an answer to this. I've tried both a 32bit and 64bit DLL. Compiles fine. Exports the required functions. NPS refuses to load it.
newp
Thursday, October 27, 2016 5:33 PM -
I'm not sure what you mean by this. I'm following the instructions as documented at:
https://msdn.microsoft.com/en-us/library/bb892024(VS.85).aspx
With a 32bit DLL, I receive error 0xc1
With a 64bit DLL, 0x7e
I can't seem to get more troubleshooting information than this. I've checked both DLLs with "DLL Export Viewer" and both absolutely export "RadiusExtensionProcess2".
newp
Thursday, October 27, 2016 6:12 PM -
Jeremy's recommendation to check out the Dependency Walker was key here for me. After successfully compiling my NPS extension DLL, I really struggled to get NPS to load it. It would simply respond with a 0x7E error. This was initially interpreted as NPS somehow not being able to properly locate the DLL I was trying to load (Is it in a PATH variable location? Did I screw up the NPS Extension registry keys somehow?), but in reality, actually meant that a dependency /within/ the DLL wasn't able to be located.
Running Dependency Walker *on the target NPS server* and pointing it at the extension DLL will indicate which dependency the server isn't able to source. In my particular case it was MSVCR120.DLL, and will likely vary depending on whether you are compiling a Release or Debug build of your DLL and what version of the Build Tools was used to compile it (version 120 in my case). A quick google for the missing DLL will usually point you in the direction of a Visual C++ Redistributable package you can install on the server to meet the dependency.
I hope this information helps someone else. I sure wish I could have found it about 3 days ago myself.
Cheers!
newp
Friday, October 28, 2016 12:41 PM -
Hi,
I have had the same problem, but that was coming from the Build.
It's important to only copy the Realase of your dll, the dll compiled in debug will not work.
In my case with the dll compiled in "Debug" the NPS wanted to start. But with the same code compiled in "Relase"works perfectly.
Sunday, July 28, 2019 9:58 PM -
Is there any way we can debug the RadiusExtension dll ?
I have tried attaching it to IASHOST.exe but compiler is unable to load all the depencies related to it, may be that is not the correct process it needs to be attached.
Although on restarting the NPS Service i am able to see a dllhost.exe which might be responsible for my exentsion dll. I have tried attaching to the dllhost as well but the problem is not solved.
Any thoughts / help ?
Tuesday, July 21, 2020 2:09 PM