Skip to content

OSX + Unity error #1004

@klase

Description

@klase

Environment data

Version: 1.0.0-preview2-1-003177
Commit SHA-1 hash: a2df9c2576

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

VS Code version: 1.7.2
C# Extension version: 1.5.3

I get the following error when opening my Unity (5.4.1f1) project in vscode:

[WARNING:OmniSharp#ProjectFileInfo] Couldn't locate Mono, TargetFrameworkRootPath not specified
[INFORMATION:OmniSharp#ProjectFileInfo] Using tools version: 15.0
[ERROR:OmniSharp#ProjectFileInfo] The reference assemblies for framework ".NETFramework,Version=v2.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
[WARNING:OmniSharp#MSBuild] Failed to process project file '/Users/abc/Unity/temp/Assembly-CSharp.csproj'.
/Users/abc/Unity/temp/Assembly-CSharp.csproj

Activity

ViktorEvil

ViktorEvil commented on Dec 1, 2016

@ViktorEvil

get the same error but complains of .NET framework v3.5 not found

DustinCampbell

DustinCampbell commented on Dec 5, 2016

@DustinCampbell
Member

Hi @ViktorEvil -- in order for the C# extension to provide IntelliSense for Unity, Mono needs to be installed somewhere on the system. Otherwise, it can't find the assemblies that your projects reference. You can install Mono by downloading it from http://www.mono-project.com/download/ or install it via Howebrew.

ghost

ghost commented on Dec 6, 2016

@ghost

@klase I had this same issue, I think it was from multiple mono installs. Installing mono from the download didn't work, but doing:
brew install mono
brew link --overwrite mono

fixed it for me.

DustinCampbell

DustinCampbell commented on Dec 6, 2016

@DustinCampbell
Member

It can also happen if "mono" isn't on your path. In order to provide IntelliSense, we attempt to locate the folder that Mono puts target frameworks from the location of "mono". (Essentially, we execute "which mono" and then execute "readlink" a number of times to find the real canonicalized path.)

ViktorEvil

ViktorEvil commented on Dec 7, 2016

@ViktorEvil

@DustinCampbell Thanks :)

klase

klase commented on Dec 7, 2016

@klase
Author

@Figbash cheers that did it for me as well :)

klase

klase commented on Dec 7, 2016

@klase
Author

@DustinCampbell thanks for your help feel free to close this.

DustinCampbell

DustinCampbell commented on Dec 7, 2016

@DustinCampbell
Member

Glad to hear you got it working.

yangruihan

yangruihan commented on Feb 20, 2017

@yangruihan

@DustinCampbell Thanks very much. brew install mono works for me.

DustinCampbell

DustinCampbell commented on Feb 20, 2017

@DustinCampbell
Member

Awesome! Thanks for verifying.

jvlppm

jvlppm commented on Apr 15, 2017

@jvlppm

Hello, I know that this is old, and there is already a recommended solution,
but it looks to me that in my setup I shouldn't need to install mono over brew,
since I have mono on my Path, and it looks like I have the reference assemblies

I did not install mono directly, it was installed by Xamarin Studio v6.3.

Do I really need to install mono over brew and overwrite my current installation?

screen shot 2017-04-14 at 22 12 27

--

joao:/Library$ which mono
/Library/Frameworks/Mono.framework/Versions/Current/Commands/mono
joao:/Library$ readlink /Library/Frameworks/Mono.framework/Versions/Current/Commands/mono
/Library/Frameworks/Mono.framework/Commands/mono
joao:/Library$ readlink /Library/Frameworks/Mono.framework/Commands/mono
mono-sgen
joao:/Library$ readlink /Library/Frameworks/Mono.framework/Commands/mono-sgen
mono-sgen32
joao:/Library$ readlink /Library/Frameworks/Mono.framework/Commands/mono-sgen32
joao:/Library$ readlink /Library/Frameworks/Mono.framework/Commands/mono-sgen32
joao:/Library$ readlink /Library/Frameworks/Mono.framework/Commands
/Library/Frameworks/Mono.framework/Versions/Current/bin
joao:/Library$ readlink /Library/Frameworks/Mono.framework/Versions/Current/bin/
joao:/Library$ readlink /Library/Frameworks/Mono.framework/Versions/Current/
joao:/Library$ readlink /Library/Frameworks/Mono.framework/Versions/Current
/Library/Frameworks/Mono.framework/Versions/4.8.1
joao:/Library$ readlink /Library/Frameworks/Mono.framework/Versions/4.8.1
joao:/Library$ *readlink /Library/Frameworks/Mono.framework/Versions/4.8.1/
joao:/Library$ cd /Library/Frameworks/Mono.framework/Versions/4.8.1/
joao:/Library/Frameworks/Mono.framework/Versions/4.8.1$ find . -name "mscorlib.dll"
./lib/mono/2.0-api/mscorlib.dll
./lib/mono/4.0/mscorlib.dll
./lib/mono/4.0-api/mscorlib.dll
./lib/mono/4.5/mscorlib.dll
./lib/mono/4.5-api/mscorlib.dll
[ ... ]

joao:~$ mono --version
Mono JIT compiler version 4.8.1 (mono-4.8.0-branch/22a39d7 Fri Apr 7 12:00:08 EDT 2017)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: normal
SIGSEGV: altstack
Notification: kqueue
Architecture: x86
Disabled: none
Misc: softdebug
LLVM: yes(3.6.0svn-mono-master/8b1520c)
GC: sgen

kenmgrimm

kenmgrimm commented on May 25, 2017

@kenmgrimm

I tried what @Figbash suggested which was close but what ended up doing it for me was:
brew unlink mono && brew link mono

gamefish

gamefish commented on Nov 17, 2017

@gamefish

Holy Moly! I got this nasty error after installing Visual Studio 2017 for Mac. Then I find it sucks, I uninstalled it, which caused VSCode & OmniSharp this error. Shouldn't have mess with MS products.
brew unlink mono && brew link mono
saved my night, it's 2:32 AM now

dalmazo

dalmazo commented on Dec 18, 2017

@dalmazo

I only get this working when after installing something on xcode xcode-select --install and then brew install mono

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @DustinCampbell@jvlppm@gamefish@kenmgrimm@klase

        Issue actions

          OSX + Unity error · Issue #1004 · dotnet/vscode-csharp