Nuget installation fails with "methods is null"

113 views
Skip to first unread message

Rob

unread,
Apr 5, 2013, 3:39:01 AM4/5/13
to knocko...@googlegroups.com
Hi there,

today I wanted to ake a closer look at knockoutmvc in Visual Studio Professional 2012. When trying to install the kMVC package with

Install-Package kMVC

the installation completes and the NuGet log tells me that "kMVC 0.5.4" was succesfully installed and added to my project. But right after that, a dialog pops up with the message "methods is null". After clicking ok the NuGet log shows some red errors as seen below (some messages appear in German as that is my local language):

Sie können keine Methode für einen Ausdruck mit dem Wert NULL aufrufen.
Bei C:\Projekte\PAMVCTEST\packages\kMVC.0.5.4\tools\install.ps1:13 Zeichen:43
+ $edit = $method.StartPoint.CreateEditPoint <<<< ();
    + CategoryInfo          : InvalidOperation: (CreateEditPoint:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull
 
Sie können keine Methode für einen Ausdruck mit dem Wert NULL aufrufen.
Bei C:\Projekte\PAMVCTEST\packages\kMVC.0.5.4\tools\install.ps1:14 Zeichen:15
+ $edit.LineDown <<<< ()
    + CategoryInfo          : InvalidOperation: (LineDown:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull
 
Sie können keine Methode für einen Ausdruck mit dem Wert NULL aufrufen.
Bei C:\Projekte\PAMVCTEST\packages\kMVC.0.5.4\tools\install.ps1:15 Zeichen:16
+ $edit.CharRight <<<< (1)
    + CategoryInfo          : InvalidOperation: (CharRight:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull
 
Sie können keine Methode für einen Ausdruck mit dem Wert NULL aufrufen.
Bei C:\Projekte\PAMVCTEST\packages\kMVC.0.5.4\tools\install.ps1:16 Zeichen:13
+ $edit.Insert <<<< ([Environment]::NewLine)
    + CategoryInfo          : InvalidOperation: (Insert:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull
 
Sie können keine Methode für einen Ausdruck mit dem Wert NULL aufrufen.
Bei C:\Projekte\PAMVCTEST\packages\kMVC.0.5.4\tools\install.ps1:17 Zeichen:13
+ $edit.Insert <<<< ("      ModelBinders.Binders.DefaultBinder = new PerpetuumSoft.Knockout.KnockoutModelBinder();")
    + CategoryInfo          : InvalidOperation: (Insert:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

 
When I ignore the errors and try to run my project, it basically works just as before, except for the test page where I included the scripts and use the knockoutcontroller etc. (as described in the Quickstart)... nothing happens, no error message, the browser tries to load the page and keeps loading. When I manually switch to another (non-knockout) page it works. Restarting, rebooting, re-installing kMVC didn't help.

Is there something I can do about it? I'd love to use kMVC as it perfectly fits my needs for his very project. Thanks in advance for your help!

Regards,
Rob

Andrey Akinshin

unread,
Apr 5, 2013, 5:02:22 AM4/5/13
to knocko...@googlegroups.com
Hi, Rob.

I am confused by your problem. This is very strange behavior. Obviously, you have some problems with the installation script, lines 13–17. You should try to make this instruction manually:
1. Open "Global.asax.cs" file in root directory of your project.
2. Find method "Application_Start()"
3. Add the following line:
ModelBinders.Binders.DefaultBinder = new KnockoutModelBinder();
Which is implied in lines 13–17 of the install.ps1.

Andrey Akinshin,
Knockout MVC team.

Rob

unread,
Apr 5, 2013, 8:15:08 AM4/5/13
to knocko...@googlegroups.com
Hi Andrey,

thanks for your response, it seems to be working now. When creating a "fresh" project and repeating the steps, everything behaves correctly, it seems I've had some script issues with my existing project.
Message has been deleted

Patee Gutee

unread,
Nov 6, 2019, 2:45:34 PM11/6/19
to Knockout MVC
I have been trying out kMVC for a couple of weeks now and I am also experiencing the same error ("methods is null") when installing the kMVC package via nuget on all of my existing and newly created sample ASP.NET MVC 4 projects. I tried it on a couple of different machines one with VS 2017 and the other VS 2019 still I get the same error message.

Also, in one of my existing project, in my Global.asax.cs file I already hooked up a custom model binder which is basically a function to trim all string values. Can I just add the KnockoutModelBinder after that line like so?
ModelBinders.Binders.DefaultBinder = new TrimModelBinder();
ModelBinders.Binders.DefaultBinder = new KnockoutModelBinder();

Reply all
Reply to author
Forward
0 new messages