Can I run a C# application on a Raspberry Pi? - c#

I'm working on a project that means that I will need a Raspberry Pi; however, I have very limited programming experience in Python or Lua.
Is it possible to run a program compiled in VS2013 using C# on a Raspberry Pi?

You can use VS2019 to compile your C# application to .NET Core 3.1.
Once your application is compiled open the directory with the .csproj file in command promt. type in dotnet publish -c release -r linux-arm in command promt. put the compiled files onto the pi then open a terminal window on the py and type chmod u+x <YourProjectName> then ./<YourProjectName> Enjoy!

You can run Mono on your Pi, then develop in C# if you want.
http://www.raspberry-sharp.org/eric-bezine/2012/10/mono-framework/installing-mono-raspberry-pi/

Yes, although you have to use the mono framework to basically emulate .net, it works for most method calls but not all.
Have a look at
http://logicalgenetics.com/raspberry-pi-and-mono-hello-world/

You can install Windows 10 IoT: https://learn.microsoft.com/en-us/windows/iot-core/tutorials/rpi
Or supported Linux and last version of .NET or .NET Core
https://www.raspberrypi.com/software/operating-systems/

If you install the mono framework and follow their guidelines there's no reason your application won't run (obviously within the limits of the framework and hardware). There are quite a few resources on it. I've seen it done in a demo without too many problems.
Writing on the pi would be harder!

Related

Is it possible to publish an unpackaged Windows App SDK (WinUI 3) as self contained single file?

I'm pretty sure I have all the right flags and everything set according to Microsoft Docs, however the UI dlls are not being included in the single file exe.
AFAIK, you can't. Self-Contained does not mean One-Single-File. It means that all the dependencies will be next to your EXE so you won't need to install runtimes to the target device.
Try using https://github.com/Fody/Costura/
It's great for legacy .NET projects. Newer frameworks have single-file executables as shown in their documentation
Yes - with this (unpackaged / self-contained) command line:
dotnet publish -f net6.0-windows10.0.19041.0 -c Release -p:WindowsPackageType=None -p:SelfContained=true -p:WindowsAppSDKSelfContained=true
Note: This requires Windows App SDK 1.1.0 or above.

Run ASP.NET application on Linux

I am trying to run an application made in .NET Framework 4.5 (Windows) in a Linux environment (Centos7).
I have tried with mono and xsp4 but I have the following doubts:
Mono and xsp4 are the best applications to execute a code in .Net?
Should I compile the * .cs first in linux?
Can I run the publish folder generated in windows directly in Linux
(if so)?
I can run an application made in .net in asp.net
regards
Applications written for the standard .NET framework will not run in Linux; you can try to run them in Mono but it has a number of restrictions in terms of what it supports. If you want to guarantee support it would probably be better to compile your app with Monodevelop so it will compile against that runtime. It is also the "old" way of doing this.
What you should be doing is targeting .NET Core; which is designed to run on other operating systems (including a number of Linux distributions). When you do that you would add a runtime identifier for your distro and publish to it; generating binaries that will run with the dotnet command on that platform.
Note that when using .NET Core in production you need to set up a reverse proxy to a "production ready" webserver like IIS, Apache, or Nginx as those are hardened against attacks the Kestrel server still is not.

VSCode: enable .Net Core Debugger in portable IDE

In these days I'm trying these projects:
- Visual Studio Code: I chosethe portable (.zip) executed from USB memory.
- .Net Core (.zip package again), which I decomprissed into the same USB memory as the previous one.
When I try to generate a new C# into VSCode project, first I had the problem around how to invoke the .Net core folder (aka dotnet decomprissed folder). Until now, just I had to put in the console the absolute path location of the dotnet executable -again, from the folder I decomprissed from the zip file-.
But then I try to debug the console application after these commands:
dotnet new
dotnet restore
dotnet build
I see the following error:
The .NET Core Debugger is still being downloaded. See the C# Output Window
for more information.
[ERROR]: C# Extension failed to install the debugger package
How can I solve this?
Just saw this error on my PC too, turns out as of now the C# debugger doesn't support 32-bit Windows system, there is an issue on GitHub: https://github.com/OmniSharp/omnisharp-vscode/issues/844.
Check if you are using a 32-bit Windows, if yes, upgrade to x64.

Can I use MONO to create a program that runs without the .NET framework being installed?

I need to write something for a Windows XP embedded computer, which does not have .NET installed.
I already have written the program in .NET, so I'm wondering if there's a way to make it run without .NET?
Perhaps using MONO to create some all-in-one .exe?
Thanks for any thoughts / ideas!
Take a look at mkbundle from Mono:
The resulting executable is self contained and does not need the Mono
runtime installed to run.
When running managed code - .NET/Mono assemblies, a framework is required to be installed. Depending on your dependencies, you may be able to run under mono without modification. Mono is compatible with Windows XP. Parts of .NET are not compatible with Mono such as WPF.
Firstly make it run without .NET is an error concept. .net program must run at .net Environment. You can say without .netframework.
If you want to use .netframework, may these can help you:
http://blogs.msdn.com/b/embedded/archive/2007/03/23/deploying-net-framework-3-0-desktop-distribution-package-on-windows-xp-embedded-sp2-runtime.aspx
http://social.msdn.microsoft.com/Forums/en-US/93e39489-2c61-439d-aa3f-865195fb79d7/net-framework-35-on-windows-xp-embedded?forum=embeddedwindowscomponents
Or you can setup monoruntime on this os

Run .NET exe in linux

Is there any way to run the .NET exe (of a winform app) in Linux without building the code in linux? In fact I don't have the code for some of the utilities I developed earlier and would like to run them in linux.
Related to : Feasibility of C# development with Mono
Mono ! http://mono-project.com/Main_Page
Works great too. There's a growing tool support, C# compiler etc
in a growing community.
You can test it by using the Mono Migration Analyzer or by actually testing it using the Mono command prompt...covered in this article
Wine + .NET

Categories