raspberry-piraspberry-pi3dotnet-cliwindows-iot-core-10

Windows 10 Iot raspberry add dotnet app to apps


Hello I have a raspberry pi with Windows 10 Iot installed. I have published a dotnet core app with visual studio. I can execute this with cmd /K myapp.exe over ssh. How can I add this app to Windows Device Portal to run it from there? I found the Desktop App Converter but I cant install it... If this is not possible how can I autostart my app? I have only access over ssh.


Solution

  • It is impossible to add this app to Windows Device Portal. Windows Device Portal only lists the UWP applications which are install in the device. If you want to autostart the .net core app on Windows IoT Core, you can use schtasks to create a scheduled task. The task can run when device boots or in specified time.

    Update:

    Following command will create a task to run the app when the system boot.

    schtasks /create /tn "My App" /tr c:\publish\webapplication1.exe /sc onstart /ru SYSTEM
    

    Please note that, you need to confirm if the firewall blocks the port of your web application. You can use this command to add the firewall rule.

    netsh advfirewall firewall add rule name="WebApplication1" dir=in protocol=TCP localport=5050 action=Allow