[MonoDevelop] Possible bug in generic MonoDevelop project(mdproj) build.

Michael Hutchinson m.j.hutchinson at gmail.com
Sat Jun 12 14:27:01 EDT 2010

On Fri, Jun 11, 2010 at 7:12 PM, Thiago Padilha <tpadilha84 at gmail.com> wrote:
>  I have a generic md project that contains a mix of C and C ++ code,
> so I created a Makefile to handle everything and in the Project
> Options->General->Custom Commands I replaced the build step by the
> make command. But I didnt knew about MSBuild/XBuild(which to my joy,
> looks a lot like nant) customization power until today so I decided to
> migrate from Make to XBuild which not only is integrated with
> monodevelop, but I can easily customize with C# code. However after
> examining the mdproj file I noticed that even though the 'Project'
> element has DefaultTargets="Build" attribute, there are no targets(and
> no imports to other files) and when I try to build from command line
> XBuild complains it didnt find any target named 'Build'. When I build
> the project from monodevelop it does not report any errors.
>  I don't know if it is a bug, but I have two guesses as to why this
> is happening
>  - MonoDevelop does something other than callind xbuild on the mdproj.
>  - MonoDevelop appends a file that contains build target to the
> mdproj , calling any custom commands if present.
>  To test what was happening, I inserted the following on the mdproj:
>   <Target Name="Build">
>        <Message Text="Testing XBUILD!"/>
>   </Target>
>  XBuild displays the message when invoked manually, but nothing was
> shown in the MD's build output window. I could easily get arround this
> issue  by changing my custom build command from 'make' to 'xbuild',
> but I think it would be more elegant if MD invoked xbuild
> automatically.

You might want to enable the experimental xbuild support in MD:

Preferences->Build->Compile projects using MSBuild/XBuild (Experimental)

In MD 2.6 it will likely be the default build engine.

>   I have tree suggestions for the MD team :so it automatically adds
> an empty 'Build Target' on the mdproj file and invokes xbuild for it.
> Then any user customized build steps would be placed in the
>  - Automatically call xbuild on generic projects
>  - Add an empty 'Build target' on the mdproj file(so Xbuild doesn't
> complain about missing targets)

Could you file enhancement bugs for these?

>  - Add an option to the context menu for project/solution items to
> open it with the XML editor

That's filed already - https://bugzilla.novell.com/show_bug.cgi?id=595266

>  The third option is only a helper, so the user doesn't have to
> trough the File-Open route to edit the project file. An issue I
> noticed is that theres no syntax coloring when opening  csproj files
> with the source code editor.(Can this be customized?).

Could you file an ENH bug for that too?

You can work around it by adding ".csproj" to the "Default File
Associations" list  in "Preferences->Other->XML Schemas" - no need to
add a scheme or prefix, just add the extension.

Michael Hutchinson

More information about the Monodevelop-list mailing list