Wednesday, June 11, 2014

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

UPDATE and SOLUTION

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.

Workaround

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.

1 comment:

  1. I used to lear programming thanks to my smartphone apps. But I lost my phone few weeks ago. I was lucky to read https://cellspyapps.org/track-phone-number/ so I found it very fast.

    ReplyDelete