Using C# *.dlls

Ask general questions here.
ThN
Posts: 15
Joined: Fri Jun 15, 2012 2:12 pm

Using C# *.dlls

Post by ThN » Fri Nov 30, 2012 4:28 pm

Hello Everyone,

I currently use Ranorex 3.3 version and would like to use *.dlls from a Visual studio 2010 for intializing some functionalites during testing. But I am unable to run the project and the following error is shown.

ERROR: The type or namespace name 'XYZ' could not be found (are you missing a using directive or an assembly reference?) (CS0246) - D:\XYZ\TOP_VS2010\Common\Sample.cs:16,7

I believe this is something to do with Ranorex 3.3 version not supporting the *.dll built by VS2010. One solution is opening the C# project in Ranorex, where it ask to convert so that the c# project is supported. But is their any solution so that my C# project is not changed but still I can use this along with Ranorex.

Thanks
ThN

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Using C# *.dlls

Post by Ciege » Fri Nov 30, 2012 4:57 pm

Did you make a reference to the supporting DLL in your project?
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

ThN
Posts: 15
Joined: Fri Jun 15, 2012 2:12 pm

Re: Using C# *.dlls

Post by ThN » Thu Dec 20, 2012 2:16 pm

Hi Ciege,

When make a reference of *.dll then also it shows the same error. When I add a VS2010 project in to the Ranorex soultion It asks me to convert the VS project to Ranorex supporting project which then addes some Ranorex reference to the VS project. And now if I refer this project It will work. But I need to refer only *.dll and use the functinality of *.dll.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Using C# *.dlls

Post by Support Team » Thu Dec 20, 2012 2:47 pm

Do all of your projects/DLLs target the same .NET Framework version?
(In the project settings -> Compiling -> Target Framework)

A project targeting .NET 2.0 cannot reference a .NET 4.0 DLL (however, the other way round should work).

Regards,
Alex
Ranorex Team

ThN
Posts: 15
Joined: Fri Jun 15, 2012 2:12 pm

Re: Using C# *.dlls

Post by ThN » Wed Jan 02, 2013 1:26 pm

Hi,
Thanks for the support. Now refering *.dll works. As you suggested in the below mail, important thing is version of Target Framework.

Regards,
ThN