This discussion is archived
1 Reply Latest reply: Oct 9, 2013 8:07 PM by Christian.Shay - Oracle RSS

"Object reference not set to an instance of an object." in Visual Studio 2012 Entity Framework Model-First

a0d66a3a-b83f-4958-aeea-b8656779ebf5 Newbie
Currently Being Moderated

Hello

 

We're trying to use a Model-First with Entity Framework in Visual Studio, targeting an Oracle XE 11g installation.

 

No matter from what angle we're approaching the issue, we always end up with an "Object reference not set to an instance of an object" in Visual Studio:

 

First way:

- Add new ADO.NET Entity Framework Model to a .NET Framework 4.5 project

- Empty model

- Add some entities and associations

- Set Database Generation Workflow to "Generate Oracle Via T4 (TPT).xaml"

- Set DDL Generation Template to "SSDLToOracle.tt"

- Generate Database From Model

- VS asks for DB connection ==> Click "New Connection"

- Enter the connection properties to the Oracle XE database. "Test Connection" tells me the connection is okay.

- Click OK. Visual Studio shows the following error message:

 

https://dl.dropboxusercontent.com/u/35614983/vs2012_oracle_ef_error.png

(here's the image if it's not visible: https://dl.dropboxusercontent.com/u/35614983/vs2012_oracle_ef_error.png)

 

We also tried to generate the model in VS2010 and then manually transform it to an EF5 / VS2012 model. At the "Generate Database from Model" step, the same error appeared.

We also tried to generate the model from database (Database-First approach). Same error.

 

My configuration:

- Windows 7 Ultimate 64-bit

- Installed Oracle client: ODTwithODAC1120320_32bit.zip, so the version is 11.2.0.3.20

- Visual Studio 2012 Update 3 (11.0.60610.01)

 

Thanks for any hints!

 

EDIT: I just read that ODP.NET doesn't seem to support Entity Framework 5, so I tried a new project with Entity Framework 4.1, but I get the same errors.

EDIT 2: On a 32-bit Windows 7 virtual machine, everything works fine. Seems the problem is only there on my 64-bit Windows 7 machine.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points