locked
NuGet Packages Issue RRS feed

  • Question

  • Hello,

    I am trying to follow along with the text Pro ASP.Net MVC5.  I have run into issues regarding Installing packages.  Currently my situation is this.  I installed the package for Ninject, and after some issues there, I seem to have accomplished that correctly.  The text then advises me to add a using statement, "using Ninject;".  When I do that, it tells me that a reference or assembly is missing.  There is a packages.config file, and when I open that, I see the Ninject references there, but strangely, the top element <packages> is underlined and the error message is "The packages element is not declared".  I have opened this project in VS 2015 Professional as well as VS 2013 Web Express and the condition is the same.  Any insight and/or help would be appreciated.

    Thanks, Ed

    Monday, August 24, 2015 2:51 PM

Answers

  • An unload/reload of this seems to have solved the issue.  Oh what fun!
    • Marked as answer by Ed Bick Monday, August 24, 2015 11:55 PM
    Monday, August 24, 2015 11:55 PM

All replies

  • Hi Ed,

    This is not asp.net forum but C#. You should direct your Asp.NET related questions to forums.asp.net

    I think your ninject version is not compatible with MVC5.

    In your PM window can you please run this code line:

    Install-Package Ninject.MVC5

    Monday, August 24, 2015 5:27 PM
  • Thanks for the response....I was looking for an ASP forum in the list and did not see one, but as to your suggestion, The book I am following was written by a highly regarded, experienced programmer who has written several books and was discussing MVC5. He was very clear about the versions of the packages he was instructing be installed.  They seemed to have been compatible for him, unless something changed in between the time he wrote the book and now.  I will await some other responses before I try yours.  Thanks again.

    QUOTED FROM THE AUTHOR:  There are many NuGet commands to enter because I am being selective about which packages NuGet installs into which projects and, as in previous chapters, I am specifying particular versions of the packages to download and install.

    The first command installs the Ninject core package and the others install extensions to the core that makes Ninject work nicely with ASP.NET applications (as I explain shortly). Do not be put off by the reference to MVC3 in the last package name–it works just fine with MVC 5. I have used the version argument to install specific versions of these packages. These are the latest versions as I write this. You should use the version argument to ensure that you get the right results in the examples for this chapter, but you can omit the argument and get the latest (and potentially more recent) releases for real projects


    • Edited by Ed Bick Monday, August 24, 2015 7:23 PM
    Monday, August 24, 2015 7:21 PM
  • An unload/reload of this seems to have solved the issue.  Oh what fun!
    • Marked as answer by Ed Bick Monday, August 24, 2015 11:55 PM
    Monday, August 24, 2015 11:55 PM