System.IO.PathTooLongException - VS2022
- Dominant language
- C#
- Stars
- 5.5k
- Forks
- 1.5k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 133
Description
I recently installed VS2022 and attempted to build a solution that currently builds successful in VS2019, and got the below error:
```
> This is an unhandled exception in MSBuild -- PLEASE UPVOTE AN EXISTING ISSUE OR FILE A NEW ONE AT https://aka.ms/msbuild/unhandled.
> System.IO.PathTooLongException: Path: C:\xxx\xxxxxx\xxxxxxxx\xxxx\xxxxxxx\xxxxxxxxxxxxxxxxx\xxx\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\xxxxxxxx\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL exceeds the OS max path limit. The fully qualified file name must be less than 260 characters.
> at Microsoft.Build.Shared.FileUtilities.GetFullPath(String path)
> at Microsoft.Build.Shared.FileUtilities.NormalizePath(String path)
> at Microsoft.Build.Shared.FileUtilities.GetFullPath(String fileSpec, String currentDirectory)
> at Microsoft.Build.Evaluation.LazyItemEvaluator`4.LazyItemList.ProcessNonWildCardItemUpdates(Dictionary`2 itemsWithNoWildcards, Builder items)
> at Microsoft.Build.Evaluation.LazyItemEvaluator`4.LazyItemList.ComputeItems(LazyItemList lazyItemList, ImmutableHashSet`1 globsToIgnore)
> at Microsoft.Build.Evaluation.LazyItemEvaluator`4.LazyItemList.GetItemData(ImmutableHashSet`1 globsToIgnore)
> at System.Linq.Enumerable.d__17`2.MoveNext()
> at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
> at System.Linq.OrderedEnumerable`1.d__1.MoveNext()
> at Microsoft.Build.Evaluation.Evaluator`4.Evaluate()
> at Microsoft.Build.Evaluation.Evaluator`4.Evaluate(IEvaluatorData`4 data, Project project, ProjectRootElement root, ProjectLoadSettings loadSettings, Int32 maxNodeCount, PropertyDictionary`1 environmentProperties, ILoggingService loggingService, IItemFactory`2 itemFactory, IToolsetProvider toolsetProvider, ProjectRootElementCacheBase projectRootElementCache, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, EvaluationContext evaluationContext, Boolean interactive)
> at Microsoft.Build.Execution.ProjectInstance.Initialize(ProjectRootElement xml, IDictionary`2 globalProperties, String explicitToolsVersion, String explicitSubToolsetVersion, Int32 visualStudioVersionFromSolution, BuildParameters buildParameters, ILoggingService loggingService, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, Nullable`1 projectLoadSettings, EvaluationContext evaluationContext)
> at Microsoft.Build.BackEnd.BuildRequestConfiguration.<>c__DisplayClass60_0.b__0()
> at Microsoft.Build.BackEnd.BuildRequestConfiguration.InitializeProject(BuildParameters buildParameters, Func`1 loadProjectFromFile)
> at Microsoft.Build.BackEnd.RequestBuilder.d__68.MoveNext()
> --- End of stack trace from previous location where exception was thrown ---
> at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
> at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
> at Microsoft.Build.BackEnd.RequestBuilder.d__59.MoveNext() Converter
```
Using
- MSBuild version 17.5.1+f6fdcf537 for .NET Framework
- VS Professional 2022 (64-bit) version 17.5.3
Not too sure why this issue is creeping back into MSBuild as I'm sure it was resolved in VS 2019
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.