简体   繁体   English

什么是错误MSB4198:“表达式“ DirectoryName”无法求值”

[英]What is error MSB4198: “The expression ”DirectoryName“ cannot be evaluated”

I am compiling a project in Visual Studio after I upgraded it from version 2009 to 2012. At the very final stage, I am getting an error that reads: 从2009版本升级到2012之后,我正在Visual Studio中编译项目。在最后阶段,我收到一条错误消息:

error MSB4198: The expression "DirectoryName" cannot be evaluated on item "..\..\..\..\..\obj\win32\vs11.0\MyProject\debug\MyProject_debug.pch". 
               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.

I tried to search for the error and it seems to be some error in the linker (potentially due to conversion from VS version (?) ), but I can't find an appropriate solution. 我试图搜索错误,但似乎在链接器中有一些错误(可能是由于从VS版本(?)转换而来),但是我找不到合适的解决方案。 The value of Properties | 属性| Configuration Properties | 配置属性| Linker | 链接器| Output File in the project is $(OutDir)$(TargetName)$(TargetExt) , if that is any help. 如果有任何帮助,项目中的输出文件$(OutDir)$(TargetName)$(TargetExt)

Visual Studio is probably trying to convert a "DirectoryName", and in the process evaluated the directory path. Visual Studio可能正在尝试转换“ DirectoryName”,并在此过程中评估了目录路径。 That evaluation must have overflowed. 该评估肯定溢出了。

A common cause is trying to put your solution in My Documents . 一个常见的原因是试图将您的解决方案放入“ My Documents That's not as good an idea as it sounds, for precisely this reason. 正是由于这个原因,这听起来并不像一个好主意。 Microsoft has used up far too much of the allowed path length. Microsoft已经用完了太多的允许路径长度。 (They really should have copied Unix; /home/username is just 14 characters.) (他们确实应该复制了Unix; /home/username只是14个字符。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM