[Mono-bugs] [Bug 680904] New: Resources.Designer.cs shouldn't be kept under source control

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Mar 18 12:37:53 EDT 2011


https://bugzilla.novell.com/show_bug.cgi?id=680904

https://bugzilla.novell.com/show_bug.cgi?id=680904#c0


           Summary: Resources.Designer.cs shouldn't be kept under source
                    control
    Classification: Mono
           Product: MonoDroid
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: P5 - None
         Component: Tools
        AssignedTo: mkestner at novell.com
        ReportedBy: jpryor at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-US)
AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.127 Safari/534.16

Resources.Designer.cs is currently part of the project and (usually) part of
source control, which can be problematic with TFS users who have the file
marked as Read Only.

Possible fix: 
http://lists.ximian.com/mailman/private/monodroid/2011-March/003742.html

A file doesn't have to be statically in the project to provide
Intellisense...to satisfy yourself of this, you can create a WPF project,
reference App.Main() from somewhere, and see how Intellisense handles it. This
function is defined in obj\x86\Debug\App.g.cs, which is automatically generated
and added to the project at build time. This way, it never gets checked in, but
Intellisense still works just like any other file.

I was able to make this work with the following steps:

1) In the Android .csproj file, remove the <Compile
Include="Resource.designer.cs" /> element
2) Change the "AndroidResgenFile" property to
$(IntermediateOutputPath)\Resource.designer.cs (optional, but cleaner, since
build output shouldn't be intermixed in the same directory with source code)
3) Add an [Output] attribute to the AndroidResgen.ResgenOutputFile property (I
used ildasm\ilasm for this, for testing purposes)
4) In Program Files\MSBuild\Novell\Novell.MonoDroid.Common.targets, add the
following inside the <AndroidResgen /> element: 
    <Output TaskParameter="ResgenOutputFile" ItemName="Compile" />

Now if you build your project, you should end up with a Resource.designer.cs
that's exactly the same as what you have now, but is tucked away with the other
intermediate build files and doesn't show up in the Solution Explorer, which
therefore won't get checked into source control and cause problems. I tried
this and verified that Intellisense works exactly as it did before. I even
added a doc comment to one of my string resources and verified that it still
showed up correctly, in case you ever want to put the name of the file that
generated it there or something.

    -- Ryan Milligan

Reproducible: Always

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list