Skip to Main Content

Oracle Developer Tools for Visual Studio

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Getting Exception "System.Reflection.TargetInvocationException" when trying to access Oracle databas

0ab188b8-25a9-4c63-a232-dd1704ec3343Aug 20 2017 — edited Aug 20 2017

Hi,

I have created a Coded UI Test project with the following settings:
NuGet Packages Installed:
EntityFramework 6.0.0
Oracle.ManagedDataAccess.EntityFrameWork 12.1.2400
**Oracle.ManagedDataAccess 12.1.2400

Target Framework:****.Net Framework 4.5.2**

When trying to access the oracle database through Entity Eramework 6.0.0, I get the exception below:
**
Result Message:**
Test method ExcelDBImplementation.CodedUITest1.CodedUITestOracleEntityFramework threw exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'System.Data.Entity.SqlServer.SqlProviderServices' threw an exception. ---> System.TypeLoadException: Could not load type 'System.Data.Entity.Infrastructure.TableExistenceChecker' from assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

I downloaded Oracle Developer Tools with for VS 2015. This is how I accessed the database.
Connection string :

<add name="Entities" connectionString="metadata=res://*/Entity.TestData.csdl|res://*/Entity.TestData.ssdl|res://*/Entity.TestData.msl;provider=Oracle.ManagedDataAccess.Client;provider connection string="DATA SOURCE=orcl;PASSWORD=password;PERSIST SECURITY INFO=True;USER ID=username;" providerName="System.Data.EntityClient"/>

</connectionStrings>

1110841.png

However, when running a console application project or a unit test project with the same settings, it runs sucessfully. Is there any difference in the Coded UI Test project that causes this difference in behaviour?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 17 2017
Added on Aug 20 2017
0 comments
880 views