Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fail]: OmniSharp.MSBuild.ProjectLoader Unable to create directory "obj\Debug\netcoreapp3.1\RazorDeclaration\**\". Illegal characters #3527

Closed
JDillon522 opened this issue Jan 27, 2020 · 4 comments

Comments

@JDillon522
Copy link

Issue Description

My intellesense suddenly stopped working over the weekend with zero change to my dev environment (that I know of).

Steps to Reproduce

Unsure.

Expected Behavior

Intelleisense and code completion work.

Actual Behavior

Its little different from working in a vim.

Logs

The main error log seems to be this:

Unable to create directory "obj\Debug\netcoreapp3.1\RazorDeclaration**". Illegal characters

OmniSharp log

Starting OmniSharp server at 1/27/2020, 2:08:40 PM Target: c:\Users\userName\Desktop\Work\Project\ProjectSpa\ProjectApp.sln

OmniSharp server started.
Path: C:\Users\userName.vscode\extensions\ms-vscode.csharp-1.21.9.omnisharp\1.34.9\OmniSharp.exe
PID: 5228

Starting OmniSharp on Windows 6.2.9200.0 (x64)
info: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 16.3 - "C:\Users\userName.vscode\extensions\ms-vscode.csharp-1.21.9.omnisharp\1.34.9.msbuild\Current\Bin"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to 'C:\Users\userName.vscode\extensions\ms-vscode.csharp-1.21.9.omnisharp\1.34.9.msbuild\Current\Bin\MSBuild.exe'
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 16.3 - "C:\Users\userName.vscode\extensions\ms-vscode.csharp-1.21.9.omnisharp\1.34.9.msbuild\Current\Bin"
CscToolExe = csc.exe
CscToolPath = C:\Users\userName.vscode\extensions\ms-vscode.csharp-1.21.9.omnisharp\1.34.9.msbuild\Current\Bin\Roslyn
MSBuildExtensionsPath = C:\Users\userName.vscode\extensions\ms-vscode.csharp-1.21.9.omnisharp\1.34.9.msbuild
MSBuildToolsPath = C:\Users\userName.vscode\extensions\ms-vscode.csharp-1.21.9.omnisharp\1.34.9.msbuild\Current\Bin
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in 'c:\Users\userName\Desktop\Work\Project\ProjectSpa'.
info: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
Detecting projects in 'c:\Users\userName\Desktop\Work\Project\ProjectSpa\ProjectApp.sln'.
info: OmniSharp.MSBuild.ProjectManager
Queue project update for 'c:\Users\userName\Desktop\Work\Project\ProjectSpa\ProjectApp.csproj'
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in 'c:\Users\userName\Desktop\Work\Project\ProjectSpa'.
info: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
info: OmniSharp.MSBuild.ProjectManager
Loading project: c:\Users\userName\Desktop\Work\Project\ProjectSpa\ProjectApp.csproj
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.EditorConfigWorkspaceOptionsProvider, Order: 200
info: OmniSharp.WorkspaceInitializer
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location 'c:\Users\userName\Desktop\Work\Project\ProjectSpa' on host 13432.
fail: OmniSharp.MSBuild.ProjectLoader
Unable to create directory "obj\Debug\netcoreapp3.1\RazorDeclaration*". Illegal characters in path.
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file 'c:\Users\userName\Desktop\Work\Project\ProjectSpa\ProjectApp.csproj'.
c:\Users\userName\Desktop\Work\Project\ProjectSpa\ProjectApp.csproj
C:\Program Files\dotnet\sdk\3.1.101\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.Component.targets(97,5): Error: Unable to create directory "obj\Debug\netcoreapp3.1\RazorDeclaration*
". Illegal characters in path.

Attempted to update project that is not loaded: c:\Users\userName\Desktop\Work\Project\ProjectSpa\ProjectApp.csproj

C# log

Post the output from Output-->C# here

Environment information

VSCode version: 1.41.1
C# Extension: 1.21.9

Dotnet Information .NET Core SDK (reflecting any global.json): Version: 3.1.101 Commit: b377529961

Runtime Environment:
OS Name: Windows
OS Version: 10.0.17763
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.1.101\

Host (useful for support):
Version: 3.1.1
Commit: a1388f194c

.NET Core SDKs installed:
3.1.101 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download

Visual Studio Code Extensions
Extension Author Version
Angular-BeastCode Mikael 8.1.2
azure-account ms-vscode 0.8.8
azure-pipelines ms-azure-devops 1.165.1
code-spell-checker streetsidesoftware 1.7.22
csharp ms-vscode 1.21.9
Csharp-ASPNETCore rahulsahay 1.11.0
debugger-for-chrome msjsdiag 4.12.6
gitlens eamodio 10.2.0
JavaScriptSnippets xabikos 1.7.2
msbuild-project-tools tintoy 0.3.3
mssql ms-mssql 1.8.0
rainbow-csv mechatroner 1.5.0
razor-plus austincummings 0.1.4
team ms-vsts 1.161.0
vscode-azureappservice ms-azuretools 0.16.2
vscode-eslint dbaeumer 2.0.15
vscode-icons vscode-icons-team 9.7.0
vscode-npm-script eg2 0.3.10
vscode-nuget-package-manager jmrog 1.1.6
vscode-scss-formatter sibiraj-s 1.4.3
vscode-test-explorer hbenl 2.15.0
vscode-typescript-tslint-plugin ms-vscode 1.2.3
vscode-yaml redhat 0.6.1
xml DotJoshJohnson 2.5.0
@JoeRobich
Copy link
Member

@NTaylorMullen Is this a folder that you maintain?

@NTaylorMullen
Copy link
Contributor

@NTaylorMullen Is this a folder that you maintain?

Ya it is at our SDK layer. I'd imagine this would rear its head via dotnet build as well.

@JDillon522 does this happen when you dotnet build? Would you mind sharing a simple repro app?

@JDillon522
Copy link
Author

@NTaylorMullen I'm not sure. I can check.

I discovered the root issue was the MAX_PATH variable as seen here:
dotnet/msbuild#53

and I think this is related:
dotnet/msbuild#406

I have an angular project inside my .NET Core app and I like to logically nest my components even if they nest very deep. That nesting in addition to the fact that my project root started a few directories deep meant I hit that MAX_PATH quickly. I fixed it by moving my whole project to C://project_root

Annoying. I tried to ignore the whole ClientApp directory but it didnt work. I did restructure my whole solution to have the ClientApp in a separate project at the same level as the api project but it broke my deployment pipeline and I haven't taken the time to fix it.

@NTaylorMullen
Copy link
Contributor

Thanks for following up @JDillon522. Max path issues can definitely stink in windows development. I feel your pain!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants