Wednesday, June 11, 2014

Access to path denied when adding axml-file in Visual Studio


This is a designer issue and occurs when you have multiple layout files. Like one in Layout and one in Layout-large. You need to check out both files from TFS. Also it should only occur when using Server Workspace. Local workspace should solve the problem by design.

Original post

This is something that happens from time to time for me.
  1. I add a new layout file in the layout-large (with a corresponding file in the layout folder) and it gets marked for adding to TFS.
  2. Using my extraordinary design skills I edit the layout in the designer.
  3. When I try to save it I get a "Access to the path '{path}' is denied.

The current setup is
  • Visual Studio 2012
  • Xamarin 3.0
So what is locking up my file? 
  • Tried to use SysInternals Handle tool, but no matching handles found there. 
  • Shutting down Visual Studio didn't help, still not able to edit/save it using Notepad++.
  • Created a test file in the same directory, just to check the directory security settings. No problem there.
  • Deleted the file in explorer and added a copy of it again. This somehow works...
I can now edit the file in notepad++ but not using the designer.


My workaround is to open the axml file with the Xml Editor instead by right-clicking and selecting Open With... Since I can't pinpoint the exact problem this will have to do it for now.

No comments:

Post a Comment