[mono-android] Enhancement: aresgen.exe and TFS.
Milligan, Ryan
Ryan.Milligan at wizards.com
Thu Mar 17 11:33:13 EDT 2011
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
________________________________________
From: Jonathan Pobst [monkey at jpobst.com]
Sent: Wednesday, March 16, 2011 9:11 PM
To: monodroid at lists.ximian.com
Cc: Milligan, Ryan
Subject: Re: [mono-android] Enhancement: aresgen.exe and TFS.
We generate it in \Resources and add it to your project so you can get
Intellisense when using it.
Jonathan
On 3/16/2011 5:10 PM, Milligan, Ryan wrote:
> Files that are generated automatically as part of building shouldn’t be
> checked in. Lots of source control systems mark files that aren’t
> checked out as read-only. Unfortunately, I’m not sure if TFS lets you
> exclude files that are part of the project from the source control
> repository. I think the right answer is probably for Monodroid to
> generate Resources.Designer.cs in the obj folder (much like the various
> .g.cs files that WPF generates as part of the build process, for
> example) so that it won’t go in the repository at all. This sort of
> temporary file generated by the build process is exactly what the obj
> folder is for.
>
> -- Ryan Milligan
>
> *From:*monodroid-bounces at lists.ximian.com
> [mailto:monodroid-bounces at lists.ximian.com] *On Behalf Of *Carlo Bolz
> *Sent:* Wednesday, March 16, 2011 12:42 AM
> *To:* monodroid at lists.ximian.com
> *Subject:* Re: [mono-android] Enhancement: aresgen.exe and TFS.
>
> Sorry, I won´t cumber the monodroid team. It´s more a question than an
> enhancement. My question is answered now.
>
> *Von:*monodroid-bounces at lists.ximian.com
> [mailto:monodroid-bounces at lists.ximian.com] *Im Auftrag von *Tom Opgenorth
> *Gesendet:* Mittwoch, 16. März 2011 03:51
> *An:* monodroid at lists.ximian.com
> *Betreff:* Re: [mono-android] Enhancement: aresgen.exe and TFS.
>
> To be honest, I'd say this is more of a TFS problem then a MonoDroid
> problem. It truly annoys me to no end that TFS does this in the first
> place. I'd suggest that the MonoDroid team shouldn't be spending their
> precious resources yak shaving activities to get around TFS issues.
>
> On Tue, Mar 15, 2011 at 16:42, Carlo Bolz <cb at dm-edv.de
> <mailto:cb at dm-edv.de>> wrote:
>
>
> Developer are normaly lazy ;-)
>
> Everytime I check out the project from the Team Foundation Server and
> somethings different in the resources, aresgen.exe runs into an
> System.UnauthorizedAccessException because the file
> "Resources.Designer.cs" is read only.
>
> So I have to check out the file "Resources.Designer.cs" and compile again.
>
> Kind regards,
>
> Carlo
>
>
> _______________________________________________
> Monodroid mailing list
> Monodroid at lists.ximian.com <mailto:Monodroid at lists.ximian.com>
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
>
>
>
>
> --
> http://www.opgenorth.net
>
>
>
> _______________________________________________
> Monodroid mailing list
> Monodroid at lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
More information about the Monodroid
mailing list