-
Dec 5th, 2018, 09:40 AM
#1
Thread Starter
Hyperactive Member
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.'
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
-
Dec 5th, 2018, 09:59 AM
#2
Junior Member
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?
-
Dec 5th, 2018, 10:07 AM
#3
Junior Member
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>>
-
Dec 5th, 2018, 10:22 AM
#4
Thread Starter
Hyperactive Member
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.
-
Dec 5th, 2018, 10:55 AM
#5
Junior Member
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.
-
Dec 5th, 2018, 12:20 PM
#6
Thread Starter
Hyperactive Member
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.
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
-
Dec 5th, 2018, 01:06 PM
#7
Junior Member
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.
-
Dec 6th, 2018, 05:43 AM
#8
Thread Starter
Hyperactive Member
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.
-
Dec 6th, 2018, 10:30 AM
#9
Junior Member
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
-
Dec 7th, 2018, 09:30 AM
#10
Thread Starter
Hyperactive Member
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.
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:
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.
-
Dec 7th, 2018, 09:32 AM
#11
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|