dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.28k stars 9.96k forks source link

Trouble running Home/samples/MvcHello Kestrel on Mac. #195

Closed migueldeicaza closed 9 years ago

migueldeicaza commented 9 years ago

In a previous life, I had K and KVM setup, back when @davidfowl and myself were trying to get things running, and I suspect this might have left some old stuff behind.

I have done a kvm upgrade and this is what kvm list shows:

KRE-mono45-x86.0.1-alpha-build-0475
KRE-mono45-x86.1.0.0-alpha4-10353 *

When I try to run:

k kestrel 

On my Mac, I get this:

System.MissingMethodException: Method not found: 'Microsoft.Framework.Runtime.ILibraryInformation.get_LoadableAssemblies'.
  at System.Linq.Enumerable+<CreateSelectManyIterator>c__Iterator12`2[Microsoft.Framework.Runtime.ILibraryInformation,System.Reflection.AssemblyName].MoveNext () [0x00000] in <filename unknown>:0 
  at System.Linq.Enumerable+<CreateSelectIterator>c__Iterator10`2[System.Reflection.AssemblyName,System.Reflection.Assembly].MoveNext () [0x00000] in <filename unknown>:0 
  at System.Linq.Enumerable+<CreateSelectManyIterator>c__Iterator12`2[System.Reflection.Assembly,System.Reflection.TypeInfo].MoveNext () [0x00000] in <filename unknown>:0 
  at System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1E`1[System.Reflection.TypeInfo].MoveNext () [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Mvc.ControllerActionDescriptorProvider.BuildModel () [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Mvc.ControllerActionDescriptorProvider.GetDescriptors () [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Mvc.ControllerActionDescriptorProvider.Invoke (Microsoft.AspNet.Mvc.ActionDescriptorProviderContext context, System.Action callNext) [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.DependencyInjection.NestedProviders.NestedProviderManager`1+CallNext[Microsoft.AspNet.Mvc.ActionDescriptorProviderContext].CallNextProvider () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.DependencyInjection.NestedProviders.NestedProviderManager`1[Microsoft.AspNet.Mvc.ActionDescriptorProviderContext].Invoke (Microsoft.AspNet.Mvc.ActionDescriptorProviderContext context) [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Mvc.DefaultActionDescriptorsCollectionProvider.GetCollection () [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Mvc.DefaultActionDescriptorsCollectionProvider.get_ActionDescriptors () [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Mvc.Routing.AttributeRouting.GetActionDescriptors (IServiceProvider services) [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Mvc.Routing.AttributeRouting.CreateAttributeMegaRoute (IRouter target, IServiceProvider services) [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Builder.BuilderExtensions.UseMvc (IApplicationBuilder app, System.Action`1 configureRoutes) [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Builder.BuilderExtensions.UseMvc (IApplicationBuilder app) [0x00000] in <filename unknown>:0 
  at HelloMvc.Startup.Configure (IApplicationBuilder app) [0x00000] 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) [0x00000] in <filename unknown>:0 
Missing method Microsoft.Framework.Runtime.ILibraryInformation::get_LoadableAssemblies() in assembly data-0x7bc56200, referenced in assembly /Users/miguel/.kpm/packages/Microsoft.AspNet.Mvc.Core/6.0.0-beta1/lib/aspnet50/Microsoft.AspNet.Mvc.Core.dll
davidfowl commented 9 years ago

You need the new version of kvm. Run that curl command on the readme again.

davidfowl commented 9 years ago

Or use homebrew

zote commented 9 years ago

David, I have same problem here.

And Im using latest version download few moments ago..

zote$ kvm upgrade Determining latest version 1.0.0-alpha4-10353 KRE-mono45-x86.1.0.0-alpha4-10353 already installed. Adding /Users/zote/.kre/packages/KRE-mono45-x86.1.0.0-alpha4-10353/bin to process PATH Setting alias 'default' to 'KRE-mono45-x86.1.0.0-alpha4-10353'

And error

zote$ k kestrel Missing method Microsoft.Framework.Runtime.ILibraryInformation::get_LoadableAssemblies() in assembly data-0x7fa3d4867600, referenced in assembly /Users/zote/.kpm/packages/Microsoft.AspNet.Mvc.Core/6.0.0-beta1/lib/aspnet50/Microsoft.AspNet.Mvc.Core.dll System.MissingMethodException: Method not found: 'Microsoft.Framework.Runtime.ILibraryInformation.get_LoadableAssemblies'. at System.Linq.Enumerable+cIterator12`2[Microsoft.Framework.Runtime.ILibraryInformation,System.Reflection.AssemblyName].MoveNext () [0x00000] in :0 at System.Linq.Enumerable+cIterator102[System.Reflection.AssemblyName,System.Reflection.Assembly].MoveNext () [0x00000] in <filename unknown>:0 at System.Linq.Enumerable+<CreateSelectManyIterator>c__Iterator122[System.Reflection.Assembly,System.Reflection.TypeInfo].MoveNext () [0x00000] in :0 at System.Linq.Enumerable+c__Iterator1E1[System.Reflection.TypeInfo].MoveNext () [0x00000] in <filename unknown>:0 at Microsoft.AspNet.Mvc.ControllerActionDescriptorProvider.BuildModel () [0x00000] in <filename unknown>:0 at Microsoft.AspNet.Mvc.ControllerActionDescriptorProvider.GetDescriptors () [0x00000] in <filename unknown>:0 at Microsoft.AspNet.Mvc.ControllerActionDescriptorProvider.Invoke (Microsoft.AspNet.Mvc.ActionDescriptorProviderContext context, System.Action callNext) [0x00000] in <filename unknown>:0 at Microsoft.Framework.DependencyInjection.NestedProviders.NestedProviderManager1+CallNext[Microsoft.AspNet.Mvc.ActionDescriptorProviderContext].CallNextProvider () [0x00000] in :0 at Microsoft.Framework.DependencyInjection.NestedProviders.NestedProviderManager1[Microsoft.AspNet.Mvc.ActionDescriptorProviderContext].Invoke (Microsoft.AspNet.Mvc.ActionDescriptorProviderContext context) [0x00000] in <filename unknown>:0 at Microsoft.AspNet.Mvc.DefaultActionDescriptorsCollectionProvider.GetCollection () [0x00000] in <filename unknown>:0 at Microsoft.AspNet.Mvc.DefaultActionDescriptorsCollectionProvider.get_ActionDescriptors () [0x00000] in <filename unknown>:0 at Microsoft.AspNet.Mvc.Routing.AttributeRouting.GetActionDescriptors (IServiceProvider services) [0x00000] in <filename unknown>:0 at Microsoft.AspNet.Mvc.Routing.AttributeRouting.CreateAttributeMegaRoute (IRouter target, IServiceProvider services) [0x00000] in <filename unknown>:0 at Microsoft.AspNet.Builder.BuilderExtensions.UseMvc (IApplicationBuilder app, System.Action1 configureRoutes) [0x00000] in :0 at KWebStartup.Startup.Configure (IApplicationBuilder app) [0x00000] in :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) [0x00000] in :0

suhasj commented 9 years ago

@zote : you are trying to run beta1 packages with alpha4 version of KRE. You need to update your KRE and KVM. Try this

This should update the kvm brew script, install latest kvm and upgrade to KRE. Let me know if this helps

zote commented 9 years ago

@suhasj Don't worked...

Zotes-MacBook-Pro:ExameMedico zote$ brew uninstall kvm Uninstalling /usr/local/Cellar/kvm/1.0.0-beta1... Zotes-MacBook-Pro:ExameMedico zote$ brew update Already up-to-date. Zotes-MacBook-Pro:ExameMedico zote$ brew untap aspnet/k Untapped 3 formulae Zotes-MacBook-Pro:ExameMedico zote$ brew tap aspnet/k Cloning into '/usr/local/Library/Taps/aspnet/homebrew-k'... remote: Counting objects: 55, done. remote: Total 55 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (55/55), done. Checking connectivity... done. Tapped 3 formulae Zotes-MacBook-Pro:ExameMedico zote$ brew install kvm ==> Installing kvm from aspnet/homebrew-k ==> Cloning https://github.com/aspnet/Home.git Updating /Library/Caches/Homebrew/kvm--git ==> Checking out branch master ==> bash -c 'source /usr/local/Cellar/kvm/1.0.0-beta1/libexec/kvm.sh; kvm upgrade' ==> Caveats Add the following to the ~/.bash_profile, ~/.bashrc or ~/.zshrc file:

source kvm.sh

==> Summary 🍺 /usr/local/Cellar/kvm/1.0.0-beta1: 4 files, 44K, built in 6 seconds Zotes-MacBook-Pro:ExameMedico zote$ kvm upgrade Determining latest version 1.0.0-alpha4-10353 KRE-mono45-x86.1.0.0-alpha4-10353 already installed. Adding /Users/zote/.kre/packages/KRE-mono45-x86.1.0.0-alpha4-10353/bin to process PATH Setting alias 'default' to 'KRE-mono45-x86.1.0.0-alpha4-10353' Zotes-MacBook-Pro:ExameMedico zote$ kpm restore Restoring packages for /Users/zote/Projects/aspnet/ExameMedico/project.json Resolving complete, 293ms elapsed Restore complete, 295ms elapsed Zotes-MacBook-Pro:ExameMedico zote$ k kestrel Missing method Microsoft.Framework.Runtime.ILibraryInformation::get_LoadableAssemblies() in assembly data-0x7fb3120df800, referenced in assembly /Users/zote/.kpm/packages/Microsoft.AspNet.Mvc.Core/6.0.0-beta1/lib/aspnet50/Microsoft.AspNet.Mvc.Core.dll

suhasj commented 9 years ago

Ok close the current terminal and try kvm upgrade in the new terminal. Need to reload the kvm.sh

zote commented 9 years ago

Zotes-MacBook-Pro:~ zote$ kvm upgrade -bash: kvm: command not found

suhasj commented 9 years ago

So as mentioned in the installation notes you need to ' Add the following to the ~/.bash_profile, ~/.bashrc or ~/.zshrc file:

source kvm.sh '

suhasj commented 9 years ago

Update source kvm.sh in the .bash_profile if you are running on latest OSX and re open a new terminal and try

zote commented 9 years ago

@suhasj thank you so much, its working now!!!

Praburaj commented 9 years ago

Issue addressed. closing the bug.