Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Nuget Package Restore error, dependency warnings #4117


User avatar
0
nickkellett created

I have yellow dependency warnings and when I try to do a Nuget Restore, I get the following error: "Error occurred while restoring NuGet packages: The given key was not present in the dictionary. "

Perhaps as a result of this, when I launch the app and login (successfully) I get a strange page result and can't proceed any farther. Screenshots attached. Am using .NET Core MVC + JQuery.


12 Answer(s)
  • User Avatar
    0
    alirizaadiyahsi created

    Hi, which version of VS 17 are you using?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @NickKellett,

    Do you have any javascript error in browser's javascript console when you open login page ? Your problem might be related to javascript libraries.

  • User Avatar
    0
    nickkellett created

    Hi, I'm using VS 2017 community edition 15.4.1. I do get a JS error: TypeError: abp.localization is undefined.

  • User Avatar
    0
    nickkellett created

    I fixed my js error on the front-end - it was because I hadn't run bower. I think that should be added to the instructions here: <a class="postlink" href="https://aspnetzero.com/Documents/Getting-Started-Core">https://aspnetzero.com/Documents/Getting-Started-Core</a> However I'm still wondering about the NuGet package restore error, and the yellow warnings in the dependencies. So I would say this issue is still open :)

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @NickKellett,

    Actually Visual Studio build should also install bower packages but we will add this information to our documentation. If you expand the nuget package with warning until you see the actual warning message, it can give you a better idea.

    As far as I remember, Visual Studio shows these warnings even with small nuget oackage version differences.

    Thanks.

  • User Avatar
    0
    nickkellett created

    Ok, thanks about the warning information, but what about the package restore error?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @NickKellett,

    Sorry, I missed that point. Can you share the Logs of Visual Studio's output window ?

  • User Avatar
    0
    nickkellett created

    No problem at all. Here's the only output I see: Restoring NuGet packages... Time Elapsed: 00:00:23.0552358 ========== Finished ==========

    Error occurred while restoring NuGet packages: The given key was not present in the dictionary.

    Not much to go on :)

  • User Avatar
    0
    jdavis01 created

    I solved this issue the following way

    1. build each individual project except Web.Public
    2. opened the Web.Public folder from the VS 2017 command prompt as an administrator
    3. execute "dotnet restore" command
    4. Return to the ide and build the Web.Public project
    5. Clean Solution and Rebuild the entire solution

    Hope that helps.. Not sure why I had to do all this, but it worked for me. Honestly I think VS gets lost

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi All,

    If it does not work for any of you, you can try the solution offered in this issue <a class="postlink" href="https://github.com/dotnet/standard/issues/439#issuecomment-335676617">https://github.com/dotnet/standard/issu ... -335676617</a>.

    Basically, you need to run "dotnet nuget locals all --clear".

  • User Avatar
    0
    nickkellett created

    Thanks @jdavis01 - I tried that but it didn't work for me (even when doing the restore on each project). However since everything else seems to work well and I think this may be a VS issue as well, I'm going to park it for now.

    As a side note, I just wanted to say that in general I really like what I see here, and I've already been able to convert my test project to use AWS Aurora db, so this is a pretty awesome framework.

  • User Avatar
    0
    nickkellett created

    Hi @ismcagdas - I tried that thanks but it didn't work. Still get the same issue about key not being present. It may well be a .NET core / VS issue so I'm just going to park it for now.