Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
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.
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
The .g.cs files are not comparable to .designer.cs files. Designer files are updated as the resources change, they are only generated at build time as a fallback in case something went wrong.
I don't think we're going to move this. If the user does not want it in source control, they can use their equivalent of .gitignore.