i have installed the nuget package for asp.net webapi 2.2. and now when i am executing this command
PM> Install-Package Microsoft.AspNet.WebApi.Cors
from nuget package manager it is showing this error.
Install-Package : Unable to find package 'Microsoft.AspNet.WebApi.Cors'. At line:1 char:1 + Install-Package Microsoft.AspNet.WebApi.Cors + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
To check this, you can open your solution, expand the webapi solution, then open the packages. config file that holds the nuget config for what you have installed. You should see some web api version message in the below. You can now go to the nuget website and examine the package history (visit the following link).
To install CORS from the Nuget package, open the Package Manager Console and run the following command: Install-Package Microsoft. AspNet. WebApi.
Check the package source in the PackageManagerConsole Window. Change it to nuget.org from the dropdown, to install the package from the online repository.
I have faced same issue . I have followed below steps and it works for me.
Before Install-Package Microsoft.AspNet.WebApi.Cors. check the nuget.org link in package manager settings.
In Visual studio click Tools->NuGet Package Manager->Package Manager settings
verify by selecting a tree item
NuGet Package Manager -> Package Sources
"**https://www.nuget.org/api/v2**" is added or not. If not then add this by given any name and source as this url. then try again to install WebApi.Cors
Install-Package Microsoft.AspNet.WebApi.Cors
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