[Solved] Getting started with DNX on Ubuntu: What am I doing wrong?

Completed

Edit: Solved by updating Mono, see comment below. Seems the version in the repos is outdated.

IDE info:

Rider RS-144.4571
Build #RS-144.4571, built on March 1, 2016
JRE: 1.8.0_76-release-b19 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

Some system information:

➜  ~  dnvm list

Active Version              Runtime Architecture OperatingSystem Alias
------ -------              ------- ------------ --------------- -----
  *    1.0.0-rc1-update1    mono                 linux/osx       default

➜  ~  mono -V  
Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-4ubuntu4)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           __thread
    SIGSEGV:       altstack
    Notifications: epoll
    Architecture:  amd64
    Disabled:      none
    Misc:          softdebug
    LLVM:          supported, not enabled.
    GC:            sgen
➜  ~  lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 15.10
Release:    15.10
Codename:    wily
➜  ~  

 

 

 

I created a DNX console application using the "Create Project" wizard. The IDE opens the project and source file. Types such as System are shown in red. Keywords such as void and string are not recognised.

Hitting the run button results in this error:

/home/adam/.dnx/runtimes/dnx-mono.1.0.0-rc1-update1/bin/dnx run
System.MissingMethodException: Method not found: 'System.Runtime.InteropServices.Marshal.GetTypeFromCLSID'.
  at System.Lazy`1[System.Boolean].InitValue () [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
  at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute (System.Reflection.Assembly assembly, System.String[] args, IServiceProvider serviceProvider) [0x00000] in <filename unknown>:0
  at Microsoft.Dnx.Host.Bootstrapper.RunAsync (System.Collections.Generic.List`1 args, IRuntimeEnvironment env, System.String appBase, System.Runtime.Versioning.FrameworkName targetFramework) [0x00000] in <filename unknown>:0

The toolbar shows the following:

The IDE has logged the following errors, but reporting them fails:

23:52:03 ReSharperHostException: [1m[31mError: FindPackagesById: Microsoft.CSharp

--- EXCEPTION #1/1 [LoggerException]
Message = “[1m[31mError: FindPackagesById: Microsoft.CSharp”
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
HResult = COR_E_APPLICATION=80131600
StackTraceString = “
  at JetBrains.Util.ILoggerEx.LogMessage (ILogger this, LoggingLevel level, System.String message) [0x00000] in :0
    at JetBrains.ReSharper.Host.Features.ProjectModel.ProjectHosts.DnxInfrastructure.DnxPackagesRestoreTool+c__DisplayClass8.b__4 (System.Object sender, System.Diagnostics.DataReceivedEventArgs e) [0x00000] in :0
    at System.Diagnostics.Process.OnErrorDataReceived (System.String str) [0x00000] in :0
    at System.Diagnostics.Process+ProcessAsyncReader.Flush (Boolean last) [0x00000] in :0
    at System.Diagnostics.Process+ProcessAsyncReader.AddInput () [0x00000] in :0
    at System.Runtime.Remoting.Mess... (show balloon)
23:52:16 Error Report: Submitting feedback error: Failed to parse XML-RPC request: Character reference "&#27" is an invalid XML character.

The solution explorer shows many unresolved references:

What should I do to get this to work?

0
1 comment

Updating Mono to 4.2.2 fixed this issue:

➜  ~  sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update && sudo apt-get install mono-complete mono-devel
➜  ~  mono -V
Mono JIT compiler version 4.2.2 (Stable 4.2.2.30/996df3c Mon Feb 15 17:30:30 UTC 2016)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           __thread
    SIGSEGV:       altstack
    Notifications: epoll
    Architecture:  amd64
    Disabled:      none
    Misc:          softdebug
    LLVM:          supported, not enabled.
    GC:            sgen
➜  ~  
1

Please sign in to leave a comment.