"The type ... conflicts with the imported type" warning mess

Ask general questions here.
User avatar
Stub
Posts: 173
Joined: Fri Jul 15, 2016 1:35 pm

"The type ... conflicts with the imported type" warning mess

Post by Stub » Mon Sep 05, 2016 3:37 pm

I'm still learning my way around Ranorex. I've upgraded to Ranorex v6.1.0 on Windows10 and have just started fiddling with image comparisons to find out how they work. In the process I created a new user code module which references elements in my repository and started seeing the following warning message.

Essentially I've put my repository in a shared module A which contains common code, then linked the repository to test module B which contains the actual test code/recordings. My new user code module lives in test module B and reports this warning.

"The type 'A.MyRepository' in 'B.MyRepository.cs' conflicts with the imported type 'A.MyRepository' in 'A.dll'. Using the type defined in 'B.Repository.cs'. (CS0436) - UserCodeModule.cs:47,104"

After searching on the forums I found this locked post which appears to exactly match my scenario. I like to understand/fix/clean-up my warnings so was wondering what I was missing.

User avatar
Stub
Posts: 173
Joined: Fri Jul 15, 2016 1:35 pm

Re: "The type ... conflicts with the imported type" warning mess

Post by Stub » Tue Sep 06, 2016 11:20 am

Ah, I found I can just disable the warning in the source files where it pops up:

Code: Select all

#pragma warning disable 0436

namespace BlahDeBlah
{
}

#pragma warning restore 0436
That'll sort me out.

And if it's cropping up all over the place I could potentially add it to the project properties under "Build/Suppress warnings:" which takes a comma-separated list of warnings that are to be suppressed. I'll stick with the local setting for the time being.