dcsimg
Results 1 to 11 of 11

Thread: Problem installing Microsoft.AspNet.Providers.LocalDB" version="2.0.1 in VS 2017

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2014
    Posts
    437

    Problem installing Microsoft.AspNet.Providers.LocalDB" version="2.0.1 in VS 2017

    Hello

    When I opened my VS 2017 Web forms project earlier, the Package Manager Console invited me to 'Restore packages'. So, I pressed the Restore button and a number of packages were successfully restored.

    However, the Package Manager Console informs me that 'Microsoft.AspNet.Providers.LocalDB" version="2.0.1" could not be found on 'source C:\Program Files (x86)\Microsoft SDKs\NuGet Packages\. https://asp.nuget.org/v3/index.json. An error occured while sending the request. The remote name could not be resolved: 'api.nuget.org.'

    Name:  RestorePackages.jpg
Views: 105
Size:  11.5 KB

    However, in the packages.config file, I can see 'Microsoft.AspNet.Providers.LocalDB" version="2.0.1"

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <packages>
    
      <package id="AspNet.ScriptManager.jQuery" version="1.8.2" targetFramework="net40" />
      <package id="AspNet.ScriptManager.jQuery.UI.Combined" version="1.8.24" targetFramework="net40" />
      <package id="DotNetOpenAuth.AspNet" version="4.1.4.12333" targetFramework="net40" />
      <package id="DotNetOpenAuth.Core" version="4.1.4.12333" targetFramework="net40" />
      <package id="DotNetOpenAuth.OAuth.Consumer" version="4.1.4.12333" targetFramework="net40" />
      <package id="DotNetOpenAuth.OAuth.Core" version="4.1.4.12333" targetFramework="net40" />
      <package id="DotNetOpenAuth.OpenId.Core" version="4.1.4.12333" targetFramework="net40" />
      <package id="DotNetOpenAuth.OpenId.RelyingParty" version="4.1.4.12333" targetFramework="net40" />
      <package id="EntityFramework" version="6.1.3" targetFramework="net40" />
      <package id="jQuery" version="1.8.2" targetFramework="net40" />
      <package id="jQuery.UI.Combined" version="1.8.24" targetFramework="net40" />
      <package id="MarkdownSharp" version="1.13.0.0" targetFramework="net40" />
      <package id="Microsoft.AspNet.FriendlyUrls.Core" version="1.0.0" targetFramework="net40" />
      <package id="Microsoft.AspNet.Membership.OpenAuth" version="2.0.1" targetFramework="net40" />
      <package id="Microsoft.AspNet.Providers.Core" version="2.0.0" targetFramework="net40" />
      <package id="Microsoft.AspNet.Providers.LocalDB" version="2.0.1" targetFramework="net40" />
      <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net40" />
      <package id="Modernizr" version="2.6.2" targetFramework="net40" />
      <package id="System.Web.Helpers.Crypto" version="3.2.3" targetFramework="net40" />
      <package id="WebHelpers" version="4.0.2" targetFramework="net40" />
    </packages>
    How can I correct this, please? In the Package Manager Console itself, I have 'All' under 'Package source' and the name of
    my project under 'Default project'.

    What I have noticed is that in the packages.config file above, there is a green underline under 'packages' here:

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    
    <packages>
    with the error: 'The 'packages' is not declared'.

    Are the two issues related How would I resolve this, please?

    Steve

  2. #2
    Junior Member
    Join Date
    Nov 2018
    Posts
    20

    Re: Problem installing Microsoft.AspNet.Providers.LocalDB" version="2.0.1 in VS 2017

    Try looking in your Solutions folder double check to see if you have the Bin folder with the proper Providers.LocalDB.dll libraries associated with it.

    My other guess for you is if you are using a database do you have permissions to access it?

  3. #3
    Junior Member
    Join Date
    Nov 2018
    Posts
    20

    Re: Problem installing Microsoft.AspNet.Providers.LocalDB" version="2.0.1 in VS 2017

    Also try using the command prompt in Nuget Manager

    <Update-Package –reinstall <package_name>>

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2014
    Posts
    437

    Re: Problem installing Microsoft.AspNet.Providers.LocalDB" version="2.0.1 in VS 2017

    Thanks Tygre

    I have just accessed the DB without a problem.

    I have no file in the Bin folder called 'Providers.LocalDB.dll' Would I just manually download it from the NuGet site and place it in the Bin folder or do I install it through the Package Manager Console?

    Thanks again.

  5. #5
    Junior Member
    Join Date
    Nov 2018
    Posts
    20

    Re: Problem installing Microsoft.AspNet.Providers.LocalDB" version="2.0.1 in VS 2017

    There is two ways to go about installing Microsoft.ASP.NET.Providers.LocalDB:


    In Microsoft visual Studio 17 (TAB)Project -> (TAB)Manage Nugget Packages; This is where you install packages;
    lookup "Providers.LocalDB"


    In Microsoft visual Studio 17 (TAB)Tools -> (TAB)NugetPackageManager; This is where you can launch the command prompt.



    Check your
    (name of)project Folder -> bin -> this should have some reference to what to use
    (name of)project Folder -> packages -> this should have some reference to the library where it will use the local DB


    In your app.config file should have something like this

    Code:
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
    
    <entityFramework>
        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
          <parameters>
            <parameter value="v13.0" />
          </parameters>
        </defaultConnectionFactory>
        <providers>
          <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
        </providers>
      </entityFramework>
    My guess is that since you have said that you don't have a .dll file inside of your bin folder it's causing it to error. When the application complies itself and gives an error that says "packages' is not declared"
    that pretty much a dead giveaway the application itself doesn't know how to use a package because it's not installed/ or missing.


    Try to uninstall and reinstall the local DB.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2014
    Posts
    437

    Re: Problem installing Microsoft.AspNet.Providers.LocalDB" version="2.0.1 in VS 2017

    Thanks again.

    I have reinstalled the DB (MS Access).

    app.config? Where is that, please? Do you mean Web.config?

    In 'Manage packages for Solution' I can see the LocalDB package. Please see below.

    Name:  notAvailable.jpg
Views: 24
Size:  6.9 KB

    It is 'not available in this package'. When I move the mouse over that downward green arrow, it says 'latest stable edition is installed'.

    Steve

  7. #7
    Junior Member
    Join Date
    Nov 2018
    Posts
    20

    Re: Problem installing Microsoft.AspNet.Providers.LocalDB" version="2.0.1 in VS 2017

    WHAT are you using Microsoft Access???????

    Web.Config and app.config perform same configuration functions its just determined by the hosting environment.

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2014
    Posts
    437

    Re: Problem installing Microsoft.AspNet.Providers.LocalDB" version="2.0.1 in VS 2017

    I will have a go at incorporating what I already have in Web.config with your <runtime> and <entityFramework> code.

    If, as my latest screenshot indicates, the 'latest stable edition [of the LocalDB package] is installed', which folder is it likely to be in, please, in view of the original message I got that 'Microsoft.AspNet.Providers.LocalDB" version="2.0.1" could not be found on 'source C:\Program Files (x86)\Microsoft SDKs\NuGet Packages\.

    Thanks again.

  9. #9
    Junior Member
    Join Date
    Nov 2018
    Posts
    20

    Re: Problem installing Microsoft.AspNet.Providers.LocalDB" version="2.0.1 in VS 2017

    SORRY MAN! Wish I could be of help.

    I don't know anything about your project, I was examining by the type of error you were getting that
    'could not be found' was looking for file extensions that was not present.

    Hopefully you can get your Local DB up an running again. Other folks seem to have similar problems I attached a link below.


    https://stackoverflow.com/questions/...-nuget-package

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2014
    Posts
    437

    Re: Problem installing Microsoft.AspNet.Providers.LocalDB" version="2.0.1 in VS 2017

    Many thanks for your patience.

    This is a screenshot of my packages.config file in Solution Explorer.

    Name:  packages_config screenshot.jpg
Views: 9
Size:  54.8 KB

    In other words, VS 2017, which tells me 'Unable to find version 2.0.1 Microsoft.AspNet.Providers.LocalDB', has that same package in 'packages.config'. I am unsure, therefore, why VS can't find it's own package.

    As to where the Microsoft.AspNet.Providers.LocalDB file was situtated on my hard drive, I did a whole C drive search and got this:

    Name:  Fig1.jpg
Views: 9
Size:  38.0 KB

    Name:  Fig2.jpg
Views: 9
Size:  27.0 KB

    My project's name appears in the VS 2017 icon on my Start menu, as in 'myProject.sln', and opens up in VS 2017. In the Package manager Console, I can see my project's name under 'Default project', and <packages> in my 'packages.config' file in Solution Explorer has an error: 'The 'packages' element is not declared'.

    Thanks again.

  11. #11

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2014
    Posts
    437

    Re: Problem installing Microsoft.AspNet.Providers.LocalDB" version="2.0.1 in VS 2017

    Many thanks for the link - I will take a peek.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width