Ibolit Ibolit - 21 days ago 5
Linux Question

Compiling C# projects on Linux with dependencies

I am trying to compile OpenLR on Linux (Ubuntu) using Mono, however, I run into the problem of the compiler (

xbuild
) not being able to find the project's dependency, Itinero.

I used nuget.exe to install Itinero, but it didn't work. I also tried googling for something like Classpath in C#, but found that C# doesn't have it.

Is there a way to make the
xbuild
see the dependencies? How can I specify the paths to the directories where those dependencies are?

Answer

You have to do a package restore:

git clone https://github.com/itinero/OpenLR.git
cd OpneLR
nuget restore OpenLR.sln
xbuild OpenLR.sln

It should compile with zero errors, there are 27 warnings that need cleaned up in the code....

Note: Make sure the you are on an updated/moderm install of Mono as if you are using the default Mono package from Ubuntu you might need to update it:

Ref: http://www.mono-project.com/download/#download-lin