samedi 25 avril 2015

vnext (asp .net 5.0) and oracle


I created a vnext solution in visual studio ultimate 2015 CTP version 14.0.22609.0 D14REL and in the package manager I added the oracle managed driver.

Install-Package odp.net.managed

then in my config.json

"Data": {
        "DefaultConnection": {
            "ConnectionString": "Server=(localdb)\\mssqllocaldb;Database=aspnet5-vnext-237fb18c-c414-44a8-8771-e02d4719d1dc;Trusted_Connection=True;MultipleActiveResultSets=true"
        },
        "hr": {
            "ConnectionString": "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SID=mydatabase))); User Id=hr; Password=xxxxxxx;", "providerName":"oracle.manaagedatacess.client"
        }

    },

when I attempted to use it in a class

using System;
using Oracle.ManagedDataAccess.Client;
using System.Configuration;

namespace vnext.Models
{
    internal class dataHelper
    {
        OracleConnection cn = new OracleConnection(ConfigurationManager.ConnectionStrings["hr"].ConnectionString);
    }
}

lots of compile errors such as the type or namespace Oracle, Configuration, and OracleConnection could not be found are you missing an assembly reference? project vnext asp.net Core 5.0


Aucun commentaire:

Enregistrer un commentaire