question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to resolve assemblies in existing Unity project

See original GitHub issue

Environment data

dotnet --info output:

.NET Command Line Tools (2.0.2)

Product Information:
 Version:            2.0.2
 Commit SHA-1 hash:  a04b4bf512

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.12
 OS Platform: Darwin
 RID:         osx.10.12-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.0.2/

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0
  Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d

VS Code version: 1.19.1 C# Extension version: 1.13.1

Steps to reproduce

Open pre-existing Unity project in VS Code.

Expected behavior

IDE features to work.

Actual behavior

Missing assembly warnings and no IDE features.

The project worked fine a few months ago; I switched to Visual Studio for Mac for a bit but trying to switch back I’ve been hit with this and after all of my attempts to figure out what is going on I have been unsuccessful. I created a brand new project and while I still am getting the same unable to resolve assembly warning intellisense seems to work; it’s just pre-existing projects that seem to be the issue.

Full disclosure in case it is part of the issue; I’m using a compiled omnisharp-roslyn because for some reason the one shipped with the C# extension errors out on my machine.

Omnisharp log:

Starting OmniSharp server at 1/8/2018, 11:28:10 AM
    Target: /Users/mattbengston/Development/Games/spooky-jumps/spooky-jumps.sln

OmniSharp server started wth Mono
    Path: /Users/mattbengston/Development/Utils/omnisharp-roslyn/artifacts/scripts/OmniSharp.Stdio
    PID: 84470

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on MacOS 10.12.6 (x64)
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 2 MSBuild instance(s)
            1: Mono 15.0 - "/Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin"
            2: StandAlone 15.0 - "/Users/mattbengston/Development/Utils/omnisharp-roslyn/artifacts/publish/OmniSharp.Stdio/mono/msbuild/15.0/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Mono 15.0 - "/Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin"
            CscToolPath = /Users/mattbengston/Development/Utils/omnisharp-roslyn/artifacts/publish/OmniSharp.Stdio/mono/msbuild/15.0/Bin/Roslyn
            CscToolExe = csc.exe
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in '/Users/mattbengston/Development/Games/spooky-jumps'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Initializing in /Users/mattbengston/Development/Games/spooky-jumps
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Auto package restore: False
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Update workspace context
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Resolving projects references
[info]: OmniSharp.MSBuild.ProjectSystem
        Detecting projects in '/Users/mattbengston/Development/Games/spooky-jumps/spooky-jumps.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/mattbengston/Development/Games/spooky-jumps/JumperCore.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/mattbengston/Development/Games/spooky-jumps/JumperLevelGeneration.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/mattbengston/Development/Games/spooky-jumps/spooky-jumps.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/mattbengston/Development/Games/spooky-jumps/JumperLevelEditor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/mattbengston/Development/Games/spooky-jumps/spooky-jumps.Editor.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/Users/mattbengston/Development/Games/spooky-jumps'.
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/mattbengston/Development/Games/spooky-jumps/JumperCore.csproj
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.Stdio.Host
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[info]: OmniSharp.Stdio.Host
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location '/Users/mattbengston/Development/Games/spooky-jumps' on host 84449.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/mattbengston/Development/Games/spooky-jumps/JumperCore.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/mattbengston/Development/Games/spooky-jumps/JumperLevelGeneration.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/mattbengston/Development/Games/spooky-jumps/JumperLevelGeneration.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/mattbengston/Development/Games/spooky-jumps/spooky-jumps.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/mattbengston/Development/Games/spooky-jumps/spooky-jumps.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/mattbengston/Development/Games/spooky-jumps/JumperLevelEditor.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/mattbengston/Development/Games/spooky-jumps/JumperLevelEditor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/mattbengston/Development/Games/spooky-jumps/spooky-jumps.Editor.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/mattbengston/Development/Games/spooky-jumps/spooky-jumps.Editor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: JumperCore
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: JumperLevelGeneration
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/mattbengston/Development/Games/spooky-jumps/Temp/UnityVS_bin/Debug/JumperCore.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: spooky-jumps
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/mattbengston/Development/Games/spooky-jumps/Temp/UnityVS_bin/Debug/JumperCore.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/mattbengston/Development/Games/spooky-jumps/Temp/UnityVS_bin/Debug/JumperLevelEditor.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/mattbengston/Development/Games/spooky-jumps/Temp/UnityVS_bin/Debug/JumperLevelGeneration.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: JumperLevelEditor
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/mattbengston/Development/Games/spooky-jumps/Temp/UnityVS_bin/Debug/JumperCore.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/mattbengston/Development/Games/spooky-jumps/Temp/UnityVS_bin/Debug/JumperLevelGeneration.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: spooky-jumps.Editor
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/mattbengston/Development/Games/spooky-jumps/Temp/UnityVS_bin/Debug/Assembly-CSharp.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/mattbengston/Development/Games/spooky-jumps/Temp/UnityVS_bin/Debug/JumperCore.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/mattbengston/Development/Games/spooky-jumps/Temp/UnityVS_bin/Debug/JumperLevelEditor.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/mattbengston/Development/Games/spooky-jumps/Temp/UnityVS_bin/Debug/JumperLevelGeneration.dll'

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:10
  • Comments:18 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
bengsfortcommented, Jan 10, 2018

@rchande seems like it’s not related to the project but rather my machine/vscode/something super strange 😅

I’m on OSX and despite a couple fresh re-installs of the plugin and VSCode the default path the plugin was using was:

OmniSharp server started wth Mono
    Path: /Users/mattbengston/.vscode/extensions/ms-vscode.csharp-1.13.1/.omnisharp/omnisharp/OmniSharp.exe
    PID: 22028

This threw a ton of errors, namely:

System.TypeInitializationException: The type initializer for 'OmniSharp.Utilities.Platform' threw an exception. ---> System.IO.FileNotFoundException: Could not find file "/etc/os-release"
. . .

After comparing the output of a friends editor we noticed that his path was .omnisharp/run, so I updated my settings to:

"omnisharp.path": "/Users/mattbengston/.vscode/extensions/ms-vscode.csharp-1.13.1/.omnisharp/run",

And viola, everything works in every project with no issues.

No idea why it was using OmniSharp.exe vs run, but everything is working perfectly now; so this can probably be closed 😃

1reaction
otricommented, Jun 7, 2018

Ok, got it… VS code C# extension 1.15.2

~ $ dotnet --version
2.1.4
~ $ mono --version
Mono JIT compiler version 5.10.1.47 (2017-12/8eb8f7d5e74 Fri Apr 13 20:18:12 EDT 2018)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           normal
	SIGSEGV:       altstack
	Notification:  kqueue
	Architecture:  amd64
	Disabled:      none
	Misc:          softdebug 
	Interpreter:   yes
	LLVM:          yes(3.6.0svn-mono-master/8b1520c8aae)
	GC:            sgen (concurrent by default)
Read more comments on GitHub >

github_iconTop Results From Across the Web

VSCode suddenly not working correctly - "Unable to resolve ...
Unable to resolve assembly 'c:\Projects\WickedLands\Temp\bin\Debug\Assembly-CSharp-firstpass.dll' [warn]: OmniSharp.MSBuild.ProjectManager
Read more >
Troubleshooting .NET Framework Targeting Errors - MSBuild
To resolve the error, make sure that your application targets a .NET version that's compatible with the version that's targeted by the projects...
Read more >
I'm starting an Unity project however my coding environment ...
Failed to load project file 'c:\Forest\Assembly-CSharp.csproj'. I'll also mention that I changed the omnisharp.path to latest and have installed ...
Read more >
Visual Studio C# integration - Unity - Manual
You can also add files to your solution from Visual Studio. Unity imports any new files, and the next time Unity creates the...
Read more >
[ UNITY ] Assembly - CSharp Incompatible
Were you able to fix your issue ? Did the manual project reload work ? Perhaps you initially tried to load the solution...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found