Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora

0

125
Vistas
Wifi Adapter in Blazor wasm : System.DllNotFoundException: api-ms-win-core-winrt-string-l1-1-0.dll

I've been trying to retrieve list of availables networks by using WifiAdapter. I have a working solution that I've been testing in a console application :

        List<WiFiAvailableNetwork> networks = new();
        IEnumerable<WiFiAdapter> adapters = await WiFiAdapter.FindAllAdaptersAsync();
        foreach (WiFiAdapter adapter in adapters)
        {
            foreach (WiFiAvailableNetwork network in adapter.NetworkReport.AvailableNetworks)
            {
                networks.Add(network);
            }
        }
        return networks;

But once this solution is set in my blazor wasm project, it's crashing with this exception : System.TypeInitializationException: The type initializer for 'Windows.Devices.WiFi.WiFiAdapter' threw an exception. d.printErr @ blazor.webassembly.js:1 blazor.webassembly.js:1 ---> System.DllNotFoundException: api-ms-win-core-winrt-string-l1-1-0.dll

I have been looking for an answer but I did not find any relevant solutions. Any ideas on how to solve it/ why it is happening?

Thanks in advance !

8 months ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Not all parts of the .net platform are supported on all environments.

Blazor WebAssembly will not run anything from Windows.* .

When you want access to some device you will have to research if and how JavaScript can use it.

8 months ago · Santiago Trujillo Denunciar

0

You can use an experimental API from browser, calling it via JSRuntime in Blazor WASM.

Look here: https://developer.mozilla.org/en-US/docs/Web/API/Network_Information_API

8 months ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos