I'm trying to use Entityframework core and sqlite in my project but I keep getting this error message "the type dbconnection is defined in an assembly that is not referenced".
What should I do?
Related
I referred to this one
https://learn.microsoft.com/en-us/visualstudio/cross-platform/unity-scripting-upgrade?view=vs-2017#taking-advantage-of-net-compatibility
i attempted to get nuget npgsql and microsoft office
but this error is occured.
Assembly 'Assets/Plugin/Microsoft.Office.Interop.Excel.dll' will not be loaded due to errors:
Unable to resolve reference 'office'. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.
Unable to resolve reference 'Microsoft.Vbe.Interop'. Is the assembly missing or incompatible with the current platform?
it was same to happen exactly like npgsql
how to get nuget in unity
You might want to check out this asset: https://github.com/GlitchEnzo/NuGetForUnity
I created a .NET Full Framework class library using EF Core v 2.2.1 and downloaded the EF Core driver v 2.x for Linqpad 5 (5.36.03), and when I try to create a new connection to the class library DLL, I get the following error message:
Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependenceis. The system cannot find the file specified.
I have clicked the 'Restore nuGet Dependencies' and it gives me the message 'No NuGet dependencies detected'.
Any thoughts?
Did exactly what #magicandre1981 suggested and targted 4.7.2 for my class library. That fixed it!
Using Package Manage Console in Visual Studio, when I run "Add-Migration MyMigrationName" on Company.Project1 (.NET Core 1.1) I get an error
Could not find assembly 'C:\path\to\my\solution\Company.Project2\.\bin\Debug\netcoreapp1.1\Company.Project1.dll'.
The project you are running migrations on must be the startup project.
I am writing a simple console application to test some EF Core code.
I added the entityframework.commands package.
install-package entityframework.commands -pre
The connection string is correct and tested, but when I execute
Update-Database
from the package manager I get the following error.
No DbContext was found. Ensure that you're using the correct assembly and that the type is neither abstract nor generic.
Of course, I have a context, just one in the project.
entityframework.commands is ancient. Use Microsoft.EntityFrameworkCore.Tools instead.
I build my application and run it in debug mode. Everything is ok. I can test the functionality and everything is working. Its a multi tier MVC application using Entity Framework 6.0.
Now, when I change the build from Debug to Release and build the projects. I get a few hundreds build errors. All the errors are in the Data Access layer where I use the Entity Framework 6.0. The errors are in the form of:
Error 388 The type or namespace name 'DbSet' could not be found (are you missing a using directive or an assembly reference?)
Or
Error 201 The type or namespace name 'Schema' does not exist in the namespace 'System.ComponentModel.DataAnnotations' (are you missing an assembly reference?)
I have tried cleaning the solution and rebuilding but always same. Not sure why this can happen? Any suggestion will be appreciated.
many thanks