Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Omnisharp won't update project?

Discussion in 'Scripting' started by Kartashuvit, Mar 4, 2021.

  1. Kartashuvit

    Kartashuvit

    Joined:
    Jul 4, 2019
    Posts:
    1
    I launched my project today, opened one of my scripts via Visual Studio and I get the following error message:

    [fail]: OmniSharp.MSBuild.ProjectManager
    Attempted to update project that is not loaded: c:\Users\karta\Desktop\Unity Projects\2D Platformer Project\Assembly-CSharp.csproj

    This has never happened before, and I don't understand why it is happening now. Intellisense is not working at all.. Is this an issue on Microsoft's end with Visual Studio? I also have the following warning message:

    WRN: Assembly binding logging is turned OFF.
    To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
    Note: There is some performance penalty associated with assembly bind failure logging.
    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

    Could that have something to do with it? Full Omnisharp log below:

    Code (CSharp):
    1. Starting OmniSharp server at 2021-03-04, 9:56:31 a.m.
    2.     Target: c:\Users\karta\Desktop\Unity Projects\2D Platformer Project\2D Platformer Project.sln
    3.  
    4. OmniSharp server started.
    5.     Path: c:\Users\karta\.vscode\extensions\ms-dotnettools.csharp-1.23.9\.omnisharp\1.37.7\OmniSharp.exe
    6.     PID: 29152
    7.  
    8. [info]: OmniSharp.Stdio.Host
    9.         Starting OmniSharp on Windows 6.2.9200.0 (x64)
    10. [info]: OmniSharp.Services.DotNetCliService
    11.         DotNetPath set to dotnet
    12. [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
    13.         Located 1 MSBuild instance(s)
    14.             1: StandAlone 16.9.0 - "c:\Users\karta\.vscode\extensions\ms-dotnettools.csharp-1.23.9\.omnisharp\1.37.7\.msbuild\Current\Bin"
    15. [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
    16.         MSBUILD_EXE_PATH environment variable set to 'c:\Users\karta\.vscode\extensions\ms-dotnettools.csharp-1.23.9\.omnisharp\1.37.7\.msbuild\Current\Bin\MSBuild.exe'
    17. [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
    18.         Registered MSBuild instance: StandAlone 16.9.0 - "c:\Users\karta\.vscode\extensions\ms-dotnettools.csharp-1.23.9\.omnisharp\1.37.7\.msbuild\Current\Bin"
    19.             CscToolExe = csc.exe
    20.             CscToolPath = c:\Users\karta\.vscode\extensions\ms-dotnettools.csharp-1.23.9\.omnisharp\1.37.7\.msbuild\Current\Bin\Roslyn
    21.             MSBuildExtensionsPath = c:\Users\karta\.vscode\extensions\ms-dotnettools.csharp-1.23.9\.omnisharp\1.37.7\.msbuild
    22.             MSBuildToolsPath = c:\Users\karta\.vscode\extensions\ms-dotnettools.csharp-1.23.9\.omnisharp\1.37.7\.msbuild\Current\Bin
    23. [info]: OmniSharp.WorkspaceInitializer
    24.         Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
    25. [info]: OmniSharp.WorkspaceInitializer
    26.         Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionOptionsProvider, Order: 0
    27. [info]: OmniSharp.WorkspaceInitializer
    28.         Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
    29. [info]: OmniSharp.WorkspaceInitializer
    30.         Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
    31. [info]: OmniSharp.WorkspaceInitializer
    32.         Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
    33. [info]: OmniSharp.Cake.CakeProjectSystem
    34.         Detecting Cake files in 'c:\Users\karta\Desktop\Unity Projects\2D Platformer Project'.
    35. [info]: OmniSharp.Cake.CakeProjectSystem
    36.         Could not find any Cake files
    37. [info]: OmniSharp.MSBuild.ProjectSystem
    38.         Detecting projects in 'c:\Users\karta\Desktop\Unity Projects\2D Platformer Project\2D Platformer Project.sln'.
    39. [info]: OmniSharp.MSBuild.ProjectManager
    40.         Queue project update for 'c:\Users\karta\Desktop\Unity Projects\2D Platformer Project\Assembly-CSharp.csproj'
    41. [info]: OmniSharp.Script.ScriptProjectSystem
    42.         Detecting CSX files in 'c:\Users\karta\Desktop\Unity Projects\2D Platformer Project'.
    43. [info]: OmniSharp.Script.ScriptProjectSystem
    44.         Could not find any CSX files
    45. [info]: OmniSharp.WorkspaceInitializer
    46.         Configuration finished.
    47. [info]: OmniSharp.Stdio.Host
    48.         Omnisharp server running using Stdio at location 'c:\Users\karta\Desktop\Unity Projects\2D Platformer Project' on host 36852.
    49. [info]: OmniSharp.MSBuild.ProjectManager
    50.         Loading project: c:\Users\karta\Desktop\Unity Projects\2D Platformer Project\Assembly-CSharp.csproj
    51. [warn]: OmniSharp.MSBuild.ProjectManager
    52.         Failed to load project file 'c:\Users\karta\Desktop\Unity Projects\2D Platformer Project\Assembly-CSharp.csproj'.
    53. c:\Users\karta\Desktop\Unity Projects\2D Platformer Project\Assembly-CSharp.csproj(0,0)
    54. System.IO.FileNotFoundException: Could not load file or assembly 'System.Threading.Tasks.Dataflow, Version=4.6.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
    55. File name: 'System.Threading.Tasks.Dataflow, Version=4.6.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
    56.    at Microsoft.Build.BackEnd.Logging.LoggingService.ProcessLoggingEvent(Object buildEvent, Boolean allowThrottling)
    57.    at Microsoft.Build.BackEnd.Logging.LoggingService.LogProjectEvaluationStarted(BuildEventContext projectEvaluationEventContext, String projectFile)
    58.    at Microsoft.Build.Evaluation.Evaluator`4.Evaluate()
    59.    at Microsoft.Build.Evaluation.Evaluator`4.Evaluate(IEvaluatorData`4 data, 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)
    60.    at Microsoft.Build.Evaluation.Project.ProjectImpl.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
    61.    at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
    62.    at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(EvaluationContext evaluationContext)
    63.    at Microsoft.Build.Evaluation.Project.ProjectImpl.Initialize(IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
    64.    at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
    65.    at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary`2 globalProperties, String toolsVersion)
    66.    at OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore(String filePath, IReadOnlyDictionary`2 projectConfigurationsInSolution) in D:\a\1\s\src\OmniSharp.MSBuild\ProjectLoader.cs:line 157
    67.    at OmniSharp.MSBuild.ProjectLoader.BuildProject(String filePath, IReadOnlyDictionary`2 configurationsInSolution) in D:\a\1\s\src\OmniSharp.MSBuild\ProjectLoader.cs:line 75
    68.    at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load(String filePath, ProjectIdInfo projectIdInfo, ProjectLoader loader, Guid sessionId, DotNetInfo dotNetInfo) in D:\a\1\s\src\OmniSharp.MSBuild\ProjectFile\ProjectFileInfo.cs:line 116
    69.    at OmniSharp.MSBuild.ProjectManager.<>c__DisplayClass31_0.<LoadProject>b__0() in D:\a\1\s\src\OmniSharp.MSBuild\ProjectManager.cs:line 304
    70.    at OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject(String projectFilePath, Func`1 loader) in D:\a\1\s\src\OmniSharp.MSBuild\ProjectManager.cs:line 315
    71.  
    72. WRN: Assembly binding logging is turned OFF.
    73. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
    74. Note: There is some performance penalty associated with assembly bind failure logging.
    75. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
    76.  
    77.  
    78. [fail]: OmniSharp.MSBuild.ProjectManager
    79.         Attempted to update project that is not loaded: c:\Users\karta\Desktop\Unity Projects\2D Platformer Project\Assembly-CSharp.csproj
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,514
    I've never seen even one person use this Omnisharp thing in a Unity context.

    Either way, this may help you with intellisense problems, which might fix up your actual issue:

    https://forum.unity.com/threads/intellisense-not-working-with-visual-studio-fix.836599/

    Also, try update the VSCode package inside of Unity: Window -> Package Manager -> Search for Visual Studio Code Editor -> Press the Update button

    Also, this: https://forum.unity.com/threads/no-suggestions-in-vscode.955197/#post-6227874
     
    Enderquartz likes this.
  3. abhishekat7500

    abhishekat7500

    Joined:
    Feb 3, 2021
    Posts:
    1
    hi
    i have unity hub linux version i cannot find my unity editor or projects in my unity hub
     
  4. Enderquartz

    Enderquartz

    Joined:
    Mar 24, 2015
    Posts:
    1
    Thanks Kurt! Downloading Mono (and adding "omnisharp.useGlobalMono":"always" to the json launch settings) is what solved it for me.
     
    alyx_shaw likes this.