Raspberry Pi devices are usually used with Linux-based operating systems like Raspbian or Ubuntu. It’s cool but there are tons of Windows applications which unfortunately don’t have a port on Linux :(.

Earlier we told you about how to run Windows applications on Raspberry Pi using Wine. Today we will continue that topic and will tell you how to install the modern version of .NET Framework 4.5 on Raspberry Pi and add .NET compatibility to Wine.

.NET Framework is a software framework developed by Microsoft. It includes a large class library and provides language interoperability (each language can use code written in other languages) across several programming languages. Because of these features .NET is very widespread and a lot of Windows applications use it. Wine has a helper script called winetricks that allows you to install .NET Framework. But the .NET Framework version 4.5 installation has some tricks. Therefore we’ve prepared a step-by-step instruction.

Raspberry Pi test stand configuration

Model

Raspberry Pi 2 Model B

Raspberry Pi 3

Frequency

1000 MHz

1200 MHz

Memory

1 GB RAM

1 GB RAM

Operating System

Raspbian Jessie from May 2016

Raspbian Jessie from May 2016

Software

.NET Framework 4.5

Wine 1.8

Eltechs ExaGear Desktop for Raspberry Pi 2

.NET Framework 4.5

Wine 1.8

Eltechs ExaGear Desktop for Raspberry Pi 3

.NET Framework 4.5 installation instruction

Install ExaGear Desktop

1. Put ExaGear Desktop archive with installation packages and ExaGear Desktop license key in the same folder. Open Terminal (command line), move to this folder and unpack the archive using the following command:

$ tar -xvzpf exagear-desktop-rpi3.tar.gz

2. Install and activate ExaGear by running install-exagear.sh script:

$ sudo ./install-exagear.sh

Launch guest x86 system

3. Enter the guest x86 system using the following command:

$ exagear
Starting the shell in the guest image /opt/exagear/images/debian-8

You’re in x86 environment that can be checked by running the ‘arch’ command:

$ arch
i686

4. It is recommended to update apt-get repositories on the first launch of the guest system:

$ sudo apt-get update

Install Wine

5. Install Wine in Ternimal inside the guest system:

$ sudo apt-get install wine

Package manager will offer you to install a bunch of packages. Agree and start the installation.

Once the installation process is finished check that you have the Eltechs build of Wine installed:

$ wine --version
wine-1.8.1-eltechs

Install .NET Framework

There is a trick with .NET Framework version 4.5 installation. Please follow the instruction below and go through all the steps in the given order.

6. Install the following tools:

$ sudo apt-get install cabextract
$ wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
$ chmod +x winetricks

On Ubuntu you can install Winetricks using the ‘sudo apt-get install winetricks’ command.

7. Install .NET Framework version 4.0 using winetricks:

$ ./winetricks dotnet40

You will see the Microsoft .NET Framework setup dialog window. Now follow the prompts and start installation. Note that winetricks first installs .NET Framework version 2.0, then version 3.0 and finishes with installation of the version 4.0. Also winetricks checks and uninstalls Mono before installing Microsoft .NET Framework because Microsoft .NET Framework doesn’t work well with Mono in the same Wine environment.

Microsoft .NET Framework installation on Raspberry Pi

8. Configure Wine:

Wine can mimic different Windows versions for each application. For .NET Framework version 4.5 it is requred to set up Windows 7. To do this run winecfg tool from Terminal:

$ winecfg

Then in the “Wine configuration” window select “Windows 7” value from the drop down list of “Windows version” field on the “Applications” tab. Click on “Apply” and then “Ok” buttons.

Wine configuration to install .NET Framework 4.5 on Raspberry Pi

9. Download and install .NET Framework version 4.5 using Wine:

$ wget http://download.microsoft.com/download/b/a/4/ba4a7e71-2906-4b2d-a0e1-80cf16844f5f/dotnetfx45_full_x86_x64.exe
$ wine dotnetfx45_full_x86_x64.exe

Microsoft .Net Framework version 4.5 installation on Raspberry Pi

Follow the promts and get Microsoft .NET Framework installed on your Raspberry Pi:

Intstall .NET Framework 4.5 on Raspberry Pi

Final notes

If your application requires a particular version of Microsoft .NET Framework, earlier than version 4.5, you can install the appropriate version (dotnet40, dotnet35, dotnet30, dotnet20, or dotnet11) using just winetricks, as described in step 7 of this instruction. Also it’s worth noting that there is Mono project, an open-source implementation of the .NET Framework and you might want to use it.

Note that you can install and run plenty of compatible with Wine Windows applications on Raspberry Pi with ExaGear Desktop. Here is the Wine Application Database where you can get the information on application compatibility with Wine, as well as tips and trick on Wine configuration for a particular application.

It is worth to note that with ExaGear Desktop you can run practically any x86 app on Raspberry Pi and other ARM-based devices, such as Odroid, Banana Pi, Beagleboard, Cubox, Jetson, Cubieboard etc.

GET EXAGEAR DESKTOP NOW

The original article is .NET Framework 4.5 on Raspberry Pi