How can mod_mono be configured to run .NET 4.5 - c#

I've been searching for days now, but still have not been able to find a way to get mod_mono to run .NET 4.5 web applications.
I've tried this and many other with no luck: Can XSP run ASP.NET 4.5?
Currently, I have a functioning Ubuntu 14.04 Server running mono 3.6.1 that is able to server .Net 4 applications:
Does anyone know how to configure mod_mono to run .NET 4.5?
My test site is a simple page with the following code, http://54.208.241.43/test.aspx.
<%=System.Environment.Version%>

sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/tpokorra:/mono/xUbuntu_14.04/ /' >> /etc/apt/sources.list.d/mono-opt.list"
sudo apt-get update
sudo apt-get install mod_mono-opt
See these for more details
http://www.pokorra.de/2013/12/

Related

How to install .NET Core on aarch64 architecture Debian

I'm new to Linux and want to code some C# on Linux for school. The problem is I don't know how to install C#. I already read the instructions from Microsoft, but I couldn't get it to work.
'arm64' is the Debian port name for the 64-bit Armv8 architecture, referred to as 'aarch64' in upstream toolchains. The snapd daemon and tooling that enables snap packages is available for arm64 architecture in Debian.
To install snapd:
sudo apt update
sudo apt install snapd
Either log out and back in again or restart your system to ensure that snap's paths are updated correctly. After this install the core snap in order to get the latest snapd:
sudo snap install core
C# is open source and cross platform now that Microsoft has released a version of .NET Core. To install .NET Core in Debian open the terminal and type:
sudo snap install dotnet-sdk --classic
sudo snap alias dotnet-sdk.dotnet dotnet # to run dotnet-sdk type dotnet
The instructions from Microsoft seem to assume that you are running Visual Studio Code on Windows, so they frequently don't work at all on Linux. The following instructions were tested on a Debian-based system (Ubuntu 20.04). I ran a few C# console apps for test purposes, but let's start with a simple one-line C# console app. Run these commands to build and run an example C# Hello World console app from the terminal:
cd ~
mkdir C#_Projects
cd C#_Projects
mkdir HelloWorld
cd HelloWorld
dotnet new console
dotnet build --output ./build_output
dotnet ./build_output/HelloWorld.dll
Results of dotnet ./build_output/HelloWorld.dll
Hello, World!

Adding an assembly reference in Visual Studio Code

I'm just working on a web project in VS code. I'm used to using the full blown IDE, but I'm developing for Linux, so I'm trying to see if I can accomplish the same things in VS code.
Basically it's gotten to a point where I need to add System.Web so I can use stuff from there, but I'm struggling to find how to do it. Usually I'd just right click the solution and go Add assembly reference, and all the .NET assemblies would be there.
I've found this answer, and I've added "System.Web.Http.Common": "4.0.20126.16343" to my project.json file. I can't find the dnu restore command though. I've read that it's deprecated, but can't find solid info on how to either install it or use its replacement if so. Is anyone able to help me?
EDIT: Sorry, I should mention I'm using Mono.
dnu-restore is now dotnet-restore. You can find the help here
And if you're still using the rc1.0 version the details on dnu-restore is https://github.com/aspnet/Home/wiki/DNX-Utility.
If you are on Windows right now:
In case .net core is not installed in your machine follow the guidelines here
To have the CLI's anyway, you'd need .net core SDK which can be found here
Open VS2015 Developer command prompt or your command prompt in administrator mode (preferably)
To create a new app: dotnet new
To run an existing app: dotnet restore and then dotnet run
If you are on an Ubuntu right now:
To add the package source for Ubuntu 14.04:
sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
sudo apt-get update
And for Ubuntu 16.04:
sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
sudo apt-get update
Then you can install it using:
sudo apt-get install dotnet-dev-1.0.0-preview2-003121
The new .NET Core SDK restore command is dotnet restore
To install the latest .NET Core SDK (Preview 2 version) and add any asssembly reference in Visual Studio Code, please refer to my post at How to add System.Data and System.Timers assembly references in Visual Studio Code 1.8?

Unreal Engine 4 Setup problems

I am trying to run the Unreal Engine-4 setup on Ubuntu 14.04 but when running the command
sudo apt-get install build-essential mono-gmcs mono-xbuild mono-dmcs libmono-corlib4.0-cil libmono-system-data-datasetextensions4.0-cil libmono-system-web-extensions4.0-cil libmono-system-management4.0-cil libmono-system-xml-linq4.0-cil cmake dos2unix clang-3.5 libfreetype6-dev libgtk-3-dev libmono-microsoft-build-tasks-v4.0-4.0-cil xdg-user-dirs
I am running into an error saying
The following packages have unmet dependencies:
mono-gmcs : Depends: mono-mcs (= 3.12.1-0xamarin1) but 4.0.2.5-0xamarin1 is to be installed
E: Unable to correct problems, you have held broken packages.
Any clues on how to proceed?
but 4.0.2.5-0xamarin1 is to be installed
It appears you are using Mono 3.x install instructions for Unreal Engine-4's setup.
In Mono 4.x, the gmcs compiler (a shell script to docs/mcs) has been dropped as support for only 4.x+ frameworks are supplied by the default installer.
Remove the "mono-gmcs" from your apt-get install list, and try again. I am not sure if anything is in Unreal 4 is dependent on a Mono 3.x install or if Mono 4.x will work...
You can alway pin your Mono version to 3.12.1. Remove:
deb http://download.mono-project.com/repo/debian wheezy main
from "/etc/apt/sources.list.d/mono-xamarin.list" and add:
deb http://download.mono-project.com/repo/debian wheezy/snapshots/3.12.0 main"
deb http://download.mono-project.com/repo/debian wheezy-libtiff-compat main"
Then you can:
sudo apt-get update
After that, try your Unreal Engine-4 setup routine again and the Mono version will match the setup steps on Unreal's web site.

Windows Phone 8.1 App is not building on TravisCI server

I'm trying to get TravisCI to build my Windows Phone 8.1 App C# project (Hosted on Github)
I'm getting this error :
/home/travis/build/wassim-azirar/GitterClient/GitterClient/GitterClient.csproj
warning : Could not find project file
/usr/lib/mono/xbuild/Microsoft/WindowsXaml/v12.0/Microsoft.Windows.UI.Xaml.CSharp.targets
to import. Ignoring.
Full details about the build errors are here
My .travis.yml
language: csharp
solution: GitterClient.sln
env:
global:
- EnableNuGetPackageRestore=true
sudo: true
before_install:
- sudo apt-get update -qq
- sudo apt-get install -y gtk-sharp2
- sudo apt-get install -qq mono-devel > /dev/null
- mozroots --import --sync
- export EnableNuGetPackageRestore=true
script:
- xbuild /p:Configuration=Release GitterClient.sln
I'm getting this error because I'm using the Behaviours SDK (XAML) which does not exist in the build server.
I followed this tutorial (How to use Extension SDKs without installing them in Visual Studio). And now my project is building in AppVeyor but not in TravisCI.
I also tried to play with the .travis.yml and modified it many times (see file history) but all my attemps failed and I couldn't make the project build with TravisCI :(
Is there something else I can do to correct this problem ?
joshua-anderson : at the moment, Travis CI uses the mono on linux, not the official microsoft .net CLR, which is windows only. Windows apps can only be built on windows with the official .net CLR. Sorry!

How to run .NET 4.5 on XSP using Mono?

I have installed Mono 3 however when I run xsp or xsp4 it shows that I'm using .NET 4.0. I need to have .NET 4.5. Is it possible? Where can I configure it?
I've seen this page but I don't have any of those folders where I downloaded sources.
This is what it shows when I enter website by running xsp4:
Version Information: 3.2.7 (master/1eef047 C nov 28 18:16:30 EET 2013); ASP.NET Version: 4.0.30319.17020
How I installed Mono and XSP
Firstly I downloaded Lubuntu 13.10 32bit and launched it inside VirtualBox. Then did apt-get update and apt-get upgrade. After that rebooted the system.
Make sure all commands are executed as super user.
sudo -s
Got dependencies
apt-get install autoconf automake libtool g++ gettext libglib2.0-dev libpng12-dev libfontconfig1-dev mono-gmcs git
Downloaded sources of Mono and XSP
cd /opt
git clone git://github.com/mono/mono.git
git clone git://github.com/mono/xsp.git
Installed latest stable Mono from github
cd /opt/mono
./autogen.sh --prefix=/usr
make
make install
Installed latest stable XSP from github
cd /opt/xsp
./autogen.sh --prefix=/usr
make
make install
Tested that I have 4.0 running on XSP instead of 4.5
cd /home/pc/web
xsp4 # 4.0
xsp2 # 2.0
xsp # 2.0
My configuration
/usr/bin/xsp4 looks like it should use 4.5. Just like this answer suggested. Also, I don't have xsp4.exe in my /usr/lib/mono/4.0/ only in /usr/lib/mono/4.5/ so I cannot copy anything like suggested in that answer.
#!/bin/sh
exec /usr/bin/mono $MONO_OPTIONS "/usr/lib/mono/4.5/xsp4.exe" "$#"
You say "I don't have any of those folders where I downloaded sources" referring to /opt/mono/bin/xsp4. But you're confusing things, and I know it because you shared how you installed mono.
/opt/mono should not be the place where you clone the mono repository to compile it. You should clone it somewhere else like your home folder. I.e.: /home/username/code/mono.
/opt/mono is where usually people install a custom version of mono. The way they do it is passing this path to the --prefix argument. But you're passing /usr as the prefix argument! So then you're installing it to a different location compared to the SO answer that you point out.
Also, it is not recommended that you do ALL those operations as a superuser. You normally compile code without root privileges, and you only need sudo for the install phase. So don't do "sudo -s" before everything. Just compile, and when you're done, do sudo make install. This will also make you have binaries that are not owned by root.

Categories

Resources