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

"Some projects have trouble loading" constantly appears when there are no problems #707

Closed
thurn opened this issue Aug 24, 2016 · 9 comments
Assignees
Milestone

Comments

@thurn
Copy link

thurn commented Aug 24, 2016

Environment data

% dotnet --info
.NET Command Line Tools (1.0.0-preview2-003121)

Product Information:
Version: 1.0.0-preview2-003121
Commit SHA-1 hash: 1e9d529bc5

Runtime Environment:
OS Name: Mac OS X
OS Version: 10.11
OS Platform: Darwin
RID: osx.10.11-x64

VS Code version: 1.4.0
C# Extension version: 1.3

Whenever I open VisualStudioCode, I get a warning message saying "some projects have trouble loading"

warning message

However, there are no issues apparent in the full output, and the plugin works correctly:

[INFO] Starting OmniSharp at '/Users/myusername/Dropbox/myproject/MyProject/MyProject.sln'...
[INFO] Started OmniSharp from '/Users/myusername/.vscode/extensions/ms-vscode.csharp-1.3.0/out/.omnisharp-mono/OmniSharp.exe' with process id 56742...
OmniSharp: -s /Users/myusername/Dropbox/myproject/MyProject/MyProject.sln --hostPID 56718 DotNet:enablePackageRestore=false --stdio
[INFORMATION:OmniSharp.Startup] Omnisharp server running using Stdio at location '/Users/myusername/Dropbox/myproject/MyProject' on host 56718.
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Initializing in /Users/myusername/Dropbox/myproject/MyProject
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Auto package restore: False
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Update workspace context
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Resolving projects references
[INFORMATION:OmniSharp#MSBuild] Detecting projects in '/Users/myusername/Dropbox/myproject/MyProject/MyProject.sln'.
[INFORMATION:OmniSharp#MSBuild] Loading project from '/Users/myusername/Dropbox/myproject/MyProject/Assembly-CSharp.csproj'.
[INFORMATION:OmniSharp#MSBuild] Loading project from '/Users/myusername/Dropbox/myproject/MyProject/Assembly-CSharp-Editor.csproj'.
[WARNING:OmniSharp#ProjectFileInfo] `GGCell' overrides Object.Equals(object) but does not override Object.GetHashCode()
[WARNING:OmniSharp#ProjectFileInfo] `GGCell' overrides Object.Equals(object) but does not override Object.GetHashCode()
[WARNING:OmniSharp#ProjectFileInfo] The variable `obj' is assigned but its value is never used
[WARNING:OmniSharp#ProjectFileInfo] The variable `obj' is assigned but its value is never used
[WARNING:OmniSharp#ProjectFileInfo] `UnityEngine.Object.FindSceneObjectsOfType(System.Type)' is obsolete: `use Object.FindObjectsOfType instead.'
[WARNING:OmniSharp#ProjectFileInfo] `UnityEngine.Object.FindSceneObjectsOfType(System.Type)' is obsolete: `use Object.FindObjectsOfType instead.'
[WARNING:OmniSharp#ProjectFileInfo] `UnityEngine.Object.FindSceneObjectsOfType(System.Type)' is obsolete: `use Object.FindObjectsOfType instead.'
[WARNING:OmniSharp#ProjectFileInfo] `UnityEngine.Object.FindSceneObjectsOfType(System.Type)' is obsolete: `use Object.FindObjectsOfType instead.'
[WARNING:OmniSharp#ProjectFileInfo] The variable `wasValid' is assigned but its value is never used
[WARNING:OmniSharp#ProjectFileInfo] The variable `wasValid' is assigned but its value is never used
[WARNING:OmniSharp#ProjectFileInfo] The variable `nextRange' is assigned but its value is never used
[WARNING:OmniSharp#ProjectFileInfo] The variable `nextRange' is assigned but its value is never used
[WARNING:OmniSharp#ProjectFileInfo] `UnityEngine.GameObject.active' is obsolete: `GameObject.active is obsolete. Use GameObject.SetActive(), GameObject.activeSelf or GameObject.activeInHierarchy.'
[WARNING:OmniSharp#ProjectFileInfo] `UnityEngine.GameObject.active' is obsolete: `GameObject.active is obsolete. Use GameObject.SetActive(), GameObject.activeSelf or GameObject.activeInHierarchy.'
[WARNING:OmniSharp#ProjectFileInfo] `UnityEngine.GameObject.active' is obsolete: `GameObject.active is obsolete. Use GameObject.SetActive(), GameObject.activeSelf or GameObject.activeInHierarchy.'
[WARNING:OmniSharp#ProjectFileInfo] `UnityEngine.GameObject.active' is obsolete: `GameObject.active is obsolete. Use GameObject.SetActive(), GameObject.activeSelf or GameObject.activeInHierarchy.'
[WARNING:OmniSharp#ProjectFileInfo] `UnityEngine.GameObject.active' is obsolete: `GameObject.active is obsolete. Use GameObject.SetActive(), GameObject.activeSelf or GameObject.activeInHierarchy.'
[WARNING:OmniSharp#ProjectFileInfo] `UnityEngine.GameObject.active' is obsolete: `GameObject.active is obsolete. Use GameObject.SetActive(), GameObject.activeSelf or GameObject.activeInHierarchy.'
[WARNING:OmniSharp#ProjectFileInfo] The private field `GameGridNavigator.navigating' is assigned but its value is never used
[WARNING:OmniSharp#ProjectFileInfo] The private field `GameGridNavigator.navigating' is assigned but its value is never used
[WARNING:OmniSharp#ProjectFileInfo] The private field `GGGrid.ms_oGlobalQueryList' is assigned but its value is never used
[WARNING:OmniSharp#ProjectFileInfo] The private field `GGGrid.ms_oGlobalQueryList' is assigned but its value is never used
/Users/myusername/Dropbox/myproject/MyProject/Assembly-CSharp-Editor.csproj

[INFORMATION:OmniSharp.ScriptCs.ScriptCsProjectSystem] Detecting CSX files in '/Users/myusername/Dropbox/myproject/MyProject'.
[INFORMATION:OmniSharp.ScriptCs.ScriptCsProjectSystem] Could not find any CSX files
[INFORMATION:OmniSharp.Startup] Configuration finished.
@DustinCampbell DustinCampbell added this to the 1.5 milestone Aug 27, 2016
@DustinCampbell
Copy link
Member

I've seen the same thing -- especially for Unity projects.

@MetaDev
Copy link

MetaDev commented Sep 19, 2016

Any fix for this?

@DustinCampbell
Copy link
Member

It looks to me like this will be display for any project that contains warnings: https://github.com/OmniSharp/omnisharp-vscode/blob/d96fb0c6864b133a45f6a36bee5d45fc1885663d/src/features/status.ts#L236-L242

@DustinCampbell DustinCampbell modified the milestones: 2.0, 1.5 Nov 11, 2016
@DustinCampbell DustinCampbell modified the milestones: 1.7, 1.6 Dec 14, 2016
@jamesqo
Copy link
Contributor

jamesqo commented Dec 25, 2016

I am also experiencing this very frequently, and it keeps reappearing whenever I close it. Is there a keyboard shortcut to temporarily disable OmniSharp when this happens?

@bbugh
Copy link

bbugh commented Jan 20, 2017

I get this all the time too, and it's not only when project contains warnings. It seems like Omnisharp gets out of date with the reality of the project, and then starts to complain about false warnings.

Most commonly, the warning is about Type X doesn't exist in the current context (but it actually does) or The type X conflicts with imported type X from Assembly-Csharp-firstpass (where type X is the class in the current file, it can't conflict with itself).

Restarting Omnisharp always clears out these false warnings, but I'm having to restart Omnisharp once every 5-10 minutes now. There are no actual warnings or errors in my project, just these constant false hits.

@jamesqo you can dismiss the error with escape, or restart Omnisharp with the command palette.

@felschr
Copy link

felschr commented Feb 7, 2017

Great to see this fixed now!

@bbugh
v1.7.0-beta4 also seems to have fixed the Type X doesn't exist in the current context errors for me.

@bbugh
Copy link

bbugh commented Feb 7, 2017

Awesome! Thanks so much for working on this @DustinCampbell. I hate to be the bearer of bad news, but the installation didn't quite work for me out of the box.

When I installed v1.7.0-beta4.vsix, it seemed to properly download all of the libraries, which I've never seen before. However, when Omnisharp ran, it threw an exception looking for ~/.vscode/extensions/ms-vscode.csharp-1.7.0-beta4/bin/gac. Omnisharp and Intellisense were not working at all. I verified that omnisharp.useMono was set to the default of false.

I was able to work around the problem by sym linking my global Mono package gacdirectory into the extension bin folder. I'm not sure if this is a good long-term solution but it's working for me. And as @felschr said, I'm not getting any of the many compilation warnings anymore, so I don't have to keep restarting Omnisharp. Amazing!!!

Here's what I did to work around it:

» cd ~/.vscode/extensions/ms-vscode.csharp-1.7.0-beta4/bin 
» ln -s /Library/Frameworks/Mono.framework/Versions/4.6.2/lib/mono/gac

Here's the stack trace from the error:

[fail]: OmniSharp.MSBuild.ProjectFile.ProjectFileInfo
        The "GetReferenceAssemblyPaths" task failed unexpectedly.
This is an unhandled exception from a task -- PLEASE OPEN A BUG AGAINST THE TASK OWNER.
System.IO.DirectoryNotFoundException: Directory '/Users/bbugh/.vscode/extensions/ms-vscode.csharp-1.7.0-beta4/bin/gac' not found.
  at System.IO.Directory.ValidateDirectoryListing (System.String path, System.String searchPattern, System.Boolean& stop) [0x00091] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at System.IO.Directory+<EnumerateKind>c__Iterator0.MoveNext () [0x00040] in <12e050e5b3d34326a1b4e2e7624e75da>:0 
  at Microsoft.Build.Tasks.NativeMethods+AssemblyCacheEnum+<GetEnumerator>d__8.MoveNext () [0x0040c] in <143d5f83a5f54af3ba7d438f1991d890>:0 
  at Microsoft.Build.Tasks.GlobalAssemblyCache.GenerateListOfAssembliesByRuntime (System.String strongName, Microsoft.Build.Tasks.GetAssemblyRuntimeVersion getRuntimeVersion, System.Version targetedRuntime, Microsoft.Build.Shared.FileExists fileExists, Microsoft.Build.Tasks.GetPathFromFusionName getPathFromFusionName, Microsoft.Build.Tasks.GetGacEnumerator getGacEnumerator, System.Boolean specificVersion) [0x00101] in <143d5f83a5f54af3ba7d438f1991d890>:0 
  at Microsoft.Build.Tasks.GlobalAssemblyCache.GetLocationImpl (Microsoft.Build.Shared.AssemblyNameExtension assemblyName, System.String targetProcessorArchitecture, Microsoft.Build.Tasks.GetAssemblyRuntimeVersion getRuntimeVersion, System.Version targetedRuntime, Microsoft.Build.Shared.FileExists fileExists, Microsoft.Build.Tasks.GetPathFromFusionName getPathFromFusionName, Microsoft.Build.Tasks.GetGacEnumerator getGacEnumerator, System.Boolean specificVersion) [0x00050] in <143d5f83a5f54af3ba7d438f1991d890>:0 
  at Microsoft.Build.Tasks.GlobalAssemblyCache.GetLocation (Microsoft.Build.Framework.IBuildEngine4 buildEngine, Microsoft.Build.Shared.AssemblyNameExtension strongName, System.Reflection.ProcessorArchitecture targetProcessorArchitecture, Microsoft.Build.Tasks.GetAssemblyRuntimeVersion getRuntimeVersion, System.Version targetedRuntimeVersion, System.Boolean fullFusionName, Microsoft.Build.Shared.FileExists fileExists, Microsoft.Build.Tasks.GetPathFromFusionName getPathFromFusionName, Microsoft.Build.Tasks.GetGacEnumerator getGacEnumerator, System.Boolean specificVersion) [0x00249] in <143d5f83a5f54af3ba7d438f1991d890>:0 
  at Microsoft.Build.Tasks.GlobalAssemblyCache.GetLocation (Microsoft.Build.Shared.AssemblyNameExtension strongName, System.Reflection.ProcessorArchitecture targetProcessorArchitecture, Microsoft.Build.Tasks.GetAssemblyRuntimeVersion getRuntimeVersion, System.Version targetedRuntimeVersion, System.Boolean fullFusionName, Microsoft.Build.Shared.FileExists fileExists, Microsoft.Build.Tasks.GetPathFromFusionName getPathFromFusionName, Microsoft.Build.Tasks.GetGacEnumerator getGacEnumerator, System.Boolean specificVersion) [0x00001] in <143d5f83a5f54af3ba7d438f1991d890>:0 
  at Microsoft.Build.Tasks.GetReferenceAssemblyPaths.Execute () [0x000be] in <143d5f83a5f54af3ba7d438f1991d890>:0 
  at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x0002a] in <8e7dda278d744577a42b396aa935bf89>:0 
  at Microsoft.Build.BackEnd.TaskBuilder+<ExecuteInstantiatedTask>d__26.MoveNext () [0x002bf] in <8e7dda278d744577a42b396aa935bf89>:0 

@DustinCampbell
Copy link
Member

I wouldn't symlink that folder. That could cause other problems down the road. However, it looks like this issue was already filed at #1192. I'll work on getting a repro and fixing this.

@ruslansmax
Copy link

check folder url from special characters like !@#$%^&*() and delete those characters

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

No branches or pull requests

7 participants