The project system 'DotNetProjectSystem' threw exception during initialization. The specified path, file name, or both are too long
See original GitHub issueWhen editing my project even the slightest space breaks the omnisharp service with the following errors. Seems like a windows max path issue to me but don’t seem to make any sense. I tried to copy my project from the c:\Users\[username]\Repos\[solution]\[projectname]\
to a shallow location in c:\[projectname]
and it worked did not work after all. The length of the path is about 60 characters long anyway (way shorter than 248).
Since I like my solutions organized I would like to know If this is considered a bug and will be fixed in future versions.
Cheers and keep up the good work.
The error
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Processing [ProjectState] MyCoreApp.WebApi/.NETCoreApp,Version=v1.0 [ERROR:OmniSharp.Startup] The project system ‘DotNetProjectSystem’ threw exception during initialization. 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. at System.IO.PathHelper.GetFullPathName() at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths) at System.IO.Path.GetFullPathInternal(String path) at System.IO.FileSystemEnumerableIterator
1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler
1 resultHandler, Boolean checkHost) at System.IO.DirectoryInfo.EnumerateFileSystemInfos(String searchPattern, SearchOption searchOption) at Microsoft.Extensions.FileSystemGlobbing.Abstractions.DirectoryInfoWrapper.<EnumerateFileSystemInfos>d__3.MoveNext() at System.Collections.Generic.List1.InsertRange(Int32 index, IEnumerable
1 collection) at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath) at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath) at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath) at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath) at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath) at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath) at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath) at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath) at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath) at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath) at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath) at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath) at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath) at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath) at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath) at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath) at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Execute() at Microsoft.Extensions.FileSystemGlobbing.MatcherExtensions.GetResultsInFullPath(Matcher matcher, String directoryPath) at Microsoft.DotNet.ProjectModel.Files.PatternGroup.SearchFiles(String rootPath) at Microsoft.DotNet.ProjectModel.Files.ProjectFilesCollection.get_SourceFiles() at OmniSharp.DotNet.Tools.ProjectContextLens.Resolve() in C:\projects\omnisharp-roslyn\src\OmniSharp.DotNet\Tools\ProjectContextLens.cs:line 41 at OmniSharp.DotNet.DotNetProjectSystem.Update(Boolean allowRestore) in C:\projects\omnisharp-roslyn\src\OmniSharp.DotNet\DotNetProjectSystem.cs:line 134 at OmniSharp.DotNet.DotNetProjectSystem.Initalize(IConfiguration configuration) in C:\projects\omnisharp-roslyn\src\OmniSharp.DotNet\DotNetProjectSystem.cs:line 108 at OmniSharp.Startup.Configure(IApplicationBuilder app, IServiceProvider serviceProvider, IOmnisharpEnvironment env, ILoggerFactory loggerFactory, ISharedTextWriter writer, IOmnisharpAssemblyLoader loader, IOptions`1 optionsAccessor) in C:\projects\omnisharp-roslyn\src\OmniSharp.Host\Startup.cs:line 182 [INFORMATION:OmniSharp.MSBuild.MSBuildProjectSystem] No solution files found in ‘c:\Users\cleft\Source\Repos\helintec\helintec.Forms.Web’ [INFORMATION:OmniSharp.ScriptCs.ScriptCsProjectSystem] Detecting CSX files in ‘c:\Users\cleft\Source\Repos\helintec\helintec.Forms.Web’. [INFORMATION:OmniSharp.ScriptCs.ScriptCsProjectSystem] Could not find any CSX files [INFORMATION:OmniSharp.Startup] Configuration finished. [ERROR:Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware] An unhandled exception has occurred: 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. [ERROR:Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware] An unhandled exception has occurred: 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. [INFORMATION:OmniSharp.Middleware.LoggingMiddleware] /projects: 500 351ms [INFORMATION:OmniSharp.Middleware.LoggingMiddleware] /projects: 500 283ms [ERROR:Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware] An unhandled exception has occurred: 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. [ERROR:Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware] An unhandled exception has occurred: 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. [INFORMATION:OmniSharp.Middleware.LoggingMiddleware] /projects: 500 250ms [INFORMATION:OmniSharp.Middleware.LoggingMiddleware] /projects: 500 250ms
my setup:
.NET Command Line Tools (1.0.0-rc2-002659)
Product Information: Version: 1.0.0-rc2-002659 Commit Sha: 11a001706f
Runtime Environment: OS Name: Windows OS Version: 10.0.14295 OS Platform: Windows RID: win10-x64
I run on Vs Code insiders v 1.1.0-insider
and have installed the RC2 Release Candidate for 4/29.
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (6 by maintainers)
Top GitHub Comments
@troydai One more thing I noticed. I am currently running on the latest dotnet core where the
project.json
schema has changed (announcement). The omnisharp plugin currently supports ignoring folders the old way.This means that the
RC2 Release Candidate for 4/29
needsexclude
member to be outside ofbuildOptions
.@troydai Wow I added the exclude property like so
"exclude": "node_modules"
and now it works. But why?? Is it scanning forc#
everywhere under the root directory… probably.Why is this still an issue even for dotnet core.? I thought dotnet core gave an excellent opportunity for breaking changes so why not getting rid of the old 260 character path length limit?. Beats me …
Thanks for the help.