views:

102

answers:

4

Hi,

I'm getting an error in a VS2010 DB project that indicates I have too many charachters in my build path.

How can I change my default build path for all project types?

Something like

c:\build\$(projectname)\...... 

Thanks!

EDIT: I've moved my project to the root of the C: drive and I still get the error with my DB project. I get this error when I try to right click the project and select properties

An error occurred trying to load the project properties window. Close the window and try again. Cannot evaluate the item metadata "%(FullPath)". The item metadata "%(FullPath)" cannot be applied to the path "obj\Debug|Any CPU\TASS.DB.dbschema". Illegal characters in path. C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets

+1  A: 

I don't think it's possible to set a default build path for all projects, only the standard Debug/Release folders within the project itself. The only suggestion I would have is to simply move the project folder to location with a shorter path.

EDIT: As per the new edit, have a look here:

http://connect.microsoft.com/VisualStudio/feedback/details/594333/database-project-template-files-corrupt

Daniel Frear
Thanks djfrear. i've tried this, but still get the same error in my DB project. I've edited my question above
littlechris
edited my answer
Daniel Frear
A: 

In VS2010 you can select multiple projects at once in a solution, right-click them, select properties, then change properties for all them at once. This is dangerous, obviously, but if you know what you are doing I guess it would allow that. Maybe some things like build paths are even disabled, I haven't tried it.

Also, maybe the problem is that you are using $(path) instead of ${Path} ?

Jeremy Collake
A: 

In VS2010 you can select multiple projects in a solution, right-click them, select properties, then change properties for all them. This is dangerous, obviously, but if you know what you are doing I guess it would allow that.

Also: Maybe the issue is the '%(FullPath)' isn't getting properly resolved, % is an illegal character. I guess it may be different from the ${FullPath} I may be used to ;). Who knows.

Jeremy Collake
+2  A: 

The first thing that jumps out to me here is that your platform and configuration are being fused together to form "Debug|Any CPU" and a string is being made from that--the pipe is the character it's referencing there when it says there are illegal characters. I'm not sure how much your database project really differs with respect to debug/release and for architecture, but you may not even need to include them in the path.

Since you can't open the project property pages, you'll need to edit the msbuild directly by unloading it and selecting "Edit..." from the context menu (sorry if you know this already).

From there, assuming you're realling running up on the windows path length ceiling, you could use some msbuild trickery to maximize your headroom in there. Specifically, doing something similar to what you suggest: use the C:\ drive wherever possible.

To do this, look inside the PropertyGroups with the conditions for your Configuration & Platform configurations, and inside them replace the OutputPath and IntermediateOutputPath properties so that they're as short as possible, for example:

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
    <OutputPath>$(SystemDrive)\D\A</OutputPath>
    <IntermediateOutputPath>$(SystemDrive)\o\D\A</IntermediateOutputPath>
</PropertyGroup>
  • This saves some valuable characters in that instead of "Debug" you're using "D", "A" for "AnyCPU" and "o" for "obj".
  • Probably most importantly you're using C:\o\ for the intermediate build directory instead of C:\whatever-the-whole-path-is-to-your-project-file\obj. As well, this property isn't configurable from the property pages, from what I recall.
  • Some added flexibility there using SystemDrive instead of a hard-coded C:, not that I would really expect it to be different.

Finally, concerning your property pages load problem, I don't know how the Debug|AnyCPU got in your path (I don't know of any properties that store the concatenated flavor like that), but you should be able to pick it out pretty easily once you open up the file. Hopefully it's similar to load errors in something like the winforms designer where you change one line and suddenly the whole thing works again.

Hope this helps!

bwerks
thanks for this but unfortunately it made no difference. i believe its something to do with one of my extensions. I'm going to test this and I'll edit my posit if I identify the problem. I appreciate your post. Well written and easy to follow :)
littlechris
Thanks for the critique! Sorry this didn't get it done for you. I guess it must be something screwy with the database project files. I'd be happy to look over yours if there's no IP-oriented risks involved. I'm quickly becoming an msbuild junkie ;)
bwerks
Thanks Bwerks. I think I found the problem extension. A set "tangible" extension I downloaded for T4 editing... not really sure why they would cause this, but I no longer need them so I wont be re-installing. your post didn't fixx my problem, but it did allow me to change build folders - so correct answer to my first Q! :)
littlechris
Much obliged! Happy I could help with that much at least.
bwerks