I have visual studio 2019 and i created a new asp.net core 2.2 project. now i am following these steps Configure Microsoft Account Authentication to enable external login to our web application. but when i run this command:-
dotnet add package Microsoft.AspNetCore.Authentication.MicrosoftAccount
i got this error:-
PM> dotnet add package Microsoft.AspNetCore.Authentication.MicrosoftAccount dotnet : Could not find any project in
C:\Users\*****\source\repos\MSlogintest\
. At line:1 char:1 + dotnet add package Microsoft.AspNetCore.Authentication.MicrosoftAccount + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (Could not find ...\MSlogintest`.:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError Usage: dotnet add package [options]Arguments: The project file to operate on. If a file is not specified, the command will search the current directory for one. The package reference to add.
Options: -h, --help Show command line help. -v, --version The version of the package to add. -f, --framework Add the reference only when targeting a specific framework. -n, --no-restore
Add the reference without performing restore preview and compatibility check. -s, --source The NuGet package source to use during the restore. --package-directory The directory to restore packages to. --interactive
Allows the command to stop and wait for user input or action (for example to complete authentication).
as follow:-
and when i access the folder, i found that there is a VS project folders, as follow:-
so why the error is saying that it can not find any project? can anyone advice on this error please? Thanks
I encountered the same issue and found the fix. First of all, read the error message completely and carefully. It says:
"Could not find any project ...."
Which means it was expecting the project information. If you further watch the message closely, it has mentioned the correct usage of this command i.e.
Usage: dotnet add <PROJECT> package [options] <PACKAGE_NAME>
In the argument, enter your project name and run it again. This time, you should see the success message similar to:
info : Adding PackageReference for package 'Microsoft.xxxxxxxx.xxxxxxxx' into project 'C:\Users\xxx\source\repos\ProjectFolder\xxxxxxxx.csproj'.
Got this working on powershell (no IDE). The solution was somewhere hidden in the comments but here is the easy one:
dotnet add <project> package <packageName>
In this case I believe it would be:
dotnet add ContosoUniversity package Microsoft.AspNetCore.Authentication.MicrosoftAccount
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With