Microsoft.EntityFrameworkCore will not reference in VS Code - c#

I've downloaded the Microsoft.EntityFrameworkCore with the nuget manager extension, but whenever I try referencing it
using Microsoft.EntityFrameworkCore;
it won't accept the namespace.
The type or namespace name 'EntityFrameworkCore' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [Program]csharp(CS0234)
I've tried downloading the package in the CLI, and I've tried older version of the library, but nothing really changes.

Related

The type or namespace name 'DbContext' could not be found in NetStandard Class

Visual Studio 2017.
I create a separate Class Library (.Net Standard) Project.
Go to Manage NuGet Packages and look for Entity Framework, find it and install it (6.4).
Add a class to this project with the below code
public class StoreContext : DbContext
{
}
Error: The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?)
I add using System.Data.Entity;
I now get The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
I then decide to try and add System.Data but when i go into the references option, under assemblies i see
no framework assemblies were found on this machine
What am i missing?
You need to add reference to EntityFramework library in your project

Mac Visual Studio Xamarin - the type or namespace 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?)

On Mac Visual Studio - Xamarin Project, I get an error:
the type or namespace 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference)
I have tried to resolve it by using the nuget package manager. Specifically, click 'Packages' folder and click 'Add Packages...' and add Linq. Yet it still does not find Linq when I write 'using System.Linq' yet I can see 'System.linq' in the package folder under the project.
Tried : Refresh, Update, turn off and on
Why can't it find and use the package?
Edit: For similiar error 'HttpStatusCode' where it not found under 'System.Net' yet I have the dll (Version 2.0.5.0) found. I tried to install a new nuget package for it, System.Net.Primitives (Version 3.0.9.0) where 'HttpStatusCode' is stored under this new version. When I reference System.Net.Primitives it does not work.
Example:
'\\ The type or namespace name 'Primitives' does not exist in the namespace 'System.Net'
Using System.Net.Primitives;
Using System.Net;
namespace code {
public class Example
{
\\ the type or namespace 'HttpStatusCode' could not be found
public HttpStatusCode HttpResponse;
}
}`
You need just to add System.Core to your References.
In one of my project I solved it by following way:
Open solution explorer. Right click references, Click on assemblies, select system.xml.linq.
Add the reference assembly to the project. Clean and rebuild.
It should serve the purpose.
Add this .nuget to your Solution. Micosoft.Net.Http.

C# Added MySQL Reference Into C# Still Not Recognizing MYSQL

using MySql.Data.MySqlClient;
References
It is referenced, I have downloaded the connector, yet it refuses to work. I rebuilt and cleaned, doesn't work.
The type or namespace name 'MySql' could not be found (are you missing a using directive or an assembly reference?)

The type or namespace name 'Configuration' does not exist in the namespace 'WebApiContrib.Formatting.Html'

I'm getting this error with my Visual Studio 2012, Console App (it is a self-hosted webApi OWIN project)....
The type or namespace name 'Configuration' does not exist in the namespace
'WebApiContrib.Formatting.Html' (are you missing an assembly reference?)
The error is coming from this line ...
using WebApiContrib.Formatting.Html.Configuration;
I'm also getting a similar error for ...
using WebApiContrib.Formatting.Html.Formatters;
using WebApiContrib.Formatting.Html.Locators
In the project references I can see...
WebApiContrib.Formatting.Html
Any ideas how I can fix it please?
According to the documentation the HtmlMediaTypeViewFormatter type, and probably others, are found in WebApiContrib.Formatting.Html.Formatting. You don't need the Configuration namespace.
Check if you have installed all necessary packages and the latest version by using the NuGet package manager:
PM> Install-Package WebApiContrib.Formatting.Html

MEF CS0234: The type or namespace name 'Composition' does not exist in the namespace 'System.ComponentModel' (are you missing an assembly reference?)

I have added in ComponentModel.Composition; assembly .But showing this error for
using System.ComponentModel.Composition;
and reference for the assembely
still gets the error
CS0234: The type or namespace name 'Composition' does not exist in the namespace 'System.ComponentModel' (are you missing an assembly reference?)
First of all (if it's needed) Open your project in Visual Studio 2012 or later, choose Manage NuGet Packages from the Project menu, and search online for the Microsoft.Composition package.
Right-click on your Project and select "Add Reference". Find System.ComponentModel in the Framework list and add it or the applicable sub assembly.
Thats's all I did when I faced this problem.

Categories

Resources