Hey I want to resize images stored in a folder using .net core 3.1. The library I am trying to use is SixLabor.ImageSharp. I tried to install its latest version using nuget package manager and it was successfully installed and later on I added namespace SixLabor.Imagesharp in my .Cs file. but I am getting an error Namespace sixlabor.imagesharp not found. how can i use image sharp in my project. I read its documentation it was mentioned that Image sharp is available in Nuget package manager but its not working for me.
Please install the Nuget Package "SixLabor.ImageSharp" in the desired project. Once done, in your Startup.cs configure it as mentioned on their getting started page https://docs.sixlabors.com/articles/imagesharp.web/gettingstarted.html
I made an ADO.NET Entity Data Model in my MVC project. When I did this the EntityFramework package was automatically downloaded and installed into my project via the NuGet package manager.
How do I completely remove this ADO.NET Entity Data Model and its related EntityFramework from my project?
(I am working in Visual Studio Community)
You can use the following command line in the Package Manager Console:
Get-Project -All | Uninstall-Package <package name>
If this package have dependencies, you can add option -RemoveDependencies in above command line.
Or you can manually do it through the VS GUI,
Right-click your solution > Manage NuGet Packages for Solution..., switch to the Install tab, select the package which you want to uninstall, then you can check the first checkbox, all the check boxes would be selected, click the uninstall button:
I am posting this question just in case the solution I found would help someone else out. While working in Visual Studio 2017 rc4 each time I tried to run the Add-Migration command in the Package Manager console I get the following error:
The term 'Add-migration' is not recognized...
The solution that worked for me after trying a whole raft of other solutions posted, was to:
right click on my project
select Manage Nuget Packages
select the browse tab
thick Include prerelease check box
install the Microsoft.EntityFrameworkCore.Tools
N.b that aspnetcore project in visual studio 2017 do not seem to have the project.json file.
You just need to initialize the powershell module. I believe this is a bug, but it's pretty easy to work around. All you need to do is find the init.ps1 file and dot source it.
Just type this into the package manager console:
C:\Users\YourUserAccount\.nuget\packages\Microsoft.EntityFrameworkCore.Tools\1.1.0-preview4-final\tools\init.ps1
Now the version might be different for you, depending on which one you have installed. Make sure you dot source the same version that is in your project.
Hi There
This is almost an normal problem in Microsoft, and they pointing out the same solution:
Microsoft Docs - Getting Started with EF Core on ASP.NET Core with a New database
For me above dosn't solve my problem, but this line first does:
PM> Install-Package Microsoft.EntityFrameworkCore.Tools
PM> add-migration InitialCreate
/Cheers, Jan
Make sure that the Microsoft.EntityFrameworkCore.Tools package is installed. If it's not, then add it from NuGet or simply type the following in the Package Manager Console:
Install-Package Microsoft.EntityFrameworkCore.Tools
Installing the above package worked for me.
If your are using VS 2019 and Dot.net core version 3.1
Just install the : Microsoft.EntityFrameworkCore.Tools from Manage NuGet Packages
this solved my problem.
I have had the same problem with a project created with VS2017 version 15.9.4 and .Net Core 2.1.
I have fixed it by adding Microsoft.EntityFrameworkCore.Tools to dependences of my project.
On project select Manage Nuget Packages
Browse and Search Microsoft.EntityFrameworkCore.Tools
Install it on your project
Then you can open Package Manager Console and use commands :
Add-Migration
Drop-Database
Get-DbContext
Scaffold-DbContext
Script-Migrations
Update-Database
Regards
dcube
Download the latest .net Core 2.0 from the link below and it will fix your issue:
https://www.microsoft.com/net/core#windowscmd
I reinstalled package Microsoft.EntityFrameworkCore.Tools and issue got fixed for me.
It works for me.
Close all VIsual Studio instances.
Open VS.
Open Package Manager console, let it be initialized.
Now open the project and try Add-Migration.
For me, I had to copy the folder microsoft.entityframeworkcore.tools from
C:\Program Files\dotnet\sdk\NuGetFallbackFolder
To
C:\Users\<user>\.nuget\packages
You have to add this to your CSPROJ file. This will most likely be fixed when the Core 2.0 is released. This stems from an issue where you can not install this package Microsoft.EntityFrameworkCore.Tools.DotNet using the NUGET tools due to version requirements.
Then using CMD/PowerTools in the project directory you can issue the following commands:
dotnet ef migrations add InitialCreate
dotnet ef database update
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.1" />
</ItemGroup>
I had the issue with VS2019 Enterprise on a .NET MVC 5 project with EF6.3.0. I was pulling my hair out and crushed for time. I was trying everything. In desperation, here's what I did that finally worked, FWIW.
Open VS2019
Let it completely finish all background processes on load (lower
left-hand corner animated icon)
Close Package Manager Console
Right-click Project, select "Manage NuGet Packages"
Check "Include Pre-Release"
Choose "Browse" Tab Update EntityFramework to V6.4.0-preview2-19525-03
Close VS2019 Open VS2019 Select from Menu:
Tools > Nuget Package Manager > Package Manager Console which opens
the PM console
At THIS point, FINALLY, add-migration "MyReferencePoint" worked!
Hope this helps someone.
we get the same error when "add-migration", i try one solution which is update Package Manager by using follow step
In Visual Studio, from the "Tools" menu choose the "Extensions and Updates" option.
From the dialog that appears, expand the "Updates" node from the tree at the left side.
Select the "Visual Studio Gallery" option from the tree.
Finally, look for the Package Manager update in the list of updates at the right side of the dialog and click the "Update" button beside it.
it is approx 5 - 10 MB update, after update complete try Get-Help Add-Migration
ASP.NET 4.5.1 or 4.5.2
Updating Nuget package MicrosoftAspNet.Identity.EntityFramework from version 2.2.1 to version 3.0.0-rc1-final
I get the following error:
Failed to add reference. The package 'Microsoft.AspNet.Identity.EntityFramework' tried to add a framework reference to 'System.Runtime' which was not found in the GAC. This is possibly a bug in the package. Please contact the package
owners for assistance.
I had a similar issue with another package.
I "solved" it adding a manually reference to missed library, updating the package and then removing the reference added manually:
On your project go to References -> Add Reference... and then click on Browse...
On my installation (Windows 10), your file is located on: C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll
Add, update and then remove.
I know, it is not a solution, but it will allow you continue working until get a real solution.
I had the same issue, but adding the MySQL package to my project.
The way that i solved was just very closely to the answer given by Sebastián Guerrero.
So i will be adding a manually reference to that missed library (system.runtime) and than installed the MySQL package and it works perfectly.
ATTENTION: I only unnistall the system.runtime package after installing the MySQL.
References -> Add Reference... and then click on Browse...
On my installation (Windows 10), your file is located on:
C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll
I had the same issue when running Install-Package Microsoft.Azure.Management.Fluent on .NET framework 4.5.2
Solved the issue with the following steps:
Installed Microsoft.Rest.ClientRuntime latest version from Nuget.
After that, installed latest version of Microsoft.Azure.Management.Fluent from Nuget.
I had this problem when I opened the project after a while.
The problem was it was originally built with Microsoft.Net.Compilers.2.4.0 and I was on 3.3.1.
The project strangely added two required Imports to the .csproj file, one for the 2.4.0 compiler,and a duplicate for the 3.3.1 version. I just needed to:
Right click on the project file
Unload the project
Edit the csproj file
Remove the 2.4.0 references (was also a reference in an Error element)
Close file
Right click on project, reload file.
Rebuild All
I have a webforms project.
I use nuget to install web API by running Install-Package WebApi.All
I create a class
public class CartController : System.Web.Http.ApiController
but it cannot resolve symbol Http in System.Web.Http, what dependency am I missing?
The name of the package for the ASP.NET Web API isn't "WebApi.All". The package for the ASP.NET Web API (Beta) is "AspNetWebApi". Try running the following instead:
Install-Package AspNetWebApi
Try using it with exact keyword from the package manager console. This is include the dependencies WebApi.Enhancements, WebApi.OData.
Install-Package WebApi.All -Version 0.6.0
For more information checkout NuGet WebApi.All 0.6.0
Another way is to use "NuGet Package Manager".
You can simply use "NuGet Package Manager" by right clicking on Project from Solution explorer, and search "Web API" term. Install it from there.