Share via

Why does WiFiAdapter.ConnectAsync method return an UnspecifiedFailure when called from a IIS hosted web app?

SimplyCrazyDev 1 Reputation point
2022-06-02T00:15:48.987+00:00

Why does WiFiAdapter.ConnectAsync method return an UnspecifiedFailure when called from a IIS hosted web app? When this app is launched from Visual Studio with IIS Express the method successfully connects to the same WiFi netwrok that fails with IIS. It works fine when called inside a console app as well. What am I doing wrong?

Windows development | Internet Information Services
0 comments No comments

1 answer

Sort by: Most helpful
  1. Bruce Zhang-MSFT 3,776 Reputation points
    2022-06-02T01:50:45.32+00:00

    Hi @SimplyCrazyDev ,

    What's your application pool identity? Consider that differences between IIS and IIS express, I think the issue may be caused by permission. IIS express has high privileges to run programs, just like an administrator. But the default identity in IIS is application pool identity. This is a virtual identity created after application deployment, with very low permissions.
    So I think you can try to change identity of app pool to local system or administrator, check if it still reports error.

    Was this answer helpful?

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.