Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add reference to assembly in visual studio mac?

I am sorry. I am newbie in C#. I use Visual Studio Mac. I want to try to connect mysql database. I have added mysql package. When I run, I get error. The error is :

adding a reference to assembly ‘System.Data, Version-4.0.0.0, Culture=neutral, PublicKeyToken

enter image description here

like image 247
andika_kurniawan Avatar asked Jan 22 '17 10:01

andika_kurniawan


People also ask

How do I add a reference in Visual Studio for Mac?

To do this, right-click on the Package folder in the Solution Window, and select Add Packages. More information on using a NuGet Package is provided in the Including a NuGet package in your Project walkthrough.


3 Answers

My solution in Visual Studio for Mac 7.3 Preview was to right click on the "Dependencies" node for the project and click "Edit References..."

like image 156
Elijah Lofgren Avatar answered Oct 26 '22 23:10

Elijah Lofgren


  1. In Solution Explorer, right click (two finger tap on mousepad for Mac) the 'Dependancies' folder under the Project (current project where you are seeing this error).

  2. Click 'Edit References'

  3. Select (list defaults to All available) Select (tick) the Project you need to reference that is holding 'System.Data'.

  4. Click OK.

This will create a link between these two projects and therefore a reference/dependency is created.

like image 42
Iphiclus Avatar answered Oct 27 '22 00:10

Iphiclus


The solution is :

  1. Double click folder 'References' in your project
  2. If you have error like me, you type 'System.Data' and click checkbox then click button
like image 41
andika_kurniawan Avatar answered Oct 27 '22 00:10

andika_kurniawan