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.
I get the following error [see below] after having overwritten a resource file instead of checking it out first. MonoDevelop acts like the file is still open. This error prevents me from compiling and deploying my Android app.
I have MonoDevelop 188.8.131.52 and Mono for Android 4.2.6
/Library/Frameworks/Mono.framework/External/xbuild/Novell/Novell.MonoDroid.Common.targets: Error: Access to the path "/Users/Cegedim/Documents/Android_MIPocket/WebForce/Mobile/MIAndroid/Resources/values/Attrs.xml" or "/Users/Cegedim/Documents/Android_MIPocket/WebForce/Mobile/MIAndroid/obj/Debug/res/values/attrs.xml" is denied. at System.IO.File.Copy (System.String sourceFileName, System.String destFileName, Boolean overwrite) [0x00000] in <filename unknown>:0
at Microsoft.Build.Tasks.Copy.CopyFile (System.String source, System.String dest, Boolean create_dir) [0x00000] in <filename unknown>:0
at Microsoft.Build.Tasks.Copy.Execute () [0x00000] in <filename unknown>:0 (MIAndroid)
The file is more than likely marked as readonly. We'd have to remove that flag from the file before attempting to overwrite it for this to succeed.
For now you can simply delete the "/Users/Cegedim/Documents/Android_MIPocket/WebForce/Mobile/MIAndroid/obj/Debug/res/values/attrs.xml" file from your disk. That should be enough to fix it.
Yes, that is a workaround for now but it is inconvenient.
Hopefully, Xamarin can provide a fix to the IDE when time permits.
Why is obj/Debug/res/values/attrs.xml read-only? Is it tracked by your version control system?
Yes. We are using TFS via Eclipse plugin.
If I don't check it out, make changes to overwrite it and then subsequently compile, then I get the problems originally described.
The contents of the `obj` and `bin` directories SHOULD NOT be kept in version control. They are temporary build artifacts, and will be rebuilt when needed.
Do not store `bin` and `obj` in TFS, and this won't be a problem.
Sorry, I think there was some confusion in my last response.
I didn't realize that you were referring specifically to the bin/obj directories.
We do not keep these in TFS as these are transient and regenerated every time.
The only file transient file kept in TFS is Resource.Designer.cs.
If we make longterm changes to this, we typically check it out and check it back in.
What confuses me is the original report:
> Error: Access to the path
> is denied.
Resources\values\attrs.xml is the source, so it shouldn't matter if it's read-only (though you should check filesystem permissions to double-check that). obj\Debug is build output, and shouldn't be in TFS, and thus shouldn't be read-only (you might want to double-check that).
So given a "sane" environment (bin & obj aren't tracked by TFS), I don't understand why you would be getting this exception. Unless perhaps you removed Resources\values\Attrs.xml without removing it from your project (i.e. does it still exist?).
The real kicker is that the workaround of deleting `obj/Debug/res/values/attrs.xml` worked, implying that `obj/Debug/res/values/attrs.xml` was read-only. Again, if bin & obj aren't tracked by TFS, HOW could that file be read-only? (Some errant/bizarre backup program?) It doesn't make sense otherwise.
This bug has been in the NEEDINFO state with no changes for the last 90 days. Can we put this back into the NEW or CONFIRMED state, or are we still awaiting response?
If there is no change in the status of this bug over the next two weeks, this bug will be marked as NORESPONSE.
This bug has not been changed from the NEEDINFO state since my previous comment, marking as RESOLVED NORESPONSE.
Please feel free to REOPEN this bug at any time if you are still experiencing the issue. Please add the requested information and set the bug back to the NEW (or CONFIRMED) state.