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.
When we add files to Assets, it should be "Android Asset" by default. Similarly, the default item type should be "Android Resource" when it is added under "Resources".
The same would apply to jar files (AndroidJavaLibrary) under "lib" or "libs" directory. We might also want to define "java" directory as our own manner to default to AndroidJavaSource.
Actually we could simply identify "jar" and "java" extensions which is much simpler and complies with the fact that libs are not bound to specific directories unlike assets and res.
MD used to do this for resources, it sounds like the code got broken?
I thought it is mfa addin's role; aren't those resource types mfa specific?
Yes, by "MD" I meant "the MD addin".
Fixed. The issues were in MD core.
It worked fine for adding existing files to the project that were already located in the resource/asset directories, but failed when adding files from other locations. The "add existing file" code was passing the source path to GetDefaultBuildAction, not the target path. This worked when files were added in-place but not when they needed to be copied/moved/linked. It also worked for other project types' GetDefaultBuildAction code which only depended on the file extension, however the M4A addin's calculation of build actions depends on the project-relative path.
It also failed when creating new blank XMl for text files, because those templates were explicitly forcing the build action to None. This was a leftover from before GetDefaultBuildAction was used to set good defaults automatically, so I removed it, which fixed the problem.
*** Bug 2744 has been marked as a duplicate of this bug. ***