Solved

Error adding new project to solution in Visual Studo 2010

Posted on 2011-09-21
4
1,677 Views
Last Modified: 2012-05-12
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
Comment
Question by:Courts-Tech
  • 2
  • 2
4 Comments
 
LVL 40
ID: 36576242
Could you post a screen shot of your Add New Project form when you type in the information?
0
 

Author Comment

by:Courts-Tech
ID: 36576386
Sure.  Here it is.  The error occurs when I try typing the "P" after "IDE" Error when attempting to add project to solution.
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 250 total points
ID: 36576782
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
 

Author Comment

by:Courts-Tech
ID: 36576966
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question