3

I have installed mono 3.10.0 from source in my Linux VM (Centos 7)

I have installed KVM using the link provided in ASP.NET home on Github

curl -sSL https://raw.githubusercontent.com/aspnet/Home/master/kvminstall.sh | sh && source ~/.kre/kvm/kvm.sh  

and kpm restore is working file and restoring all packages

but i am not able to run k kestrel in the HelloMvc samples from Asp.Net Home Github
I gives error

System.NullReferenceException: Object reference not set to an instance of an object
  at Microsoft.AspNet.Server.Kestrel.Networking.Libuv.loop_size () [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Server.Kestrel.Networking.UvLoopHandle.Init (Microsoft.AspNet.Server.Kestrel.Networking.Libuv uv) [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Server.Kestrel.KestrelThread.ThreadStart (System.Object parameter) [0x00000] in <filename unknown>:0 

I have also tried to isntall libuv from source still no luck

Edit

Steps Followed for libuv install :

wget http://dist.libuv.org/dist/v1.0.0-rc1/libuv-v1.0.0-rc2.tar.gz
tar -xvf libuv-v1.0.0-rc2.tar.gz
cd libuv-v1.0.0-rc2/
./gyp_uv.py -f make -Duv_library=shared_library
make -C out
sudo cp out/Debug/lib.target/libuv.so /usr/lib/libuv.so.1.0.0-rc2
sudo ln -s libuv.so.1.0.0-rc2 /usr/lib/libuv.so.1

Exception after installing Libuv again

System.ArgumentException: An element with the same key already exists in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (System.Collections.Generic.TKey key, System.Collections.Generic.TValue value) [0x00000] in <filename unknown>:0 
  at System.Linq.Enumerable.ToDictionary[DictionaryEntry,String,String] (IEnumerable`1 source, System.Func`2 keySelector, System.Func`2 elementSelector, IEqualityComparer`1 comparer) [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.ConfigurationModel.EnvironmentVariablesConfigurationSource.Load (IDictionary envVariables) [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.ConfigurationModel.EnvironmentVariablesConfigurationSource.Load () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.ConfigurationModel.Configuration.Add (IConfigurationSource configurationSource) [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.ConfigurationModel.ConfigurationExtensions.AddEnvironmentVariables (IConfigurationSourceContainer configuration) [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Hosting.Program.Main (System.String[] args) [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 
1
  • This is definitely a libuv error. Can you list the steps you took to compile and symlink libuv locally ? Dec 26, 2014 at 20:18

3 Answers 3

2

Take a look at http://olivierlefebvre.tumblr.com/post/101523386694/asp-vnext-alpa4-on-ubuntu

I fixed like that.

Step Used

git clone https://github.com/joyent/libuv.git
cd libuv
sh autogen.sh
./configure
make
make check
sudo make install

Final by adding a symlink to the lib

ln /usr/local/lib/libuv.so -sf ~/.kpm/packages/Microsoft.AspNet.Server.Kestrel/1.0.0-alpha4/native/darwin/universal/libuv.dylib 
4
  • I tried your method for Libuv and not the exception message is changed... See question for updated info
    – Ankesh
    Dec 29, 2014 at 7:09
  • The exception you have after re installing libuv comes because you have doublon in your environment variable, list your env vars and delete doublon. It's not case sensitive Dec 29, 2014 at 9:47
  • could you elaborate on the doublon... Does it mean environment variables in CAPS and SMALL both...
    – Ankesh
    Dec 29, 2014 at 12:35
  • yes, it's not case sensitive, so if you have a var name for exemple HTTP_PROXY and http_proxy, it's consider as the same var. take a look at source code on github Dec 29, 2014 at 12:50
2

Take a look at http://carolynvanslyck.com/blog/2014/09/dotnet-vnext-impressions/ the section on Kestrel.

wget http://dist.libuv.org/dist/v1.0.0-rc2/libuv-v1.0.0-rc2.tar.gz
tar -xvf libuv-v1.0.0-rc2.tar.gz
cd libuv-v1.0.0-rc2/
./gyp_uv.py -f make -Duv_library=shared_library
make -C out
sudo cp out/Debug/lib.target/libuv.so /usr/lib/libuv.so.1.0.0-rc2
sudo ln -s libuv.so.1.0.0-rc2 /usr/lib/libuv.so.1

This worked for me

1
  • I tried your method for Libuv and not the exception message is changed... See question for updated info
    – Ankesh
    Dec 29, 2014 at 7:07
1

You got an exception because you have two variables with the same name but in the different case. Dump all environment variables before start:

printenv > env.dump

find duplicated variables and before start unset one of them (save the original value before to restore it after)

Here is script init.d with example

Just save and unset variable:

TMP_SAVE_runlevel_VAR=$runlevel
unset runlevel

And the restore it:

export runlevel=$TMP_SAVE_runlevel_VAR

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.