Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET vNext - KVM Could not load file

  • Software Versions
  • OS: MacX Version: 10.10.2
  • Sh: 3.2.57
  • K Version Manager - Build 10319

Installed KVM via Brew. Using the GitHub Documents. Here

Cloned the Sample. Using Sample HelloMVC 'kvm restore' ran no errors

'k web'

I receive:

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Framework.ConfigurationModel.IConfiguration, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
File name: 'Microsoft.Framework.ConfigurationModel.IConfiguration, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
  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 

Any Idea on where or how to approach this?

EDIT

The fix did work. I del my dir, Re-Cloned from github walked through the steps from the fix below and yes it worked now I run

k kestrel

Microsoft.Framework.Runtime.Roslyn.RoslynCompilationException: /Users/dsmith/Projects/Home/samples/HelloMVC/Startup.cs(11,17): error CS1061: 'IApplicationBuilder' does not contain a definition for 'UseErrorPage' and no extension method 'UseErrorPage' accepting a first argument of type 'IApplicationBuilder' could be found (are you missing a using directive or an assembly reference?)

This is a C# compile error, That means the assemblies were found and tried to compile so I am making progress I will did see this error referenced on the Github issue that was supplied as an answer below.. If I get farther I will post what I find Thanks!

like image 214
Derek S Avatar asked Feb 06 '15 17:02

Derek S


1 Answers

Ok, so I got this to work based on the help given in the github issue (https://github.com/aspnet/Home/issues/310).

First I ran

kvm upgrade

then I copied the contents of the Nuget.config as outlined in the github post into Nuget.config in the root of the website

<configuration>
    <packageSources>
        <add key="AspNetVNext" value="https://www.myget.org/F/aspnetrelease/" />
        <add key="NuGet.org" value="https://nuget.org/api/v2/" />
    </packageSources>
    <packageSourceCredentials>
        <AspNetVNext>
            <add key="Username" value="aspnetreadonly" />
            <add key="ClearTextPassword" value="4d8a2d9c-7b80-4162-9978-47e918c9658c" />
        </AspNetVNext>
    </packageSourceCredentials> </configuration>

Then, modified the package.json as below

"dependencies": {
        "Microsoft.AspNet.Server.IIS":"1.0.0-*",
        "Microsoft.AspNet.Mvc": "6.0.0-*",
        "Microsoft.AspNet.Hosting": "1.0.0-*",
        "Microsoft.AspNet.Security.Cookies": "1.0.0-*",
        "Microsoft.AspNet.Server.WebListener": "1.0.0-*",
        "Microsoft.AspNet.StaticFiles": "1.0.0-*",
        "Kestrel": "1.0.0-*"
    },

Next I ran

kpm restore

This pulled down beta3 versions of a lot of packages (beta1 was coming down before)

And finally,

k kestrel

Because k web gave me an error about a dll. Dink dank doo.. Bob's your uncle.. localhost:5004 showed me an ASP.NET website

like image 134
tbddeveloper Avatar answered Nov 05 '22 19:11

tbddeveloper