I found Stephen Cleary's double ended queue for NET 2.0. When I install it with pm in visual studio Net 2.1 I get this error:
"PM> Install-Package Nito.Collections.Deque -Version 1.0.4
Install-Package : Project 'Default' is not found.
At line:1 char:1
+ Install-Package Nito.Collections.Deque -Version 1.0.4
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Default:String) [Install-Package], ItemNotFoundException
+ FullyQualifiedErrorId : NuGetProjectNotFound,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand"
It appears pm was in a bad state. I rebooted Visual Studio 2017 and the default project appeared. I was able to install the deque package.
The comments helped me to solve this issue by pointing out to look for where the default project is
Related
I am following this beginners tutorial on Microsoft's site.
At this step...
In the PMC, run the following command:
Install-Package Microsoft.EntityFrameworkCore.SqlServer
When I enter that command I get these messages and errors..
PM> Install-Package Microsoft.EntityFrameworkCore.SqlServer
Restoring packages for C:\projects\LazerbaseASPNET\LazerbaseASPNET\LazerbaseASPNET.csproj...
GET https://api.nuget.org/v3-flatcontainer/microsoft.entityframeworkcore.sqlserver/index.json
OK https://api.nuget.org/v3-flatcontainer/microsoft.entityframeworkcore.sqlserver/index.json 208ms
GET https://api.nuget.org/v3-flatcontainer/microsoft.entityframeworkcore.sqlserver/6.0.7/microsoft.entityframeworkcore.sqlserver.6.0.7.nupkg
OK https://api.nuget.org/v3-flatcontainer/microsoft.entityframeworkcore.sqlserver/6.0.7/microsoft.entityframeworkcore.sqlserver.6.0.7.nupkg 71ms
Installed Microsoft.EntityFrameworkCore.SqlServer 6.0.7 from https://api.nuget.org/v3/index.json with content hash D9YV3hc3VSN1qrfdrZcKtMcRLT6bUqj8KtaUdkmO1CH/+meL+8z3Rge5iPhwQ4ol2AwPQlQYVPTTajf9ulSFGg==.
Install-Package : NU1202: Package Microsoft.EntityFrameworkCore.SqlServer 6.0.7 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package
Microsoft.EntityFrameworkCore.SqlServer 6.0.7 supports: net6.0 (.NETCoreApp,Version=v6.0)
At line:1 char:1
+ Install-Package Microsoft.EntityFrameworkCore.SqlServer
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
Install-Package : Package restore failed. Rolling back package changes for 'LazerbaseASPNET'.
At line:1 char:1
+ Install-Package Microsoft.EntityFrameworkCore.SqlServer
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
Time Elapsed: 00:00:03.2286177
Seems the important one is this...
Package Microsoft.EntityFrameworkCore.SqlServer 6.0.7 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package
Microsoft.EntityFrameworkCore.SqlServer 6.0.7 supports: net6.0
This tutorial is for asp.net core 3.1.. It seems to be the one they recommend for beginners also. I am at a impass and have no idea how to proceed.
EDIT:
I think this is cus I used Visual Studio 2019 which I already had installed for Unity.. asp.net core 3.1 was the only option available for a new project... I think I need to wipe the existing server from azure, download Visual Studio 2022 and start again with a asp.net core 6 app ?
You can try to install entity framework core through the nuget package manager.
Rightclick on your project -> Manage Nuget packages. Before installing select the correct version from the dropdown for the netcore app version you are running.
I think this is cus I used Visual Studio 2019 which I already had installed for Unity.. asp.net core 3.1 was the only option available for a new project.
The solution is wipe the existing server from azure, download Visual Studio 2022 and start again with a asp.net core 6 app.
FML.
I also want to point out that this tutorial is wrong. Earlier in it it says requirement is Visual Studio 2019 16.4 or later.
I did read this and checked the version of Visual studio I had installed, I met the requirements so I kept going.
I have a simple WebAPI project (.NET 6) using VS Community 2022 and I'm trying to add a migration in package manager console with the following command:
add-migration initial
which leads to the following error:
add-migration : Exception calling "Start" with "1" argument(s):
"The specified executable is not a valid application for this OS platform."
At line:1 char:1
+ add-migration initial
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:)
[Add-Migration], MethodInvocationException
+ FullyQualifiedErrorId : Win32Exception,Add-Migration
The exact same code runs on VS Community 2019 (.NET 5) without any issues, so I don't think it has anything to do with the code.
Even an empty WebAPI project in VS 2022 (with Microsoft.EntityFrameworkCore.Tools package installed) throws the same Win32Exception.
On the other hand, in VS 2019, the empty WebAPI project (with Microsoft.EntityFrameworkCore.Tools package installed) gives the "No DbContext was found" error, which is expected.
I've also tried reinstalling the packages and restarting visual studio and it didn't work. I'd appreciate your help!
I have installed the following NuGet Packages:
Microsoft.EntityFrameworkCore
Microsoft.EntityFrameworkCore.Tools
Microsoft.EntityFrameworkCore.Design
Microsoft.EntityFrameworkCore.SqlServer
I think you are facing this issue when you trying to scafolding database constraints for that while writing the connection string. Replace "\\" with "\"
Example:- Local\\database should be Local\database
I am trying to install the package Microsoft.Extensions.DependencyInjection.Abstractions in my Visual Studio 2013 solution as part of a Sitecore installation. The solution has .NET target framework 4.5.2.
The installation fails with
Install-Package : Could not install package 'Microsoft.Extensions.DependencyInjection.Abstractions 1.0.0'. You are trying to install this package into a project that targets
'.NETFramework,Version=v4.5.2', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the
package author.
At line:1 char:1
+ Install-Package Microsoft.Extensions.DependencyInjection.Abstractions -Version 1 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
I have tried performing the installation in a completely new, empty solution but the installation still fails.
According to the link, there is a dependency to .NETStandard 1.0 but this should be supported by 4.5 according to this.
JaCraig's commment helped me solve this: I upgraded Nuget Package Manager from 2.8 to 2.12. Afterwards, there were no problems with the installation.
I'm trying to install the MaxMind MinFraud package via NuGet. Whenever I try, I get the following back -
PM> install-package MaxMind.MinFraud
Attempting to resolve dependency 'System.Net.Http (≥ 4.0.0)'.
install-package : 'System.Net.Http' already has a dependency defined for 'System.Runtime'.
At line:1 char:1
+ install-package MaxMind.MinFraud
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
A few other similar questions here suggested restarting VS, manually adding a reference to System.Net.Http and clearing NuGet Package Cache, and changing the target framework to 4.6.2 (originally 4.5), all of which did not work for me.
Any ideas on what I can try next?
I installed this package successful in my Visual Studio 2015 Update 3 project with NuGet Package Manager 3.4.4.
So please make sure your are using the latest version of Visual Studio 2015 and NuGet Package Manager.
I have resolved this issue, please see the answer I posted
I am having an issue when I try to install DiscordSharp (Github | NuGet) using the Package Manager Console.
When I use the install command as shown on the Discord Sharp NuGet page I get the following error (sorry about the formatting see my comment for a screenshot of the error):
PM> Install-Package DiscordSharp -Pre
Attempting to resolve dependency 'Newtonsoft.Json (≥ 6.0.0)'.
Install-Package : The element 'metadata' in namespace 'http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd' has invalid child element 'developmentDependency' in namespace
'http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd'. List of possible elements expected: 'copyright, tags, description, frameworkAssemblies,
references, dependencies, releaseNotes, language, summary' in namespace
'http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd'.
At line:1 char:1
+ Install-Package DiscordSharp -Pre
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo: NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
This is the error I get in a new project before installing any other packages, and I get the same error after installing json.net before DiscordSharp.
If it helps I am using Visual Studio 2012 on Windows 8.
If there is anything I have missed in the post which is needed, please let me know. Thanks for any help!
Problem solved: My version of NuGet was outdated as I was using Visual Studio 2012.
Updating to Visual Studio 2015 resolved this issue.