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

Thread: Monodevelop + Winforms

  1. #1
    Join Date
    Jun 2007
    Beans
    7

    Monodevelop + Winforms

    I'm using monodevelop (.12) on Fiesty. According to the monodevelop website, winforms support is a standard (included) part of monodevelop.

    I see no way, with my installed version to create a winforms application.

    putting:
    using System.Windows.Forms;
    in my code fails (missing reference?)

    I've looked in the references section, and see nothing that looks to be winforms..
    Is there a dll I need to download from someplace to support this? The monodevelop site tells me I already have this ability and therefore there is nothing to download.

    I've tried using the Gtk forms, but the differences are significant and documentation is really lacking.
    For example, I coulden't find any help on overriding the OnPaint method so that I could do some drawing on the form surface.

    Can anyone shed some light on this for me?

  2. #2
    Join Date
    Feb 2007
    Location
    Seville, Spain
    Beans
    554
    Distro
    Kubuntu 8.04 Hardy Heron

    Re: Monodevelop + Winforms

    Hi, I was using Monodevelop when I saw your post

    When I click on the project's References editor, I can add the System.Windows.Forms reference. Maybe it's missing because you hadn't installed it. The packages are called libmono-winformsX.0-cli, where X is 1 or 2 depending on what version of ".net" framework you are targeting.

    By the way, Gtk# is way better than Winforms, speaking about functionality and cross plataform support. I agree with you in that WinForms has a way better documentation, but it still rules. In Gtk#, the Paint event is called Expose

    I suggest you to use the Monodevelop 0.13 version from SVN, as it has many more features than 0.12 (and default 0.13).

    Bye!

  3. #3
    Join Date
    Jun 2007
    Beans
    7

    Re: Monodevelop + Winforms

    Thanks for your help...

    I downloaded that package and the package manager tells me its already installed.
    Monodevelop must be ignoring it for some reason.

    I found it in /usr/lib/mono/gac/System.Windows.Forms/2.0.0.0__b77a5c561934e089 so I am able to add a reference to it now by browsing to it (monodev still doesn't have it in the ref list)

  4. #4
    Join Date
    Jun 2007
    Beans
    7

    Re: Monodevelop + Winforms

    Ok, this is pretty frustrating.

    Added the reference, tried to compile a "hello world" winforms app.

    compiler pukes:

    ** (/usr/lib/mono/1.0/mcs.exe:7611): WARNING **: Missing method .ctor in assembly /usr/lib/mono/gac/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll, type System.ComponentModel.InitializationEventAttribute

    ** ERROR **: Can't find custom attr constructor image: /usr/lib/mono/gac/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll mtoken: 0x0a00060b
    aborting...

  5. #5
    Join Date
    Jun 2007
    Beans
    5

    Re: Monodevelop + Winforms

    Just found this thread, I have the exact same problem. Both monodevelop and WinForms have been installed from the Ubuntu repos, but WinForms just doesn't show up in the list of references. Anybody have any ideas?

    Thanks, James

  6. #6
    Join Date
    Feb 2006
    Location
    EU
    Beans
    142
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: Monodevelop + Winforms

    Unfortunately Monodevelop does not use the GAC. If you want an assembly that is in the GAC to show up in the pakages tab, you should create a package config file in /usr/lib/pkgconfig. You can use one of the existing files as a starting point (as I did).

    Here are the contents of my /usr/lib/pkgconfig/windows-forms.pc:
    Code:
    prefix=${pcfiledir}/../..
    exec_prefix=${pcfiledir}/../..
    libdir=${prefix}/lib
    includedir=${prefix}/include
    
    Name: System.Windows.Forms
    Description: Windows Forms for Mono
    Version: 2.0.0.0
    Libs: -r:${prefix}/lib/mono/2.0/System.Windows.Forms.dll
    (thanks to lluis on the #monodevelop channel @ icr.gimp.org for helping me out)

    I also get the same "Missing method .ctor in assembly" error though...

  7. #7
    Join Date
    Feb 2008
    Beans
    4

    Re: Monodevelop + Winforms

    This patch worked for me, thanks, but yes, the same error.

  8. #8
    Join Date
    Dec 2007
    Beans
    21

    Re: Monodevelop + Winforms

    Have you tried using it in 8.10? Everything works perfect for me. I even got the Winforms Designer to work. I needed these stuff for .NET development on Linux so I can work with C# without ever having to touch *******...

    Here are the stuff I installed with apt-get:
    mono-gmcs
    mono-winforms*

    Then I installed winforms designer by following the instructions <a href = "http://www.mono-project.com/WinForms_Designer">here</a>.

  9. #9
    Join Date
    Sep 2005
    Beans
    37

    Re: Monodevelop + Winforms

    I was having this issue but that second post gave me the clue.. In MonoDevelop, if you right click the "References" folder in the solution browser on the left and choose "Edit References" you can add the "System.Windows.Forms" reference. Then my WinForms program compiled sweet
    --------------------------------------------
    By Hook or by Crook... We Will!
    --------------------------------------------

  10. #10
    Join Date
    Aug 2006
    Beans
    Hidden!

    Re: Monodevelop + Winforms

    Hello,

    I've checked up that you have successfully installed winforms designer under Mono on Hardy 8.04 in this post. May I beg for few more details, please? Did you use standard Hardy repositories and extra downloaded just the Mono Winforms Designer using subversion as it is at this link http://www.mono-project.com/WinForms_Designer ? Did you need to have installed the whole Mono SVN trunk? Or only the designer part

    Code:
    svn co svn://anonsvn.mono-project.com/source/trunk/mwf-designer
    make; make run
    is enough?

    Martin

Page 1 of 2 12 LastLast

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
  •