How to use SqlClient in ASP.NET Core?
<p>I am trying to use SQLClient library in the ASP.net Core but cant seem to get it working.  I found this article online advising how to setup but its not working for me: <a href="http://blog.developers.ba/using-classic-ado-net-in-asp-net-vnext/" rel="noreferrer">http://blog.developers.ba/using-classic-ado-net-in-asp-net-vnext/</a></p>

<p>I have a simple console application package.  My project.json looks like this:</p>

<pre><code>{
  "version": "1.0.0-*",
  "description": "DBTest Console Application",
  "authors": [ "" ],
  "tags": [ "" ],
  "projectUrl": "",
  "licenseUrl": "",

  "compilationOptions": {
    "emitEntryPoint": true
  },

  "dependencies": {
    "System.Data.Common": "4.0.1-beta-23516",
    "System.Data.SqlClient" :  "4.0.0-beta-23516"
  },

  "commands": {
    "DBTest": "DBTest"
  },

  "frameworks": {
    "dnx451": { },
    "dnxcore50": {
      "dependencies": {
        "Microsoft.CSharp": "4.0.1-beta-23516",
        "System.Collections": "4.0.11-beta-23516",
        "System.Console": "4.0.0-beta-23516",
        "System.Linq": "4.0.1-beta-23516",
        "System.Threading": "4.0.11-beta-23516"
      }
    }
  }
}
</code></pre>

<p>And I try the following code:</p>

<pre><code>using System;
using System.Data.SqlClient;

namespace DBTest
{
    public class Program
    {
        public static void Main(string[] args)
        {
            using (SqlConnection con = new SqlConnection(ConnStr)) {
                con.Open();
                try {
                    using (SqlCommand command = new SqlCommand("SELECT * FROM SAMPLETABLE", con)) {
                        command.ExecuteNonQuery();
                    }
                }
                catch {
                    Console.WriteLine("Something went wrong");
                }
            }

            Console.Read();
        }
    }
}
</code></pre>

<p>But get the following errors:</p>

<p><a href="https://i.stack.imgur.com/3psE9.png" rel="noreferrer"><img src="https://i.stack.imgur.com/3psE9.png" alt="enter image description here"></a></p>

<p>Anyone else got this working?</p>