[MonoDevelop] Bug: Explicitly specifying a value for ProjectTypeGuids in MSBuild .csproj files is causing the project to fail to load

Koushik K. Dutta koush at koushikdutta.com
Sun May 10 17:53:08 EDT 2009


Hi all, first time posting here. Let me know if there's a better/preferable way to report bugs. Anyways, there are twp bigs:

If a C# project (.csproj) does NOT contain a ProjectTypeGuids element, it will properly load. However, if the guid is defined in the project file with the proper explicit value, it fails:
    <ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
Briefly looking into the code related to this, it seems that the parsing/handling of project subtypes is being done properly... Just a bug in there somewhere.

In addition, I noticed that the CSharpBinding.addin.xml file only contains the guid for .NET Projects, and not .NET Compact framework projects (which is merely a subset):

    <Extension path = "/MonoDevelop/ProjectModel/MSBuildItemTypes">
        <DotNetProject
            language="C#"
            extension="csproj"
            guid="{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
            import="$(MSBuildBinPath)\Microsoft.CSharp.targets"
            resourceHandler="CSharpBinding.CSharpResourceIdBuilder"
            />
    </Extension>

To fix this, I think once the first bug is fixed, this change should support loading .NET CF projects:

    <Extension path = "/MonoDevelop/ProjectModel/MSBuildItemTypes">
        <DotNetProject
            language="C#"
            extension="csproj"
            guid="{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
            import="$(MSBuildBinPath)\Microsoft.CSharp.targets"
            resourceHandler="CSharpBinding.CSharpResourceIdBuilder"
            />

        <!-- Add this to support .NET CF C# projects! -->
        <DotNetProject
            language="C#"
            extension="csproj"
            guid="{4D628B5B-2FBC-4AA6-8C16-197242AEB884}"
            import="$(MSBuildBinPath)\Microsoft.CSharp.targets"
            resourceHandler="CSharpBinding.CSharpResourceIdBuilder"
            />
    </Extension>

I've attached a patch for the latter problem.


I ran into this bug because I have projects that I share between Mac, Windows, and Windows Mobile, and I can't load the projects on OS X without patching the .csproj file first.


Thanks!

Koush
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monodevelop-list/attachments/20090510/93980f82/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CSharpBinding.addin.xml.patch
Type: application/octet-stream
Size: 797 bytes
Desc: CSharpBinding.addin.xml.patch
Url : http://lists.ximian.com/pipermail/monodevelop-list/attachments/20090510/93980f82/attachment.obj 


More information about the Monodevelop-list mailing list