Windows Azure - Resolving "The Path is too long after being fully qualified" Error Message

Windows Azure - Resolving "The Path is too long after being fully qualified" Error Message

Rate This
  • Comments 19

When you run a cloud service on the development fabric, the development fabric uses a temporary folder to store a number of files including local storage locations, cached binaries, configuration, diagnostics information and cached compiled web site content.

By default this location is: C:\Users\<username>\AppData\Local\dftmp

For the most part you won’t really care about this temporary folder, the Windows Azure Tools will periodically clean up the folder so it doesn’t get out of hand.

Note: To manually clean up the devfabric temporary folder, you can open an elevated Windows Azure SDK Command Prompt and run: “csrun /devfabric:shutdown” followed by “csrun /devfabric:clean”.  You really don’t need to do this but it can come in handy from time to time.

There are some cases where the length of the path can cause problems.

If the combination of your username, cloud service project name, role name and assembly name get so long that you run into assembly or file loading issues at runtime. This will give you the following error message when you hit F5:

“The path is too long after being fully qualified.  Make sure the full path is less than 260 characters and the directory name is less than 248 characters.”

For example, in my test, the path to one of the assemblies in my cloud service was:

C:\Users\jnak\AppData\Local\dftmp\s0\deployment(4)\res\deployment(4).CloudServiceabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr.WebRole1.0\AspNetTemp\aspNetTemp\root\aff90b31\aa373305\assembly\dl3\971d7b9b\0064bc6f_307dca01\Microsoft.WindowsAzure.Diagnostics.DLL

which exceeds the 260 character path limit.

If you aren’t married to your project and assembly names, you could name those differently so that they are shorter

The other workaround is to change the location of the development fabric temporary folder to be a shorter path.

You can do this by setting the _CSRUN_STATE_DIRECTORY to a shorter path, say “C:\A” for example.

image

Make sure that you close Visual Studio and shutdown the development fabric by using the “csrun /devfabric:shutdown” command I mentioned above or by clicking “exit” on the Windows Azure the tray icon.

After making this change, my sample above was able to run without problem.

Of course, this workaround really only buys you more characters and ultimately you may have to simply reduce your path lengths through renaming.

Leave a Comment
  • Please add 1 and 7 and type the answer here:
  • Post
  • I've just run into this and changing the output folder to (e.g.) <code>C:\A</code> hasn't worked.

    Is there a way to get the exact path which is causing problems to be printed?

  • Hey George, we don't have a way to show the path today, I've filed a bug to get that added as a diagnostic.  You should see an s0 folder if the change worked.  You can look in the appdata dftmp folder to see if it is still using the old path.  Just clean up that folder and see if new stuff gets added to it (again that s0 folder).

    Also make sure that all of the VS and devfabric process are stopped and then started after you add the environment variable.

  • Figured this out; it was actually the folder depth for the Azure solution that was causing the error.

    Hopefully the added diagnostic will help with figuring this out in the future :) (Of course, fixing the limit would be better!)

  • All Problems have ONE solution and that is:

    www.longPathTool.com

    Path too long.

    Error cannot delete file: cannot read from source file or disk

    Cannot delete file: Access is denied

    There has been a sharing violation.

    Cannot delete file or folder The file name you specified

    is not valid or too long. Specify a different file name.

    The source or destination file may be in use.

    The file is in use by another program or user.

    Error Deleting File or Folder

    Make sure the disk is not full or write-protected and that the file is not currently in use.

    Path too deep.

  • I had the similiar problem and finally I found solution:

    www.tooLongPath.com

  • I had the similiar problem and finally I found solution:

    <a href='www.tooLongPath.com'>www.tooLongPath.com</a>

  • Unbelievable. It's bad enough that there is an arbitrary 260-character path limit. It's worse that the very company who put that limit in place releases a tool that is all but guaranteed to violate said limit.

    Thanks for the tips, Max. This should work for me.

  • It seems above method couldn't fix the issue. I did following one to fix the issue.

    Open Cloud***.ccproj.user file notepad

    Add <ServiceOutputDirectory>C:\azuretmp\</ServiceOutputDirectory>

    Build your project, it should build new package.

  • Changing the Variable name didn't work for me. But Following setting helped me and I am able to build a package of my project.

    Open User's Azure Project file (e.g.: “XXXXX.ccproj.user” file ) in notepad add the following entry to <PropertyGroup> node.

    <ServiceOutputDirectory>C:\azuretmp\</ServiceOutputDirectory>.

    Then Build the Azure package.

    Hope it will work for you.

    Thank You.

  • I have also faced this type of error problems and I have used “Long Path Tool” in this situation and it helped me easily and quickly. This tool can fix all the error messages like:

    1. Path too long

    2. Cannot delete file: cannot read from source file or disk

    3. Cannot delete file: Access is denied

    4. There has been a sharing violation.

    5. The source or destination file may be in use.

    6. The file is in use by another program or user.

    7. The file name you specified is not valid or too long. Specify a different file name.

    and all other related error messages.

    I hope you will find this solution helpful and don’t forget to leave your comments.

  • Long Path Tool helped me in this situation. http://PathTooDeep.com

  • Hello. i was also having the same issue but Long Path Tool helped me in this situation. You can see here http://PathTooDeep.com. It might help you as well.

    Thanks and Regards,

    Attila

  • its very good site for learn.if you want learn more then visit.........

    http://longpathtool.com/

  • All Problems have ONE solution and that is:

    LONG PATH TOOL

    Path too long.

    Error cannot delete file: cannot read from source file or disk

    Cannot delete file: Access is denied

    There has been a sharing violation.

    Cannot delete file or folder The file name you specified

    is not valid or too long. Specify a different file name.

    The source or destination file may be in use.

    The file is in use by another program or user.

    Error Deleting File or Folder

  • Long path tool will help you to solve this issue.

Page 1 of 2 (19 items) 12