asp.net mvc - Exception when run Aspnet Mvc app on OS X -
i'm trying run samples aspnet 5 on os x: git clone https://github.com/shirhatti/home.git
when build project hellomvc -- 'kpm build' -- it's ok. run app using 'k kestrel' , see next error:
missing method microsoft.framework.runtime.ilibraryinformation::get_loadableassemblies() in assembly data-0x7feb6aa02a00, referenced in assembly /users/minya/.kpm/packages/microsoft.aspnet.mvc.core/6.0.0-beta2-11905/lib/aspnet50/microsoft.aspnet.mvc.core.dll system.missingmethodexception: method not found: 'microsoft.framework.runtime.ilibraryinformation.get_loadableassemblies'. @ system.linq.enumerable+c__iterator122[microsoft.framework.runtime.ilibraryinformation,system.reflection.assemblyname].movenext () [0x00000] in <filename unknown>:0 @ system.linq.enumerable+<createselectiterator>c__iterator10
2[system.reflection.assemblyname,system.reflection.assembly].movenext () [0x00000] in :0 @ system.linq.enumerable+c__iterator122[system.reflection.assembly,system.reflection.typeinfo].movenext () [0x00000] in <filename unknown>:0 @ microsoft.aspnet.mvc.controlleractiondescriptorprovider.buildmodel () [0x00000] in <filename unknown>:0 @ microsoft.aspnet.mvc.controlleractiondescriptorprovider.getdescriptors () [0x00000] in <filename unknown>:0 @ microsoft.aspnet.mvc.controlleractiondescriptorprovider.invoke (microsoft.aspnet.mvc.actiondescriptorprovidercontext context, system.action callnext) [0x00000] in <filename unknown>:0 @ microsoft.framework.dependencyinjection.nestedproviders.nestedprovidermanager
1+callnext[microsoft.aspnet.mvc.actiondescriptorprovidercontext].callnextprovider () [0x00000] in :0 @ microsoft.framework.dependencyinjection.nestedproviders.nestedprovidermanager1[microsoft.aspnet.mvc.actiondescriptorprovidercontext].invoke (microsoft.aspnet.mvc.actiondescriptorprovidercontext context) [0x00000] in <filename unknown>:0 @ microsoft.aspnet.mvc.defaultactiondescriptorscollectionprovider.getcollection () [0x00000] in <filename unknown>:0 @ microsoft.aspnet.mvc.defaultactiondescriptorscollectionprovider.get_actiondescriptors () [0x00000] in <filename unknown>:0 @ microsoft.aspnet.mvc.routing.attributerouting.getactiondescriptors (iserviceprovider services) [0x00000] in <filename unknown>:0 @ microsoft.aspnet.mvc.routing.attributerouting.createattributemegaroute (irouter target, iserviceprovider services) [0x00000] in <filename unknown>:0 @ microsoft.aspnet.builder.builderextensions.usemvc (iapplicationbuilder app, system.action
1 configureroutes) [0x00000] in :0 @ microsoft.aspnet.builder.builderextensions.usemvc (iapplicationbuilder app) [0x00000] in :0 @ kwebstartup.startup.configure (iapplicationbuilder app) [0x00000] in :0 @ (wrapper managed-to-native) system.reflection.monomethod:internalinvoke (system.reflection.monomethod,object,object[],system.exception&) @ system.reflection.monomethod.invoke (system.object obj, bindingflags invokeattr, system.reflection.binder binder, system.object[] parameters, system.globalization.cultureinfo culture) [0x00000] in :0
there no exact problem in google. tried reinstall kvm, delete , checkout nuget deps.
updated: similar behavior on windows when seek run same project 'k web':
system.missingmethodexception: method not found: 'system.collections.generic.ienumerable1<system.reflection.assemblyname> microsoft.framework.runtime.ilibraryinformation.g et_loadableassemblies()'. @ microsoft.aspnet.mvc.defaultassemblyprovider.<>c__displayclass0.<get_candidateassemblies>b__1(ilibraryinformation l) @ system.linq.enumerable.<selectmanyiterator>d__14
2.movenext() @ system.linq.enumerable.whereselectenumerableiterator2.movenext() @ system.linq.enumerable.<selectmanyiterator>d__14
2.movenext() @ system.linq.enumerable.whereenumerableiterator1.movenext() @ microsoft.aspnet.mvc.controlleractiondescriptorprovider.buildmodel() @ microsoft.aspnet.mvc.controlleractiondescriptorprovider.getdescriptors() @ microsoft.aspnet.mvc.controlleractiondescriptorprovider.invoke(actiondescriptorprovidercontext context, action callnext) @ microsoft.framework.dependencyinjection.nestedproviders.nestedprovidermanager
1.callnext.callnextprovider() @ microsoft.framework.dependencyinjection.nestedproviders.nestedprovidermanager1.invoke(t context) @ microsoft.aspnet.mvc.defaultactiondescriptorscollectionprovider.getcollection() @ microsoft.aspnet.mvc.defaultactiondescriptorscollectionprovider.get_actiondescriptors() @ microsoft.aspnet.mvc.routing.attributerouting.getactiondescriptors(iserviceprovider services) @ microsoft.aspnet.mvc.routing.attributerouting.createattributemegaroute(irouter target, iserviceprovider services) @ microsoft.aspnet.builder.builderextensions.usemvc(iapplicationbuilder app, action
1 configureroutes) @ microsoft.aspnet.builder.builderextensions.usemvc(iapplicationbuilder app) @ hellomvc.startup.configure(iapplicationbuilder app) in c:\prj\home\samples\hellomvc\startup.cs:line 18
seems problem in 1 (or more) of referenced in microsoft.aspnet.mvc.* assemblies. disassemble of defaultassemblyprovider microsoft.aspnet.mvc.core. guess problem in ilibrarymanager's implementations getreferencinglibraries() method. can't find implementation.
public class defaultassemblyprovider : iassemblyprovider { private static readonly hashset<string> _mvcassemblylist; private readonly ilibrarymanager _librarymanager; public ienumerable<assembly> candidateassemblies { { homecoming enumerable.select<assemblyname, assembly>(enumerable.selectmany<ilibraryinformation, assemblyname>(this.getcandidatelibraries(), defaultassemblyprovider.\u003c\u003ec__displayclass0.cs\u0024\u003c\u003e9__cachedanonymousmethoddelegate2 ?? (defaultassemblyprovider.\u003c\u003ec__displayclass0.cs\u0024\u003c\u003e9__cachedanonymousmethoddelegate2 = new func<ilibraryinformation, ienumerable<assemblyname>>(defaultassemblyprovider.\u003c\u003ec__displayclass0.cs\u0024\u003c\u003e9__inst.\u003cget_candidateassemblies\u003eb__1))), new func<assemblyname, assembly>(defaultassemblyprovider.load)); } } static defaultassemblyprovider() { hashset<string> hashset = new hashset<string>((iequalitycomparer<string>) stringcomparer.ordinal); string str1 = "microsoft.aspnet.mvc"; hashset.add(str1); string str2 = "microsoft.aspnet.mvc.core"; hashset.add(str2); string str3 = "microsoft.aspnet.mvc.modelbinding"; hashset.add(str3); string str4 = "microsoft.aspnet.mvc.razor"; hashset.add(str4); string str5 = "microsoft.aspnet.mvc.razor.host"; hashset.add(str5); string str6 = "microsoft.aspnet.mvc.rendering"; hashset.add(str6); defaultassemblyprovider._mvcassemblylist = hashset; } public defaultassemblyprovider(ilibrarymanager librarymanager) { this._librarymanager = librarymanager; } internal ienumerable<ilibraryinformation> getcandidatelibraries() { homecoming enumerable.where<ilibraryinformation>(enumerable.distinct<ilibraryinformation>(enumerable.selectmany<string, ilibraryinformation>((ienumerable<string>) defaultassemblyprovider._mvcassemblylist, new func<string, ienumerable<ilibraryinformation>>(this._librarymanager.getreferencinglibraries))), new func<ilibraryinformation, bool>(defaultassemblyprovider.iscandidatelibrary)); } private static assembly load(assemblyname assemblyname) { homecoming assembly.load(assemblyname); } private static bool iscandidatelibrary(ilibraryinformation library) { homecoming !defaultassemblyprovider._mvcassemblylist.contains(library.get_name()); } }
i had similar problem on windows , found wrong kre active.
executing kvm list
shows list of kre. in case 1.0.0-alpha4
version active instead of more recent beta version.
switching default kvm utilize default
sorted out me.
asp.net-mvc osx kvm asp.net-core kruntime
No comments:
Post a Comment