gpt4 book ai didi

c# - Visual Studio - 路径中的非法字符

转载 作者:太空狗 更新时间:2023-10-29 20:56:10 26 4
gpt4 key购买 nike

这发生在 Visual Studio Community 2017 最新更新之后。每次我尝试打开我的项目时,我都会收到以下警告:

Warning IDE0006 Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled. Core.Tests

然后当我运行构建时,我得到:

Error The "ResolvePackageFileConflicts" task failed unexpectedly. System.ArgumentException: Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
at System.IO.Path.GetFileName(String path)
at Microsoft.NET.Build.Tasks.ItemUtilities.GetTargetPath(ITaskItem item)
at Microsoft.NET.Build.Tasks.ItemUtilities.GetReferenceTargetPath(ITaskItem item)
at Microsoft.NET.Build.Tasks.ConflictResolution.ResolvePackageFileConflicts.<>c. < ExecuteCore > b__35_1(ConflictItem ci)
at Microsoft.NET.Build.Tasks.ConflictResolution.ConflictResolver`1.ResolveConflicts(IEnumerable`1 conflictItems, Func`2 getItemKey, Action`1 foundConflict, Boolean commitWinner, Action`1 unresolvedConflict)
at Microsoft.NET.Build.Tasks.ConflictResolution.ResolvePackageFileConflicts.ExecuteCore()
at Microsoft.NET.Build.Tasks.TaskBase.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.< ExecuteInstantiatedTask >d__26.MoveNext() Core.Tests

之后

Error CS0006 Metadata file 'C:\tmp\backend\Tests\DataLoader.Tests\bin\Debug\DataLoader.Tests.dll' could not be found EResourceConnector.Tests C:\tmp\backend\Tests\EResourceConnector.Tests\CSC 1 Active

项目路径仅使用拉丁字符。在构建服务器上,构建工作正常,但在上次更新 VS 后在我的计算机上没有。我尝试重新安装 VS,但没有帮助。

那么这个问题是否有任何解决方案或至少有提示?

编辑:我试图排除受此问题影响且有效的文件。但这不是我的问题的解决方案。有趣的是,只有受影响的文件是单元测试。

EDIT2:我尝试使用最新的 Visual Studio 2017 在全新的 Windows 10 上构建整个解决方案,但失败了,所以这显然是我的解决方案的问题,但仅限于新版本的 VS。我在 Visual Studio 2015 上尝试了我的解决方案,构建工作正常。

无论如何,例如 Core.Test.csproj 文件就是导致该问题的文件之一。 https://pastebin.com/kq7MFLV1

ScreenShot of the errors from this project.

最佳答案

在您的情况下,问题在于以下引用中的行返回:

<Reference Include="System.Collections.Immutable, Version=1.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>
..\..\packages\System.Collections.Immutable.1.3.1\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll
</HintPath>
</Reference>

将此更改为:

 <Reference Include="System.Collections.Immutable, Version=1.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>..\..\packages\System.Collections.Immutable.1.3.1\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
</Reference>

关于c# - Visual Studio - 路径中的非法字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45796041/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com