Skip to content

Tried to run "HelloWeb" on Debian and got "Could not load file or assembly 'Microsoft.Framework.ConfigurationModel.IConfiguration" #350

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
brewerof opened this issue Mar 4, 2015 · 18 comments

Comments

@brewerof
Copy link

brewerof commented Mar 4, 2015

I tried to run demo app "HelloWeb" on Debian, but got
"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 :0 "

I already trying to reinstall KVM and demo examples, ConsoleApp working fine, but HelloWeb and HelloMvc throws this exception.


mono --version
Mono JIT compiler version 3.12.0 (tarball Sat Feb 7 19:12:57 UTC 2015)
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


kvm list

Active Version Runtime Location Alias

1.0.0-beta4-11169 mono ~/.k/runtimes default

@suhasj
Copy link
Contributor

suhasj commented Mar 4, 2015

After package restore, are the packages restored from myget/vnext or nuget ?

@dstaley
Copy link

dstaley commented Mar 4, 2015

@suhasj Looks like I'm getting packages from nuget.

$ cd ~/Desktop/Home/samples/HelloMvc/
$ source kvm.sh
$ kpm restore
Restoring packages for /Users/dstaley/Desktop/Home/samples/HelloMvc/project.json
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='System.Reflection'.
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='System.Text.Encoding'.
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='System.Xml.ReaderWriter'.
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='System.Globalization'.
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='System.Threading.Tasks'.
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='System.Runtime'.
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='System.IO'.
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='System.Collections'.
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='System.ObjectModel'.
  OK https://www.nuget.org/api/v2/FindPackagesById()?Id='System.ObjectModel' 1053ms
  OK https://www.nuget.org/api/v2/FindPackagesById()?Id='System.Runtime' 1112ms
  OK https://www.nuget.org/api/v2/FindPackagesById()?Id='System.Xml.ReaderWriter' 1465ms
  OK https://www.nuget.org/api/v2/FindPackagesById()?Id='System.Globalization' 1967ms
  OK https://www.nuget.org/api/v2/FindPackagesById()?Id='System.Reflection' 8164ms
  OK https://www.nuget.org/api/v2/FindPackagesById()?Id='System.IO' 8504ms
  OK https://www.nuget.org/api/v2/FindPackagesById()?Id='System.Text.Encoding' 9052ms
  OK https://www.nuget.org/api/v2/FindPackagesById()?Id='System.Collections' 9472ms
  OK https://www.nuget.org/api/v2/FindPackagesById()?Id='System.Threading.Tasks' 15579ms
Resolving complete, 23368ms elapsed
Restore complete, 23372ms elapsed
$ k kestrel
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

@davidfowl
Copy link
Member

@suhasj the samples on Home have been broken for 2 releases now 😄

@MattKunze
Copy link

I have the same versions (mint instead of debian), but can't get restore to work:

matt@sushi ~/code/Home/samples/ConsoleApp $ kpm restore
Restoring packages for /home/matt/code/Home/samples/ConsoleApp/project.json
----------
System.IO.FileNotFoundException: Could not load file or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
File name: 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
  at Microsoft.Framework.PackageManager.PackageSourceUtils.CreatePackageFeed (NuGet.PackageSource source, Boolean noCache, Boolean ignoreFailedSources, Microsoft.Framework.PackageManager.Reports reports) [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.RestoreCommand.AddRemoteProvidersFromSources (System.Collections.Generic.List`1 remoteProviders, System.Collections.Generic.List`1 effectiveSources) [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.RestoreCommand+<RestoreForProject>d__79.MoveNext () [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 System.Runtime.CompilerServices.TaskAwaiter`1[System.Boolean].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.RestoreCommand+<>c__DisplayClass77_0+<<ExecuteCommand>b__0>d.MoveNext () [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 System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.RestoreCommand+<ExecuteCommand>d__77.MoveNext () [0x00000] in <filename unknown>:0 
----------
Restore failed
Could not load file or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

@davidfowl
Copy link
Member

@MattKunze Looks like you need to update your mono build

@MattKunze
Copy link

Yeah, just did. I'll uninstall and reinstall and see if that helps

@davidfowl
Copy link
Member

mono --version

@MattKunze
Copy link

3.12, same as @brewerof

matt@sushi ~/code/Home/samples/ConsoleApp $ mono --version
Mono JIT compiler version 3.12.0 (tarball Sat Feb  7 19:12:57 UTC 2015)
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```

@MattKunze
Copy link

nm, apt-get install mono-complete seems to have done the trick. I had added the Xamarin package sources and ran upgrade, but that doesn't include everything on Linux Mint

@CoaxVex
Copy link

CoaxVex commented Mar 4, 2015

I'm seeing the same behaviour as brewerof on Ubuntu 14.04.
On an older installation it still works, but when I delete my ~/.k/packages directory and run kpm restore again, the application won't run anymore.

Restoring ~/.k/packages solves the problem, so I'm guessing something on a nuget package broke.

@brewerof
Copy link
Author

brewerof commented Mar 4, 2015

I tried solution from here: #310, that @andrebaltieri suggested.

Added NuGet.config to the HelloWeb root and changed project.json, but problem still remains

@davidfowl
Copy link
Member

The samples point to beta1, change the project.json to beta3

@andrebaltieri
Copy link

@brewerof I think people are confusing packages and versions...

If you're running beta-* from dev branch, you should point to the correct nuget package, by including the NuGet.config on your app root folder or change the main config file, poiting to the correct dev package source.

If you're running beta-* from master branch, than you just use the default package source.

In additional, if you are running beta-x (Run "kvm list" to see yout current version), than your project.json should point to beta-x too!

@dstaley
Copy link

dstaley commented Mar 4, 2015

Replacing beta1 with beta3 in the project.json file seems to have done the trick! I was able to run k kestrel and get the welcome to ASP.NET vNext message. Can I submit a PR to update the dependencies to beta3?

@davidfowl
Copy link
Member

#348

@dstaley
Copy link

dstaley commented Mar 4, 2015

@davidfowl 👍

@brewerof
Copy link
Author

brewerof commented Mar 4, 2015

@andrebaltieri, kvm list gave me

Active Version Runtime Location Alias


  • 1.0.0-beta4-11169 mono ~/.k/runtimes default

but beta-value in project.json must point to ver.3

As I understood I should install kre beta3 also?

@danroth27
Copy link
Member

@brewerof Because things are still churning quite a bit it's generally a good idea to run the same version of everything. Once things have stabilized a bit more it should be possible to upgrade your KRE without breaking everything, but we just aren't there yet.

@danroth27 danroth27 reopened this Mar 9, 2015
natemcmaster pushed a commit that referenced this issue Nov 21, 2018
- aspnet/Testing#248
- xUnit no longer supports .NET 4.5.1
- build tests for desktop .NET only on Windows

Address existing issues
- work around test failures, including #350
  - skip tests mentioned in #350
  - reorder xunit and xunit.runner.visualstudio; setup fails for .NET Core otherwise
- skip all tests using LocalDB on Linux and OSX
  - `[FrameworkSkipCondition(RuntimeFrameworks.Mono)]` now redundant
- correct AppVeyor image

nits:
- let VS add the test `<Service>`
- use `[ConditionalFact]` when there's no test data
natemcmaster pushed a commit that referenced this issue Nov 21, 2018
natemcmaster pushed a commit that referenced this issue Nov 30, 2018
@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants