[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1800
  • Last Modified:

Error adding new project to solution in Visual Studo 2010

I have a pecular problem.  I am currently working on a VS2010 solution.  In this solution, there are several projects who's path lengths are 168+ characters long.  When I attempt to add a project to this solution, the following error appears when I am typing the 156th character of the path:

"The length of the full path for the solution, project or item you are creating exceeds the maximum path length allowed by the system.  You must reduce the length of the name or the location"

After doing a bit of research, I read that the path length could not be more than 259 characters.  Why is this error appearing when the length is plenty below the 259 char limit?  Does anybody know how to view/edit where this limit is set?  Can this limit be changed?

Thanks,

Sergio
0
Courts-Tech
Asked:
Courts-Tech
  • 2
  • 2
1 Solution
 
Jacques Bourgeois (James Burger)Commented:
Could you post a screen shot of your Add New Project form when you type in the information?
0
 
Courts-TechAuthor Commented:
Sure.  Here it is.  The error occurs when I try typing the "P" after "IDE" Error when attempting to add project to solution.
0
 
Jacques Bourgeois (James Burger)Commented:
Just for the root directory of your new project, you need at least 184 characters:

"C:\Users\valdez\Documents\Visual Studio 2010\Projects\CIV-159464\IDEP - Indigent Defense Enhancement Project\DEV\Travis.Courts.IDEP\Travis.Cours.Model.IDE\Travis.Cours.Model.IDE.vbproj"

Do not forget that the system must also create directories under the one you are specifying. If you add the following, that is typically created in many C# applications, we are up to 254:

"\ojb\Release\Travis.Court.Model.IDE.csproj.ResolveComReference.cache"

This is in a Windows application. Could it be worse in an ASP application?

Awfully close to the limit if 259 is really the limit.

Then, the maximum of 259 is not an absolute. You read different values depending on where you look at. It depends not only on the operating system, but also a few other factors such as the way the hard disk is formatted. Unfortunately, they were not nice enought to give us that through a property somewhere in the framework.

And I am quite sure that Visual Studio is conservative about the maximum number of characters. It may for instance take into accounts the indirection that the system use for compatibility with old systems. C:\Users can also be called by C:\Documents and Settings. I would rather be told when creating a project that I am close to the limit, than end up with an error in the middle of development.

The solution might not be to your liking, but it would be to create that project somewhere else. Why not store the new project under your DEV subfolder?

And you will have learned something. Give shorter name to your project directories. Personnaly I even moved mine under C:\Prog, a lot shorter than C:\Users\<Name>\Documents\Visual Studio 2010. It is evident that those guys never worked on computers with cramped hard disks and memory.
0
 
Courts-TechAuthor Commented:
Thanks, that makes sense.  By the way, I did find a workaround for this.  Using another instance of VS2010, I created the project under C:\Temp.  I then copied the project to my original solution path, then use the Add An Existing Item function.  It worked.  I will consider moving the solution to another location to avoid any this problem in the future.
0

Featured Post

Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now