43

I have been trying to publish my service to windows azure. The service consists of a single webRole, however I have added remote login functionality published it and built it a few times, and now all the sudden it will not build. The reason it gives is that

Details below:
"Error 56 The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. C:\Program Files (x86)\MSBuild\Microsoft\Cloud Service\1.0\Visual Studio 10.0\Microsoft.CloudService.targets 202 5 FileSystemCreator"

I have gone on all the forums, I have used CSPack command line for packaging the service which is fine but I'm having a really hard time configuring the certificate for remote desktop connect and I would like to take advantage of this feature as I am creating some websites in the onStart event and I would like to peek into IIS. Some microsoft employees do agree that this is a bug and the have promised a fix this issue, refer to post . I am using VS2010 and I do not know how to fix this bug.

Can anyone please help, or point me to a place where I can get any help.

7 Answers 7

68

I ran into the same problem with a new solution.

Note that, unlike Eugenio Pace's response suggests, the error occurs only when deploying to Azure (and not when running the project in the Azure Compute Emulator).

Try adding the following line to the first property group of your Windows Azure Visual Studio Project file (*.ccproj):

<ServiceOutputDirectory>C:\Azure\</ServiceOutputDirectory>

The trailing slash (for whatever path you select) appears to be required. This folder will be deleted each time you create a package if it exists.

This setting seems to redirect the working folder for the package to a shorter base path, preventing the path too long error.

Credit goes to: http://govada.blogspot.com/2011/12/windows-azure-package-build-error.html

4
  • Works a treat, thankyou! Strangely enough, it's only just started happening after deploy fine for ages. I did enable remote debugging though.
    – Kieron
    Jan 5, 2015 at 14:03
  • 4
    Ran across this issue with the emulator environment also.
    – Quark Soup
    Apr 28, 2016 at 14:22
  • You saved me! I was trying to change my csx path and I couldn't figure it out! That trailing slash is DEFINITELY required, at least with VS 2015 / Azure SDK 2.8
    – aoetalks
    Jun 15, 2016 at 0:51
  • 2
    HUGE WARNING: Any folder you point this to will be erased entirely when you run. I pointed it to my D drive and it erased everything on my drive without any warning. So yes it works but be careful where you point it May 25, 2018 at 7:12
8

Perhaps the local folder used to store temporary development fabric is too long. See Windows Azure - Resolving "The Path is too long after being fully qualified" Error Message.

4

I was having this problem as well when deploying a Node.js project to Azure.

To fix it, I had to change my "TEMP" and "TMP" user environment variables to something shorter than their default values.

In my case, they were pointing by default to %USERPROFILE%\AppData\Local\Temp, changing them to C:\Temp solved it.

Make sure you restart Windows after.

0
2

The better solution may be to create a symbolic link to your project folder. This doesn't require moving files or changing system variables. Open up the command prompt as an administrator and run this:

mklink /D C:\Dev C:\Users\danzo\Source\Workspaces

Obviously you can change "C:\Dev" to whatever you want it to be and you'll need to change the longer path above to the root directory of your soltions/projects folder.

0

Same problem happened to me when I try Packaging an Umbraco project for Azure (https://github.com/WindowsAzure-Accelerators/wa-accelerator-umbraco/wiki/Deployment), I found the solution is to: Copy and rename the long-name path and folder to "C:\someshortname".

(solution was suggested by this: link)

0

I tried all the above 2 approaches:

-change TEMP and TMP enviromental variables

-<ServiceOutputDirectory> path

and didn't work. In my case, I had to move the whole project to a shorter path C:\ and worked. I'm using W7 and VS12.

0

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\\AppData\Local\dftmp

Credit goes to Jim Nakashima of Microsoft : https://blogs.msdn.microsoft.com/jnak/2010/01/14/windows-azure-resolving-the-path-is-too-long-after-being-fully-qualified-error-message/

In order to change the temporary folder, a user environment variable has to be created :

It is named _CSRUN_STATE_DIRECTORY

Give it a value of short named directory like :

c:\AzureTemp

Don't forget to restart Visual Studio in order to have the environmennt variables to be read again

It fixed many compilations problem !

Not the answer you're looking for? Browse other questions tagged or ask your own question.