I run the following command in Package Manager in Visual Studio 2019 and a ASP.NET Core 5 project:
Scaffold-DbContext "Server=(local);Database=MyDB;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Entities -Context ApplicationDbContext
After a little time, this error appears:
The specified deps.json [C:\WorkingFolder\Projects\MyProject\MyProject.deps.json] does not exist
Notice that the deps.json file is being searched in project root, not under bin folder such as other posts I have found here, so by deleting bin and obj folder does not help.
How to solve it?
I am able to solve the same issue by setting the project contains the EF core files as a startup project.
Same problem: VS 2019 16.10.3 Professional
Add-Migration init
Build started...
Build succeeded.
The specified deps.json [C:\Users\USER\source\repos\FirstAspCore\FirstAspCore\FirstAspCore.deps.json] does not exist
Attempted Solution 1:
Copied the FirstAspCore.deps.json located at the bin/debug/netcore3.1 to the root
PM> Add-migration init
Build started...
Build succeeded.
It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '2.0.0' was not found.
The following frameworks were found:
3.1.16 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
5.0.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
5.0.7 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
You can resolve the problem by installing the specified framework and/or SDK.
The specified framework can be found at:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=2.0.0&arch=x64&rid=win81-x64
Attempted solution 2:
Even if u download all The frameworks 'Microsoft.NETCore.App', version '2.0.0'
then will prompt for older version and u download it ,at the end will not work
Attempted Solution 3:
Copied everything from the location bin/debug and pasted in the root folder ,it is an insufficient way, but figuring out which are needed going to take time, it worked for now.
PM> Add-Migration init
Build started...
Build succeeded.
Microsoft.EntityFrameworkCore.Infrastructure[10403]
Entity Framework Core 5.0.8 initialized 'Helper' using provider
'Microsoft.EntityFrameworkCore.SqlServer' with options: None
To undo this action, use Remove-Migration.
Related
Following issue occurs only on .NET Desktop Projects that also include Windows Application Packaging Project.
After my VS2019 was updated to version 16.10, all my .NET 5 projects that also include a Windows Application Packaging Project fail to build in VS2019. Both the Clean Solution and Rebuild Solution actions fail. In both cases we get the following error:
ResolvePackageDependencies task failed unexpectedly
When I tried dotnet clean I got the following error:
C:\Program Files\dotnet\sdk\5.0.300\Microsoft\DesktopBridge\Microsoft.DesktopBridge.props" was not found. Confirm that the expression in the Import declaration "C:\Program Files\dotnet\sdk\5.0.300\\Microsoft\DesktopBridge\\Microsoft.DesktopBridge.props" is correct, and that the file exists on disk.
And I verified on my Windows 10 Pro - latest version 20H2 that the folder C:\Program Files\dotnet\sdk\5.0.300\Microsoft\ does not have the DesktopBridge folder - and that seem to cause the issue. Both the Clean Solution and Rebuild Solution were working fine just before an upgrade of VS2019 to version 16.10
While installing the package Microsoft.EntityFrameworkCore.Tools for using EF in my project using Nuget, I'm persistently running into the below error. Notice I didn't get any error while installing other related packages used for EF core
Microsoft.EntityFrameworkCore
Microsoft.EntityFrameworkCore.Relational
Microsoft.EntityFrameworkCore.SqlServer
Here is the location of the file ef.exe
Basically the intention behind installing this package is to use EF command-line tools. I'm currently on Windows 10 and the .NET SDK installed on my machine is 3.1. I had previously 2 SDK's installed on my system(3.1 & 5.0). As per microsoft's documentaion, "The .NET CLI must choose an SDK version for every dotnet command. It uses the latest SDK installed on the machine by default." Therefore I went ahead and uninstalled .NET 5.0 SDK
Here are some of the solutions that I tried:
Deleting the package folder from '.nuget/packages/microsoft.entityframeworkcore.tools' & thereby the executable i.e. 'ef.exe' and reinstalling the same.
Installing the same package using dotnet cli.
Running Visual Studio 2019 as admin.
Deleted the folder "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions"
I have also tried some of the steps mentioned here on github: https://github.com/NuGet/Home/issues/1138
. Any kind of help would be really appreciated.
I have answered the detailed description of the solution here on microsoft's .NET Q&A platform.
'EntityFramework.Core.Tools' nuget package installation error
I'm trying to build an ASP.NET Core Web application .NET Core 3.1.
I run MS Visual Studio 2019, latest build.
I created the "Controllers" folder, an error occurs when trying to add Controller:
Error: there was an error running the selected code generator package restore failed
API Controller empty.
To resolve the issue, I tried the following to no avail:
Delete folders .vs, bin, obj
Clean and Rebuild project
Clear all NuGet caches
Restart, reboot
For what I can find it seems related to:
Error NU1202. Package Microsoft.AspNetCore.Razor 2.2.0 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package Microsoft.AspNetCore.Razor 2.2.0 does not support any target frameworks.
How can I solve the problem?
Resolved installing latest Visual Studio updates
I got a asp.net mvc project from my friend. This is her project but i need to work on it. So when i try to start it, there are some errors. Here is that errors;
Could not copy the file "_bin_deployableAssemblies\x86\sqlceme40.dll" because it was not found.
Could not copy the file "_bin_deployableAssemblies\x86\sqlcecompact40.dll" because it was not found.
Could not copy the file "_bin_deployableAssemblies\x86\sqlceer40EN.dll" because it was not found.
Could not copy the file "_bin_deployableAssemblies\x86\sqlceca40.dll" because it was not found.
Could not copy the file "_bin_deployableAssemblies\x86\sqlcese40.dll" because it was not found.
Could not copy the file "_bin_deployableAssemblies\x86\sqlceqp40.dll" because it was not found.
I did some search and found some solutions about updating my nuget packages. I did all updates including EntityFramework.SQLServerCompact. But i have still that errors and have no idea what to do. So can someone could help me?
Thanks in advance.
I ran into the same issue after updating VS to 153.
However since I am not Using SqlServerCompact edition anywhere in my project: I use Entity Framework to SQL Server proper I didn't feel the need to have those references and provider in the web.config.
In the Web Project - I used NUGET to remove all references to SQLServer Compact Edition. Then I Removed the reference to SqlCEProvider in the providers section of the web.config. Recompiled and everything works as expected.
You can try this command:
Update-package -Reinstall
from Console administrator packages (PM)
I solved this error using the following steps (order of some steps matters):
Installed SQL Server CE 4.0. I had to install the x64 version to match my OS, but it included the x86 redistributable files referenced in my project.
Using NuGet, removed EntityFramework.SqlServerCompact from my project
Using NuGet, removed Microsoft.SqlServer.Compact from my project
Using NuGet, installed EntityFramework.SqlServerCompact, which also installed Microsoft.SqlServer.Compact.
I had the same issue and i uninstalled SQLServer Compact Edition and installed again from nuget packages
I have installed Umbraco via nuget to empty project. I then ran the project so the installation started.
After installation ran there was lots of generated files so I have included them in project so that I can use source control.
I then ran project again and got the error:
Could not load file or assembly 'Newtonsoft.Json'
There is the dll file for this in bin folder and also a reference.
I think this might be because the "packages" folder created by nuget installation is not included in project. I do not know how to include this.
Does anyone know what I should do?
It turns out problem was in the Newtonsoft.Json file in nuget package. I downloaded latest dll from codeplex and it fixed the problem.