I created a UWP-application which starts an external application over its EXE-File using the FullTrustedLauncher.
It works fine when I start the UWP-App on the computer (local) but the problem occurs when I start the UWP-app on a Raspberry Pi.
The EXE-File can't be run with following Error: "Class not referenced"
By the way the EXE-File I want to run is an ASP.NET Core application.
Am I missing some .dll-files or what should I do to start an EXE on a Raspberry Pi? Are there better alternatives than using the FullTrustedLauncher for UWP-applications?
Thanks for your help :)
You should be able to use ProcessLauncher API in Windows IOT. Here is a sample and documentation: https://github.com/Microsoft/Windows-iotcore-samples/blob/master/Samples/ExternalProcessLauncher/CS/README.md
FullTrustProcessLauncher is a Desktop Extensions SDK API, as called out in the documentation. It is only supported (and present) on the desktop device family, not on iot or any other SKU of Windows.
Related
I neeed to run a windows form application on Raspberry Pi made using C#.
I have tried the option of installing a windows os and running the exe application . It does work but the issue is that it is slow and takes a lot of time for the application to work.
Is there any possibility to run the exe directly on raspbian ?
You can't natively run winform applications under Linux, but maybe you could try using Wine or one of the other compatibility tools for Linux.
If you are the author of the application you could port your app to GTK# which is a desktop GUI Toolkit for Linux with C#
What I'm using right now:
You can execute Windows Forms Applications written in the .NET Framework (newest 4.8, no longer continued) with mono.
On the raspberry pi, if I recall correctly, you can "sudo apt install mono-complete" and then run it via the terminal: "mono YourApp.exe"
As I said, it sadly only works with .NET Framework Applications (or maybe on rare occasions with .NET 6.0 too, hasn't worked for mine though), you may be able to change that in Visual Studio though (or new project and then copy/paste the code).
The only downside is that you are then using an older version of C#, meaning some things may be different from what you are used to.
I am new to windows iot core, Actually I am running it with a raspberry Pi3
What I want to do is to create a .dll from an app based on windows iot core and integrate it in an other solution (WPF plateform) and whenever I call the .dll methods I get datas from my solution to my raspberry pi and vice versa
Actually I am confused about it there's not enough documentation about this and I don't know if this is possible or not if yes I would be very thankfull if you provide me some links
I assume your WPF application running on Windows 10 device.
To use UWP API in WPF application you need Package your WPF applications (Desktop Bridge).
When you create a package for your desktop application, your
application will get an identity and with that identity, your desktop
application has access to Windows Universal Platform (UWP) APIs.
Package a desktop application by using Visual Studio
Using a UWP C++ dll in Win32 C# WPF application
If your WPF application running on lower version than Windows 10 you can't use above solution.
In this case you need implement network send and receive logic respectively for WPF and UWP. Establish, for example, socket connection between them.
Is there API that lists and allows us to connect to a specific wifi network by providing passcode via C# on Windows IoT Core?
I see that it is possible to do it when you are running an OS on the PI other than Windows IoT here via command line.
Another question was asked on creating an app to run on WinRT here, but only listing connected WIFI networks was possible. I am not sure if Windows IoT has more functionality exposed?
UPDATE #1:
I found Managed Wifi API which allows you to control Wifi (802.11) network adapters installed in your Windows machine programmatically.
Another possible solution is SimpleWifi
I will give those a try to see if I can do the same on a Raspberry Pi 2 B, then will update my question. However, if anyone can suggest better methods please do.
UPDATE #2:
I am now recieving the following error when I try to install NuGet package SimpleWifi on a Visual C# Universal Windows app:
SimpleWifi 1.0.0.0 is not compatible with UAP,Version=v10.0 (win10-arm)
I also recieve a similar error when installing NuGet package for ManagedWifi:
Some packages are not compatible with UAP,Version=v10.0 (win10-x64-aot).
When Windows IoT boots, it start with default IoT app (if you have not modified startup applications) that is IoTCoreDefaultApp. Default application allows you to view and connect to WiFi. Microsoft has provided source code for default app. Specific to WiFi related code, I found it in this file: IoTCoreDefaultApp \ IoTCoreDefaultApp \ Views \ OOBENetwork.xaml.cs
Download: Windows IoT Samples
.
Update: February 7, 2016 Microsoft has provided tutorial
on how to list WiFi network and how you can connect to one.
"Windows.Devices.WiFi.WiFiAdapter" provide members to
manipulate WiFi in UWP programmatically. Refer WiFi Connect
Sample.
I'm trying to make application that would take a picture using web-camera on Raspberry PI running Windows IoT. The problem is that I can't find console app template.Universal Windows blank app template provides me with GUI but I'm going to call this app from python script so it should be without one.
Windows IoT projects provide background task template but the output is .winmd file and I cant execute it from python neither.
What is the way to create simple console app in Windows IoT using c#?
Thanks
Console applications are supported in Windows IoT but apparently in C++ only. Perhaps you could try to create a solution that has a very simple C++ console application that just handles interaction with the user plus a C# class library with all the logic and hardware related code.
Seems to works with a standard c# console apps. How I found out?
I used Reflector and examined all exe files in c:\windows\system32 on the Pi, and one was a .NET assembly: netcmd.exe
When I look at netcmd.exe in Reflector, it says it's build with standard .NET 4.5, this can't be right? But I made a standard c# console app with framework 4.5, added this:
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello world");
}
}
put the test.exe on the Pi, and voila:
C:>test
Hello world
Weirdest thing.
I haven't tested more than this, but I imagine You get into trouble with unimplemented API's since only a subset of .NET (same as in Background Application (IoT)?) exist on the Pi, so you must "manually" take care not use unimplemented stuff (or code most in Background Application "mode", and in the final stage, move to standard .NET 4.5 and add the console code).
If you still wish to move forward using C#, it may be sufficient to create the application as a blank Universal Windows Platform application as 1.) The UI will not be instantiated if the RPi2 is powered on without a connected HDMI cable 2.) You may find it useful to use the included UI as a means of live-debugging your application.
If you use your Win 10 device for a single (or multiple) app that all do not need a GUI, (eg for service apps only), you can boot the device with the headless option.
This boots without the whole UI with an extra resource bonus., buts still can be accessed over the network.
display the current state of your device, use the setbootoption utility:
[192.168.0.243]: PS C:\> setbootoption.exe
To modify the state of your device to enable headless mode, use the setbootoption utility with the headless arg:
[192.168.0.243]: PS C:\> setbootoption.exe headless
[192.168.0.243]: PS C:\> shutdown /r /t 0
To modify the state of your device to enable headed mode, use the setbootoption utility with the headed arg:
[192.168.0.243]: PS C:\> setbootoption.exe headed
[192.168.0.243]: PS C:\> shutdown /r /t 0
The device will start up with a black screen.
I was able to create .NET core (3.1 in my case) console app running under Windows 10 IoT:
Create a .net core console app and publish it to a folder
Connect to the device in windows explorer (or ftp) with 10.0...\c$
Create a folder in c:\program files\dotnet
Download an arm 32 dotnet core runtime (for example https://dotnet.microsoft.com/download/dotnet-core/thank-you/runtime-aspnetcore-
3.1.2-windows-arm32-binaries) (note I've used a raspberry pi 4)
Unpack it inside the folder at point 3
Open a powershell terminal to device (https://learn.microsoft.com/en-us/powershell/scripting/getting-started/getting-started-with-windows-powershell?view=powershell-7)
In powershell add the dotnet path to path env variable:
$Env:Path += ";C:\Program Files\dotnet\"
Check dotnet is available with:
dotnet --info
Finally copy your application output (publish folder) over the device
You should be able to run:
dotnet .\myapp.dll
I'm developing mobile application for device running windowce CE. I'm trying to get my app started on windows CE emulator. On the emulator i have installed net compact framework 3.5 and compact sql. My app also installes from cab succesfully but when i try to run my app nothing happens. No error message or anything.
I have tried not deploying my app from cab but just copying files over to emulator but no use. In device it is working but i'm not always able to use the device when i need to run my app for testing.
Maybe someone has idea what to look or try.
Did you try to run it on the debugger?
It may be that the app is accessing some API or some driver that is not supported by the emulator and this prevents it from starting.
Starting in the debuger you may be able to step trough the main rountine or, at least, will have a chance to see some debug messages.
Is the Windows CE emulator running the same processor type than the real device? In contrast to Windows Mobile 6.x, Windows CE can also run on x86 instead of ArmV4i (XScale).
Did you really install the correct CF runtimes?
If you are running the stand alone device emulator there is an option to dock the emulated device and then use simply ActiveSync or WMDC. TCP/IP (viw emulated network) with emulator will no more work on Windows 7 PCs, the driver cannot be installed.
If the above does not help watch the Visual Studio Build window when you deploy a debug version of your app. VS will then deploy all necessary CAB and DLLs to the device.