Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Compile C# on 10.04

  1. #1
    Join Date
    Apr 2006
    Location
    UK
    Beans
    6,646
    Distro
    Ubuntu 12.04 Precise Pangolin

    Compile C# on 10.04

    Please forgive the absolute lack of knowledge I have...

    I want to install http://sourceforge.net/projects/ecgtoolkit-cs/files/ on Ubuntu.

    It appears it comes in XP compiled exe files, but the source is also available.

    Is it possible to compile using mono-devel? If so, how? If it is complicated, don't worry, I'll find an alternative.

  2. #2
    Join Date
    Jul 2008
    Location
    Sydney Australia
    Beans
    343

    Re: Compile C# on 10.04

    Quote Originally Posted by ugm6hr View Post
    Please forgive the absolute lack of knowledge I have...

    I want to install http://sourceforge.net/projects/ecgtoolkit-cs/files/ on Ubuntu.

    It appears it comes in XP compiled exe files, but the source is also available.

    Is it possible to compile using mono-devel? If so, how? If it is complicated, don't worry, I'll find an alternative.
    If there is a .sln (Solution) file, it is as simple as loading that file in monodevelop and clicking "Build ALL" or pressing F8.

  3. #3
    Join Date
    Apr 2006
    Location
    UK
    Beans
    6,646
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Compile C# on 10.04

    Quote Originally Posted by VH-BIL View Post
    If there is a .sln (Solution) file, it is as simple as loading that file in monodevelop and clicking "Build ALL" or pressing F8.
    Thanks.

    There are a lot of .sln files, presumably I do that for each one.

  4. #4
    Join Date
    Jul 2008
    Location
    Sydney Australia
    Beans
    343

    Re: Compile C# on 10.04

    Quote Originally Posted by ugm6hr View Post
    Thanks.

    There are a lot of .sln files, presumably I do that for each one.
    I guess as I am not sure what you are trying to compile without downloading the file.

    This may help:
    A .sln (Solution) is a collection of .csproj (Project) files. So loading a solution in monodevelop will load the relevant projects and clicking "Build All" or pressing F8 will compile those projects.

    If there is more then one solution there would be project(s) associated with those solutions that may need to be compiled.

    The reason there can be more then one project in a solution is if you are making an executable project it may need a .dll library project to go with it and a solution is a way of developing them all together.

    Hope this helps.

  5. #5
    Join Date
    Feb 2007
    Location
    Tuxland
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Compile C# on 10.04

    You don't necessary need monodevelop to compile. Mono-devel and the "xbuild" command will do it.

    eg: xbuild <path to *.sln>
    Proud GNU/Linux zealot and lover of penguins
    "Value your freedom or you will lose it, teaches history." --Richard Stallman

  6. #6
    Join Date
    Apr 2006
    Location
    UK
    Beans
    6,646
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Compile C# on 10.04

    OK. I went down the monodevelop route...

    1 of the sln files appears to load 8 projects, which makes sense.

    When loading, it asks to convert to Visual Basic 2005 or MonoDevelop, since it looks like it is a VS2003 file. Irrespective of which I select, it imports OK.

    However, when building, there appear to 7 errors, all of which read:
    Unsafe code requires the 'unsafe' command line option to be specified (CS0227) in ECGTool.cs

    Unfortunately, I have no idea what I'm doing...

  7. #7
    Join Date
    Feb 2008
    Location
    readlink("/proc/self/exe"
    Beans
    1,120
    Distro
    Ubuntu Development Release

    Wink Re: Compile C# on 10.04

    Did you run file on the .exe ?
    It's probably a managed executable (=.NET bytecode).
    If so, you don't need to recompile, you just need to install the .NET framework (called mono on Linux).

    That means you need to install mono
    apt-get install mono-complete


    Then you start the .exe file with:
    mono /path/to/xy.exe

    Just as wine.
    And just as wine, if you install binfmt-support, you can just start the .exe with:
    /path/to/xy.exe

    (Keep in mind that the visual basic runtime ships separately. mono/monodevelop comes with C# only by default).


    Also, the mono edition that ships with ubuntu is slightly outdated.
    If you need a newer version, keep to this tutorial:
    http://www.centriment.com/2009/04/01...on-ubuntu-810/
    and just replace 2.4 with 2.6

    You should read this one first:
    http://www.mono-project.com/Parallel_Mono_Environments

    Also, keep in mind that if the .NET program makes calls to the windows API (when written in a windows-only fashion), it will crash. It can also crash because of bugs in mono, or because the mono version of ubuntu (2.4) is outdated, which means it contains a lot of bugs that have already been fixed in the 2.6 stable version.
    Last edited by WitchCraft; August 11th, 2010 at 10:40 PM. Reason: Clippy rulez
    In a world without walls and fences, who needs Windows and Gates?
    Linux is like a wigwam.... no Gates, no Windows but Apache inside!
    http://www.debianadmin.com
    apt-get install libstdc++6-4.3-doc

  8. #8
    Join Date
    Jul 2008
    Location
    Sydney Australia
    Beans
    343

    Re: Compile C# on 10.04

    Quote Originally Posted by ugm6hr View Post
    Unsafe code requires the 'unsafe' command line option to be specified (CS0227) in ECGTool.cs
    I have not done any unsafe code in monodevelop only in Visual Studio. I am pretty sure it is asking you to do this:

    *) Right click on the project that has the ECGTool.cs file
    *) Click Options
    *) Click Compiler
    *) Add "-unsafe" (with out quotes) in Additional arguments.
    *) Click OK

    The try recompile.

    Let me know how you go...

  9. #9
    Join Date
    Apr 2006
    Location
    UK
    Beans
    6,646
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Compile C# on 10.04

    Quote Originally Posted by WitchCraft View Post
    Did you run file on the .exe ?
    It's probably a managed executable (=.NET bytecode).
    If so, you don't need to recompile, you just need to install the .NET framework (called mono on Linux).

    That means you need to install mono
    apt-get install mono-complete
    It comes in a number of different forms, both as an msi (which I presume is the Windows installer - and installs OK on Windows), as well as a zipped archive of .exe and source.

    I'll try this on the 4 .exe files tonight. So far, I've been using the source files, since I presumed that the exe files would be of no use.

    Presumably, there should no no problem using a script to launch all 4 exe's in mono at the same time?

  10. #10
    Join Date
    Apr 2006
    Location
    UK
    Beans
    6,646
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Compile C# on 10.04

    Quote Originally Posted by VH-BIL View Post
    Let me know how you go...
    Will do - I'll try the exe files first, cos that seems like a simple solution (assuming it works)...

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •