在Visual Studio中进行构建时,如何解决路径过长的问题

时间:2019-07-05 18:27:30

标签: c++ visual-studio path

我正在尝试构建Visual Studio解决方案。我收到此错误:

Severity    Code    Description Project File    Line    Suppression State
Error   MSB3491 Could not write lines to file "TMSRWithContrastEnhanceService-904778-Win10-X64.dir\Debug\TMSRWithContrastEnhanceService-904778-Win10-X64.vcxproj.FileListAbsolute.txt". 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.   TMSRWithContrastEnhanceService-904778-Win10-X64 C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets 4626

我无法更改项目名称,我的项目路径很短。路径的字符数为196,路径和文件名的字符数为247。这些都在指定的限制内,所以我不确定为什么会出现错误。

这是出现错误的文件:

C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets

这是显示错误的行(第4626行):

<WriteLinesToFile File="$(IntermediateOutputPath)$(CleanFile)" Lines="@(_CleanUniqueRemainingFileWrites)" Overwrite="true" />

我去启用了注册表编辑器中的“ LongPathsEnabled”,但是,它已经被启用了。

有什么办法可以解决这个错误?

0 个答案:

没有答案