Bug 1280 - .mdp Exclude files get migrated as Include
Summary: .mdp Exclude files get migrated as Include
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: iOS add-in ()
Version: Trunk
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Alan McGovern
Depends on:
Reported: 2011-10-05 18:18 UTC by Jeffrey Stedfast
Modified: 2011-10-06 10:52 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Jeffrey Stedfast 2011-10-05 18:18:53 UTC
in the .mdp:

    <File subtype="Code" buildaction="Exclude" name="icon29.png" />
    <File subtype="Code" buildaction="Exclude" name="icon57.png" />
    <File subtype="Code" buildaction="Exclude" name="icon58.png" />

in the .csproj post migration to Visual Studio 2010:

    <Content Include="icon29.png" />
    <Content Include="icon57.png" />
    <Content Include="icon58.png" />

That looks wrong to me but I could be totally wrong.
Comment 1 Alan McGovern 2011-10-05 18:34:33 UTC
It looks more 'right' to me in the csproj than in the mdp. The MDP had images listed as code that's not compiled. The csproj lists image files as content which will be copied to the output directory. This seems sane enough to me. What do you think this should do?
Comment 2 Mikayla Hutchinson [MSFT] 2011-10-05 18:40:08 UTC
I would guess that the format converter imported them "None" build action, then the MonoTouch importer imported the icon settings and changed them to "Content".
Comment 3 Mikayla Hutchinson [MSFT] 2011-10-05 18:54:52 UTC
Also, I think you're confusing the meaning of include and exclude in the different contexts.

In MSBuild, the element name is the build action of the item, i.e. "Content", and the Include attribute is what makes it an MSBuild item, and the value is the file it refers to.

In the mdp, the element name and subtype attribute are basically boilerplate. The buildaction attribute value is the build action (the equivalent of the MSBuild item's element name) and the name attribute value is the file's name (the equivalent of the MSBuild Include attribute value).

The only thing that really changed between the two files is that the items'build action got changed from "Exclude" to "Content".

Note also that mdp serializes the "None" build action as "Exclude", for historical back-compat reasons. Exclude isn't currently used except in this way.
Comment 4 Alan McGovern 2011-10-06 05:51:20 UTC
From my understanding of both project formats and the above comments from michael, i don't think this is actually a bug. Jeff, is it ok to just close this or did this change break something for the user that I'm not aware of?
Comment 5 Jeffrey Stedfast 2011-10-06 10:52:58 UTC
Judging from Michael's above explanation explaining my confusion, yea, I think we can close this.