Visual Studio和一个项目引用路径的最大长度 [英] Visual Studio and maximum length of the path of a project reference

查看:1039
本文介绍了Visual Studio和一个项目引用路径的最大长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一些项目,并在文件夹结构中的每个生命深。当一组项目需要引用一个项目在不同的文件夹中,基准可能会失败,因为相对路径是在VS太长。

We have a number of projects, and each lives deep in a folder structure. When one set of projects needs to reference a project in a different folder, the reference can fail because the relative path to is in VS is too long.

例如,项目1将是:

C:\ folderA \文件夹1 \ FOLDER2 ... \ folderN \ myProject1.csproj

C:\folderA\folder1\folder2...\folderN\myProject1.csproj

它引用了另一个项目:

C:\ FolderB中\文件夹1 \ FOLDER2 ... \ folderN \ myProject2.csproj

C:\folderB\folder1\folder2...\folderN\myProject2.csproj

在HintPath到基准存储为相对路径,如............ \ FolderB中\文件夹1 \ FOLDER2 ... \ folderN \ myProject2.csproj

The HintPath to the reference is stored as a relative path, as in ............\folderB\folder1\folder2...\folderN\myProject2.csproj

当VS加载溶液,它无法解决的参考,因为它建立的绝对路径包括许多../'s使得路径超过256个字符。而构建失败。

When VS loads the solution, it can't resolve the reference because the absolute path it builds includes numerous ../'s such that the path exceeds 256 characters. And the build fails.

我们通过编辑的csproj和投入绝对路径,这仅仅是愚蠢的解决它。

We fix it by editing the csproj and putting in an absolute path, which is just silly.

什么是最好的解决方案呢?

What is the best solution for this?

推荐答案

答案很简单 - 不这样做,也不会受到伤害。考虑较少的深层次结构,使相关项目,以接近生活。

Short answer - don't do that and it will not hurt. Consider less deep hierarchies and make related projects to live close.

MSBuild的是管理的应用程序和CLR有限制的约256个字符的路径/文件名长度...

MSBuild is managed application and CLR have restriction on path/file name length of about 256 characters...

这篇关于Visual Studio和一个项目引用路径的最大长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆