aspnet / dnx

OBSOLETE - see readme
Other
963 stars 224 forks source link

dnx kestrel. InvalidOperationException. Unable to resolve project '' from. #2725

Closed angelsix closed 9 years ago

angelsix commented 9 years ago

I have an ASP.Net 5 application that runs and works on Windows, Mac and Linux in desktop environments.

I can also run it on a Rasp Pi 2 with an ARM version of Arch Linux.

However, trying to run it on a custom board running ARM version of Ubuntu 15.04, no matter what runtime I used (beta 2,3,4,5,6,7) and mono 4.1.0.1738 whenever I run dnx kestrel I get.

System.InvalidOperationException: Unable to resolve project 'Code' from /home/user/projectfolder
  at Microsoft.Dnx.Runtime.ApplicationHostContext..ctor (IServiceProvider hostServices, System.String projectDirectory, System.String packagesDirectory, System.String configuration, System.Runtime.Versioning.FrameworkName targetFramework, IAssemblyLoadContextFactory loadContextFactory, Boolean skipLockFileValidation) <0xb6c0edb0 + 0x00348> in <filename unknown>:0 
  at Microsoft.Dnx.Runtime.DefaultHost.Initialize (Microsoft.Dnx.Runtime.RuntimeOptions options, IServiceProvider hostServices, IAssemblyLoadContextAccessor loadContextAccessor, IFileWatcher fileWatcher) <0xb6c0e590 + 0x000a7> in <filename unknown>:0 
  at Microsoft.Dnx.Runtime.DefaultHost..ctor (Microsoft.Dnx.Runtime.RuntimeOptions options, IServiceProvider hostServices, IAssemblyLoadContextAccessor loadContextAccessor, IFileWatcher fileWatcher, ICompilationEngineFactory compilationEngineFactory) <0xb6c0df38 + 0x000f7> in <filename unknown>:0 
  at Microsoft.Dnx.ApplicationHost.Program.Main (System.String[] args) <0xb6c09ff8 + 0x00173> in <filename unknown>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) <0xb5005ae0 + 0x000bf> in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0xb4e27ea8 + 0x00024> in <filename unknown>:0 
  at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute (System.Reflection.Assembly assembly, System.String[] args, IServiceProvider serviceProvider) <0xb6c07000 + 0x0018f> in <filename unknown>:0 
  at Microsoft.Dnx.Host.Bootstrapper.RunAsync (System.Collections.Generic.List`1 args, IRuntimeEnvironment env, System.Runtime.Versioning.FrameworkName targetFramework) <0xb6d4e868 + 0x00353> in <filename unknown>:0 

I have no info to go off to help me fix the issue.

davidfowl commented 9 years ago

@angelsix Can you provide some better repro steps? What did you run? What does your project layout look like?

angelsix commented 9 years ago
  1. Installed a fresh ubuntu ARM 15.04.
  2. Installed all packages required and everything from here like dnvm, the runtimes and libuv etc... http://docs.asp.net/en/latest/getting-started/installing-on-linux.html
  3. Built mono from tar file here 4.1.0.1738 http://download.mono-project.com/sources/mono/nightly/
    • Installed pre-reqs sudo apt-get install git autoconf libtool automake build-essential mono-devel get text libtool-bin
    • Extracted tar tar xvc mono-4.1.0.1738.tar.bz2
    • cd mono-4.1.0
    • ./configure --prefix=/mono
    • make
    • sudo make install
    • This placed mono into /mono folder
    • Updated path in /etc/environment to start search in /mono/bin so it finds mono 4.1
    • Check with: mono -V gives Mono JIT compiler version 4.1.0 (tarball Wed Sep 16 21:41:09 UTC 2015) Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com TLS: __thread SIGSEGV: normal Notifications: epoll Architecture: armel,vfp+hard Disabled: none Misc: softdebug LLVM: supported, not enabled. GC: sgen
  4. Setup dnvm
    • dnvm upgrade
    • dnvm install 1.0.0-beta7
    • dnvm use 1.0.0-beta7
    • dnvm list Active Version Runtime Architecture OperatingSystem Alias

      1.0.0-beta4 mono linux/osx
      1.0.0-beta5 mono linux/osx
      1.0.0-beta7 coreclr x64 linux

    • 1.0.0-beta7 mono linux/osx default
  5. Tried to build and run project

    • Went into project folder
    • dnu restore Microsoft .NET Development Utility Mono-x86-1.0.0-beta7-15532

    CACHE https://www.myget.org/F/aspnetvnext/api/v2/ CACHE https://www.nuget.org/api/v2/ Restoring packages for /home/user/profilefolder/project.json CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='Kestrel' CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='Kestrel' CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='Microsoft.AspNet.Mvc' CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.AspNet.Mvc' CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='Microsoft.AspNet.Diagnostics' CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.AspNet.Diagnostics' CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='Microsoft.AspNet.StaticFiles' CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.AspNet.StaticFiles' CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='Microsoft.Framework.ConfigurationModel.Json' CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.Framework.ConfigurationModel.Json' CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='Microsoft.Framework.Logging.Console' CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.Framework.Logging.Console' CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='System.Linq' CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='System.Linq' CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='System.Collections' CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='System.Collections' CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='System.Diagnostics.Debug' CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='System.Diagnostics.Debug' CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='System.IO' CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='System.IO' CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='System.IO.FileSystem' CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='System.IO.FileSystem' CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='System.Resources.ResourceManager' CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='System.Resources.ResourceManager' CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='System.Runtime.Extensions' CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='System.Runtime.Extensions' CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='System.Runtime.InteropServices' CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='System.Runtime.InteropServices' CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='System.Dynamic.Runtime' CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='System.Dynamic.Runtime' Writing lock file /home/user/projectfolder/Project/project.lock.json Restore complete, 9253ms elapsed

NuGet Config files used: /home/user/.config/NuGet/NuGet.Config

Feeds used: https://www.myget.org/F/aspnetvnext/api/v2/ https://www.nuget.org/api/v2/

angelsix commented 9 years ago

Just created a new fresh project on Windows in Visual Studio 2015, an ASP.Net Web Application. Built and run ok on windows.

Run on the ARM linux board:

Microsoft .NET Development Utility Mono-x86-1.0.0-beta7-15532

CACHE https://www.myget.org/F/aspnetvnext/api/v2/ CACHE https://www.nuget.org/api/v2/ Restoring packages for /home/user/TestWeb/project.json GET https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='EntityFramework.SqlServer' GET https://www.nuget.org/api/v2/FindPackagesById()?id='EntityFramework.SqlServer' GET https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='EntityFramework.Commands' GET https://www.nuget.org/api/v2/FindPackagesById()?id='EntityFramework.Commands' thunk failed 0xb2b5dbf0->0xb4d2667c, thunk space=84 method Mono.Security.Protocol.Tls.CipherSuite:EncryptRecord (byte[],byte[])* Assertion: should not be reached at mini-arm.c:3770

Stacktrace:

at <0xffffffff> at Mono.Security.Protocol.Tls.CipherSuite.EncryptRecord (byte[],byte[]) <0x000d3> at Mono.Security.Protocol.Tls.RecordProtocol.encryptRecordFragment (Mono.Security.Protocol.Tls.ContentType,byte[]) <0x000fb> at Mono.Security.Protocol.Tls.RecordProtocol.EncodeRecord (Mono.Security.Protocol.Tls.ContentType,byte[],int,int) <0x0012f> at Mono.Security.Protocol.Tls.RecordProtocol.EncodeRecord (Mono.Security.Protocol.Tls.ContentType,byte[]) <0x00033> at Mono.Security.Protocol.Tls.RecordProtocol.EncodeHandshakeRecord (Mono.Security.Protocol.Tls.Handshake.HandshakeType) <0x00073> at Mono.Security.Protocol.Tls.SslClientStream.NegotiateAsyncWorker (System.IAsyncResult) <0x005f7> at (wrapper runtime-invoke) .runtime_invoke_void__this___object (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

Debug info from gdb:

Got a SIGABRT while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries

used by your application.

Aborted

NuGet Config files used: /home/user/.config/NuGet/NuGet.Config

Feeds used: https://www.myget.org/F/aspnetvnext/api/v2/ https://www.nuget.org/api/v2/

/home/user/TestWeb/src/TestWeb/project.lock.json(1,0): error: The expected lock file doesn't exist. Please run "dnu restore" to generate a new lock file. Current runtime target framework: 'DNX,Version=v4.5.1 (dnx451)' Version: 1.0.0-beta7-15532 Type: Mono Architecture: x86 OS Name: Linux

at Microsoft.Dnx.ApplicationHost.Program.Main (System.String[] args) <0xb48142b8 + 0x0044f> in :0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0xb4e27ea8 + 0x00024> in :0 at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute (System.Reflection.Assembly assembly, System.String[] args, IServiceProvider serviceProvider) <0xb4811000 + 0x0018f> in :0 at Microsoft.Dnx.Host.Bootstrapper.RunAsync (System.Collections.Generic.List`1 args, IRuntimeEnvironment env, System.Runtime.Versioning.FrameworkName targetFramework) <0xb6d2e850 + 0x00353> in :0

Searched Locations: /home/user/{name}/project.json /home/user/TestWeb/src/{name}/project.json /home/user/TestWeb/test/{name}/project.json /mono/lib/mono/4.5/{name}.dll /mono/lib/mono/4.5/Facades/{name}.dll

Try running 'dnu restore'.

at Microsoft.Framework.ApplicationHost.Program.Main (System.String[] args) <0xb47a1f58 + 0x0037f> in :0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0xb4e27ea8 + 0x00024> in :0 at Microsoft.Framework.Runtime.Common.EntryPointExecutor.Execute (System.Reflection.Assembly assembly, System.String[] args, IServiceProvider serviceProvider) <0xb6cc7cf0 + 0x0018f> in :0 at dnx.host.Bootstrapper.RunAsync (System.Collections.Generic.List`1 args, IRuntimeEnvironment env) <0xb6cc3228 + 0x00347> in :0

I checked in the mono folder and those files dont exist. For example this is ls output of /mono/lib/mono/4.5/Microsoft.

Microsoft.Build.Engine.dll Microsoft.Build.Utilities.v4.0.dll Microsoft.VisualC.dll Microsoft.Build.Framework.dll Microsoft.Build.dll Microsoft.Web.Infrastructure.dll Microsoft.Build.Tasks.v4.0.dll Microsoft.CSharp.dll

Here is the project.json from the fresh new ASP.Net Web Application project:

{ "webroot": "wwwroot", "userSecretsId": "aspnet5-TestWeb-47e0c361-853f-4ace-b735-22e71f264504", "version": "1.0.0-*",

"dependencies": { "EntityFramework.SqlServer": "7.0.0-beta5", "EntityFramework.Commands": "7.0.0-beta5", "Microsoft.AspNet.Mvc": "6.0.0-beta5", "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta5", "Microsoft.AspNet.Authentication.Cookies": "1.0.0-beta5", "Microsoft.AspNet.Authentication.Facebook": "1.0.0-beta5", "Microsoft.AspNet.Authentication.Google": "1.0.0-beta5", "Microsoft.AspNet.Authentication.MicrosoftAccount": "1.0.0-beta5", "Microsoft.AspNet.Authentication.Twitter": "1.0.0-beta5", "Microsoft.AspNet.Diagnostics": "1.0.0-beta5", "Microsoft.AspNet.Diagnostics.Entity": "7.0.0-beta5", "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta5", "Microsoft.AspNet.Server.IIS": "1.0.0-beta5", "Microsoft.AspNet.Server.WebListener": "1.0.0-beta5", "Microsoft.AspNet.StaticFiles": "1.0.0-beta5", "Microsoft.AspNet.Tooling.Razor": "1.0.0-beta5", "Microsoft.Framework.Configuration.Abstractions": "1.0.0-beta5", "Microsoft.Framework.Configuration.Json": "1.0.0-beta5", "Microsoft.Framework.Configuration.UserSecrets": "1.0.0-beta5", "Microsoft.Framework.Logging": "1.0.0-beta5", "Microsoft.Framework.Logging.Console": "1.0.0-beta5", "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-beta5" },

"commands": { "web": "Microsoft.AspNet.Hosting --config hosting.ini", "ef": "EntityFramework.Commands" },

"frameworks": { "dnx451": { }, "dnxcore50": { } },

"exclude": [ "wwwroot", "node_modules", "bower_components" ], "publishExclude": [ "node_modules", "bower_components", ".xproj", ".user", "**.vspscc" ], "scripts": { "prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ] } }

davidfowl commented 9 years ago

2 More questions:

  1. Are you using the beta5 dnx or the beta7 dnx?
  2. Are you running dnx kestrel from the correct folder?
angelsix commented 9 years ago

Exact same output for both beta5 and beta7

Ooops. Yep went into the sub-folder where the json files are and run dnu restore and dnx . kestrel.

Now I get for the main project the following error:

System.Exception: Error -13 EACCES permission denied at Microsoft.AspNet.Server.Kestrel.Networking.Libuv.Check (Int32 statusCode) <0xb1fabbf8 + 0x00044> in :0 at Microsoft.AspNet.Server.Kestrel.Networking.Libuv.tcp_bind (Microsoft.AspNet.Server.Kestrel.Networking.UvTcpHandle handle, Microsoft.AspNet.Server.Kestrel.Networking.sockaddr& addr, Int32 flags) <0xb1fb1680 + 0x0005b> in :0 at Microsoft.AspNet.Server.Kestrel.Networking.UvTcpHandle.Bind (System.Net.IPEndPoint endpoint) <0xb1fb0d38 + 0x00113> in :0 at Microsoft.AspNet.Server.Kestrel.Http.Listener+<>c__DisplayClass7_0.b_0 (System.Object ) <0xb1fb05b8 + 0x000ff> in :0

I suspect its because I'm spinning up on port 80 and just need to install nginx and configure that. I'll do that and report back. If you think the error above is something else let me know thanks.

davidfowl commented 9 years ago

I'm closing out this bug. If you have a specific kestrel issue please file it on that repository