cannot add dll to project

Ask general questions here.
Posts: 10
Joined: Tue Dec 06, 2011 9:11 am

cannot add dll to project

Post by agiletestware » Wed Sep 19, 2012 11:45 am

I am trying to add my own dll to one of the sample ranorex sample project. however, upon compile I get 1 warning and 1 error

Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not load file or assembly 'C:\downloads\foo.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. (MSB3246)

The type or namespace name 'foo' could not be found (are you missing a using directive or an assembly reference?) (CS0246) - C:\Users\windows7\Documents\Ranorex\RanorexStudio Projects\Samples\KeePassTestSuite\KeePassTestSuite\CodeModules\foo.cs:20,7

I can see the dll in the references folder. I tried chaning the project target framework to different versions (2, 3, 3.5, 4) but to luck.

What am I doing wrong? This dll works fine when being called from some IDE like sharp develop.


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

Re: cannot add dll to project

Post by Support Team » Thu Sep 20, 2012 3:10 pm


Are you sure that you used the same runtime for the two projects?
Did you create the dll on another machine where a newer .Net version is installed?
Do you have installed the full/extended version of the .Net 4.0 framework?
Which .Net version is used in your Ranorex project?

Ranorex Support Team