Exception when attempting to load Oracle.DataAccess ref

Bug reports.
krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Exception when attempting to load Oracle.DataAccess ref

Post by krstcs » Wed Nov 28, 2012 6:07 pm

I recently re-installed the Oracle Client in order to be able to access our SUT database for manipulation/validation during testing. After this install Ranorex now throws the following exception when it tries to load the library if I try to include it.

I have loaded the project in VS2010 and SharpDevelop 4.2 and it works fine, so I know it isn't the assembly itself.

I tried copying the version of the Cecil dll that SD 4.2 uses into the Ranorex dir and it didn't change anything.

Oracle Client version is 11.0.2 (most current). Did a custom (full) install of the client software.

Code: Select all

Error loading code-completion information for Oracle.DataAccess from C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Oracle.DataAccess\4.112.3.0__89b483f429c47342\Oracle.DataAccess.dll:
Could not find assembly file.
Error loading code-completion information for Oracle.DataAccess from C:\Windows\assembly\GAC_32\Oracle.DataAccess\2.112.1.0__89b483f429c47342\Oracle.DataAccess.dll:
Error loading assembly:
System.ArgumentException: Destination array is not long enough to copy all the items in the collection. Check array index and length.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.BitConverter.ToInt32(Byte[] value, Int32 startIndex)
   at ICSharpCode.SharpDevelop.Dom.CecilReader.AddAttributes(IProjectContent pc, IEntity member, IList`1 list, ICustomAttributeProvider attributeProvider)
   at ICSharpCode.SharpDevelop.Dom.CecilReader.CecilClass.AddProperty(String defaultMemberName, PropertyDefinition property)
   at ICSharpCode.SharpDevelop.Dom.CecilReader.CecilClass.InitMembers(TypeDefinition type)
   at ICSharpCode.SharpDevelop.Dom.CecilReader.CecilClass..ctor(ICompilationUnit compilationUnit, IClass declaringType, TypeDefinition td, String fullName)
   at ICSharpCode.SharpDevelop.Dom.CecilReader.CecilProjectContent.AddTypes(Collection`1 types)
   at ICSharpCode.SharpDevelop.Dom.CecilReader.CecilProjectContent..ctor(String fullName, String fileName, DomAssemblyName[] referencedAssemblies, AssemblyDefinition assembly, ProjectContentRegistry registry)
   at ICSharpCode.SharpDevelop.Dom.CecilReader.LoadAssembly(String fileName, ProjectContentRegistry registry)
   at ICSharpCode.SharpDevelop.Dom.ProjectContentRegistry.LoadProjectContent(String itemInclude, String itemFileName)
   at ICSharpCode.SharpDevelop.Dom.ProjectContentRegistry.GetProjectContentForReference(String itemInclude, String itemFileName)
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Exception when attempting to load Oracle.DataAccess ref

Post by Support Team » Thu Nov 29, 2012 11:31 am

Hi,

This should be just a problem with loading the code completion information of that assembly, so you nevertheless should be able to work/use this library.
Which Ranorex version are you using?

Regards,
Markus
.
Image

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Exception when attempting to load Oracle.DataAccess ref

Post by krstcs » Thu Nov 29, 2012 2:25 pm

Sorry Markus, should have included that.

Ranorex 3.3.4
Windows 7 x64


The problem is that it won't compile in Ranorex either. It cannot find the references to the Oracle client library at all.

At this point I am using the MS Oracle Client, but that is deprecated as of 4.0, so I really need to use the Oracle version.

Thanks!
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Exception when attempting to load Oracle.DataAccess ref

Post by Support Team » Thu Nov 29, 2012 2:55 pm

Hi,

No problem!
Thanks for the information!

Another way to add the reference is to add it via the .NET Assembly Browser. You have to browse to the following (maybe the path in your system is a little bit different): ‘C:\Windows\Microsoft.NET\assembly\GAC_32\Oracle.DataAccess\v4.0_4.112.3.0__89b483f429c47342\’.
There should be the same reference (Oracle.DataAccess.dll) as in the GAC.
Does it work this way?

Regards,
Markus
.
Image

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Exception when attempting to load Oracle.DataAccess ref

Post by krstcs » Thu Nov 29, 2012 10:30 pm

I don't have the assembly in "Windows\Microsoft.NET\assembly\GAC_32", but I do have it in "Windows\assembly\GAC_32". However, it still gives the same error and the library cannot be used.

I am going to use Oracle's stand-alone install cleaner to get all Oracle instances off my system and then re-install the client. I will let you know if that changes anything.

The problem I see is that Ranorex is the only IDE that is having this issue. Even SharpDevelop reads it just fine.

Anyway, thanks for the help.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Exception when attempting to load Oracle.DataAccess ref

Post by Support Team » Fri Nov 30, 2012 9:50 am

Hi,

Please inform us about your progress.
Another question, is Oracle ODAC installed on your machine?

Regards,
Markus
.
Image

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Exception when attempting to load Oracle.DataAccess ref

Post by krstcs » Fri Nov 30, 2012 4:45 pm

OK, I completely uninstalled all Oracle clients and DBs on my system.

I then re-installed the Client only, with ODP.NET and ODAC.

This did not solve the issue, so I uninstalled and re-installed Ranorex. Now I get the following exception when attempting to add the Oracle.DataAccess reference, or when attempting to build the solution with the reference included.

Code: Select all

Error loading code-completion information for Oracle.DataAccess from C:\app\product\11.2.0\client_1\ODP.NET\bin\2.x\Oracle.DataAccess.dll:
Error loading assembly:
System.ArgumentException: Destination array is not long enough to copy all the items in the collection. Check array index and length.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.BitConverter.ToInt32(Byte[] value, Int32 startIndex)
   at ICSharpCode.SharpDevelop.Dom.CecilReader.AddAttributes(IProjectContent pc, IEntity member, IList`1 list, ICustomAttributeProvider attributeProvider)
   at ICSharpCode.SharpDevelop.Dom.CecilReader.CecilClass.AddProperty(String defaultMemberName, PropertyDefinition property)
   at ICSharpCode.SharpDevelop.Dom.CecilReader.CecilClass.InitMembers(TypeDefinition type)
   at ICSharpCode.SharpDevelop.Dom.CecilReader.CecilClass..ctor(ICompilationUnit compilationUnit, IClass declaringType, TypeDefinition td, String fullName)
   at ICSharpCode.SharpDevelop.Dom.CecilReader.CecilProjectContent.AddTypes(Collection`1 types)
   at ICSharpCode.SharpDevelop.Dom.CecilReader.CecilProjectContent..ctor(String fullName, String fileName, DomAssemblyName[] referencedAssemblies, AssemblyDefinition assembly, ProjectContentRegistry registry)
   at ICSharpCode.SharpDevelop.Dom.CecilReader.LoadAssembly(String fileName, ProjectContentRegistry registry)
   at ICSharpCode.SharpDevelop.Dom.ProjectContentRegistry.LoadProjectContent(String itemInclude, String itemFileName)
   at ICSharpCode.SharpDevelop.Dom.ProjectContentRegistry.GetProjectContentForReference(String itemInclude, String itemFileName)
Edit to add:
SD 4.2 and VS2010 both still work as expected after these actions, so this isn't a problem with the assembly. This is an issue with Ranorex only.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Exception when attempting to load Oracle.DataAccess ref

Post by Support Team » Mon Dec 03, 2012 11:35 am

Hi,

Yes your are right this is an issue with Ranorex Studio.
In order to fix/analyze this issue in detail we would need the specific DLL, could you send it to our support email address: [email protected]?
This would be great!

Thanks,
Markus
.
Image

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Exception when attempting to load Oracle.DataAccess ref

Post by krstcs » Mon Dec 03, 2012 7:52 pm

Sent.

Thanks!
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Exception when attempting to load Oracle.DataAccess ref

Post by Support Team » Tue Dec 04, 2012 9:41 am

Hi,

Thanks for the file!
We analyzed the issue and we found out that this is unfortunately a bug on our site.
This will be fixed with the next Ranorex version, which should be released very soon.

Regards,
Markus
.
Image