How to run .NET 4.5 on XSP using Mono? - c#

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.

Related

Can't locate SDK - VSC

My initial error, in fact, comes from Unity that when I open a script (C#) from it to Visual Studio Code, it opens the code without "auto-completing" my lines of code, which makes learning more difficult.
To solve this problem, I used several tutorials, but none helped. That's why I decided to solve another problem that always appears when I open the Microsoft App, which is "The .NET Core SDK cannot be located: A valid dotnet installation could not be found.".
I installed the dotnet 6.0.44 version on my linux (zorin os 16.2) from commands on the official website and the OS identified it. However, no matter what I do, Visual Studio does not recognize it, not even in the terminal does it find it .
command contradiction
Dotnet version
obs:
Already re-installed SDK
I've had the same error on Zorin OS and other Ubuntu based distributions,
you have to install the SDK by this command:
$ sudo apt-get update && sudo apt-get install -y dotnet-sdk-7.0
If this gives you any errors, read the documentation here.
You can view your installed SDKs by executing
$ dotnet --list-skds

How to install MSBuild on OS X and Linux?

I'm looking to install MSBuild on my Linux laptop so I can build a C# OSS project of mine. How exactly would I go about doing this? I've come across a few guides such as this which suggest installing the MSBuild NuGet package, but it doesn't seem official or actively maintained.
Is there an official package source I can install MSBuild from?
Yes, there is such a package hosted by the CoreFX team as a MyGet feed. To install, run this at a terminal:
#!/bin/sh
packageid="Microsoft.Build.Mono.Debug"
version="14.1.0.0-prerelease" # update as needed
mono path/to/nuget.exe install $packageid -Version \
$version -Source "https://www.myget.org/F/dotnet-buildtools/"
# run MSBuild
mono $packageid.$version/lib/MSBuild.exe Foo.sln
Technically this should be used only for building the .NET Core repos, but I'll take it as an alternative to an unofficial publisher.
Source.
EDIT: Note that this will only work if your version of Mono is 4.0.1 or above.
A pretty easy way to do it now is using the dotnet docker images:
https://hub.docker.com/_/microsoft-dotnet-sdk/
https://github.com/dotnet/dotnet-docker/blob/main/samples/build-in-sdk-container.md

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.

Need to run C# on linux server

I used to be able to run vb.net apps using just this
apt-get install mono-runtime
apt-get install mono-vbnc
But I now need at least 2.8.0 to run a certain app that has already been compiled on windows. I have the option between the following OS's
ubuntu-12.04-x86
ubuntu-12.04-x86_64
ubuntu-12.10-x86
ubuntu-12.10-x86_64
centos-5-x86
centos-5-x86_64
centos-5-elastix_2.0.1_amd64
centos-6-x86
centos-6-x86_64
debian-6.0-x86
debian-6.0-i386-minimal
debian-6.0-x86_64
debian-6.0-amd64-minimal
debian-7-x86
debian-7.0-x86_64
I've tried the following on multiple versions of ubuntu.
#!/bin/bash
echo Checking for prerequisites. Please enter password if prompted.
sudo apt-get update
sudo apt-get install libpng3 libpng3-dev libtool libtiff4 libtiff4-dev libexif12 libexif-dev libgif4 libgif-dev libpango1.0-dev libatk1.0-dev bison automake autoconf make gcc gtk-sharp2 build-essential xorg-dev libfreetype6 libfontconfig libfontconfig-dev gettext libglib2.0-dev git mono-complete libjpeg-dev
echo Downloading latest build of mono...
git clone git://github.com/mono/mono.git
echo Navigating to mono install directory.
cd mono
echo Building mono from source...
./autogen.sh --prefix=/usr/local
make
echo Installing mono, running with sudo
sudo make install
echo Done!
Checking the mono version says it has worked, but I cant actually run the app due to this error:
The assembly mscorlib.dll was not found or could not be loaded. It should have been installed in the 'usr/lib/mono/4.5/mscorlib.dll'.
Which OS should I use and how can I install mono 2.8.0 or later to run a C# app which has been compiled on windows?
Build a clean Linux OS from ISO, such as Ubuntu 12.04.
Install the stable Mono release on it, such as apt-get install mono-complete. This is required to bootstrap the later steps.
Install Git and check out Mono source code, and switch to a stable branch (such as mono-3.2.8-branch).
Build that version of Mono from source and install it.
I don't recommend 3.4.0 or 3.6.0 branch at this moment, as new commits are still added to them in the past week (June 17 today). 3.2.8 is also the Mono version bundled in Ubuntu 14.04.
What you have been wrong is to check out the master branch. No no, that's not a stable release you should use.

Getting G-WAN to work with Mono

I have followed the instructions on the G-WAN site FAQ and read through the manual, but I can not get G-WAN to "see" the Mono installation on my Debian 6 (x64) setup.
I have tried with the recommended Mono version (3.0.2) and the latest(3.0.4).
I am using the latest (today's) version of G-WAN.
Have I missed some configuration (e.g. environment variables...) or do I need to run Mono as a daemon?
mono by default installs on "/usr/local".
Compiling mono 3.0.6 using
./configure --prefix=/usr
make
make install
Worked for me. It will install libmono*.so on "/usr/lib"
G-WAN searches libmono*.so under /usr/lib and then links dynamically with it to compile C# scripts.
If you have installed Mono elsewhere then you should either provide links or re-build and install Mono (from source code) in the proper directory (which is simpler to do).
You can verify where Mono is installed by running:
find -L /usr/lib -name 'libmono*.so'
/usr/lib/libmono-2.0.so

Categories

Resources