[MonoDevelop] Wild Cards in MS Build Project Files

Lluis Sanchez Gual lluis at novell.com
Tue Dec 30 06:57:25 EST 2008

El dl 29 de 12 de 2008 a les 14:08 +0000, en/na Charles Mason va
> Hi All,
> I have been trying to get my project to work correctly. I won't go
> into details but basically there are many directories with source
> files which are pulled in via source control (git & Anrdoid's Repo
> tool). So I don't want to keep manually adding every new source file
> as it appears in these folders to the project.
> The project files are based on MSBuild which is quite flexible in
> terms of using wild cards in source paths however Monodevelop just
> reports a missing file called *.cs in the file list. For more info:
> http://msdn.microsoft.com/en-us/library/ms171454(VS.80).aspx
> I have had a first stab at implementing this in Mono Develop and I now
> have it loading project files that contain nodes like this.
>   <ItemGroup>
>     <Compile Include="..\shared\BlockStore\*.cs" />
>     <Compile Include="..\shared\Networking\**\*.cs" />
>     <Compile Include="source\ClientNode\ClientConnection.cs" />
>     <Compile Include="source\ClientNode\ClientEngine.cs" />
>     <Compile Include="source\ClientNode\ClientEngineImpl.cs" />
>   </ItemGroup>
> At the moment when it goes to save the project file it removes the
> wild cards and replaces them with the files currently in the file list
> so clearly that's something I need to look into.
> Also much of the file list context menu items don't work or needs to
> be modified, e.g. to remove a file from the project. Also logically
> the GUI eventually should provide a away for people to add an edit
> these wildcards.
> Does anyone else think this is a useful feature? It is something that
> is supported by MSBuild although I remember it used to confuse visual
> studio a bit too, although it did attempt to support it (that was
> VS2005 I think not tried it in the latest version).

Visual Studio only supports a small subset of MSBuild when loading a
solution into the IDE. This is not a big issue because solution building
is driven by MSBuild, not by VS, so as long as VS can load the MSBuild
file and not destroy it, it should be ok.

MonoDevelop does not yet use MSBuild as building engine because Mono
does not yet provide a complete implementation of MSBuild. So MD has its
own build engine which "interprets" the MSBuild file. This makes it very
hard to support complex build rules. We don't plan to add more features
to the MD build engine because it will be replaced at mid term by the
MSBuild engine. 

However, it is still useful to improve MD so it can read complex MSBuild
files without crashing and destroying them.

> Also I noticed that all files added out side of the project directory
> are added to a tree item called External Files and are not shown in
> their directory hierarchy is this an intended feature? It does makes
> it hard to find files if there are quite a few files. Wouldn't it be
> better to show them in the same hierarchy that's used in the project
> file. Eg. External Files -> BlockStore -> example.cs

The problem is that there can be many hierarchies. e.g. there coud be
"..\shared\BlockStore" and "..\util\BlockStore" and "..\..\shared


More information about the Monodevelop-list mailing list