Compile issue: CS0108 - hides inherited member - Use the new keyword if hiding was intended

Ask general questions here.
dos
Posts: 3
Joined: Wed Jul 15, 2020 10:17 am

Compile issue: CS0108 - hides inherited member - Use the new keyword if hiding was intended

Post by dos » Wed Jul 15, 2020 10:29 am

Hello
I am writing on behalf of one of my colleagues who are getting the following issue when compiling Ranorex solution through Ranorex.

Severity Code Description Project File Line Suppression State
Error CS0266 Cannot implicitly convert type 'Ranorex.Core.Repository.RepoItemInfo' to 'ReactCompo-nentTest.ReactComponentTestRepositoryFolders.DetailsListFolder.SelfInfoClass'. An explicit conversion exists (are you missing a cast?) ReactCompo-nentTest C:\udv\tool-react-ranorex-test\src\RanorexStudio Pro-jects\StoryBookTest\ReactComponentTest\ReactComponentTest\ReactComponentTestRepository.cs 3570 Active

He attempted to change things in the code in order to fix this issue, however it seems that the code get re-generated to its original state and all changes gets removed.

We found someone else with the same issue. But they were informed by Ranorex staff that they could not change the code on their end as it would break other stuff. Sadly, the solution on their end was not written on the thread.

So, is there a possible quick fix on our end to continue with our work?
Attachments
ReactComponentTestRepository.cs
(240.83 KiB) Downloaded 7 times

User avatar
Vega
Certified Professional
Certified Professional
Posts: 222
Joined: Mon Jul 11, 2016 2:15 pm

Re: Compile issue: CS0108 - hides inherited member - Use the new keyword if hiding was intended

Post by Vega » Wed Jul 15, 2020 5:04 pm

Hi,

Would you be able to share your rxrep file so that I can import it into a new solution? In your case this should be C:\udv\tool-react-ranorex-test\src\RanorexStudio Pro-jects\StoryBookTest\ReactComponentTest\ReactComponentTest\ReactComponentTestRepository.rxrep

dos
Posts: 3
Joined: Wed Jul 15, 2020 10:17 am

Re: Compile issue: CS0108 - hides inherited member - Use the new keyword if hiding was intended

Post by dos » Thu Jul 16, 2020 7:44 am

Hello
Thank you for your respond, and of course. Anything to help.

I have attached the requested file.
Attachments
ReactComponentTestRepository.rxrep
(1.85 MiB) Downloaded 4 times

User avatar
Vega
Certified Professional
Certified Professional
Posts: 222
Joined: Mon Jul 11, 2016 2:15 pm

Re: Compile issue: CS0108 - hides inherited member - Use the new keyword if hiding was intended

Post by Vega » Thu Jul 16, 2020 1:11 pm

Thank you for the rxrep. I was not able to reproduce with just the repository; I imported it to a new 9.3 solution and the build was successful. Would it be possible to share your solution? Keep in mind this is a public form so if there is any sensitive data, I would recommend just opening a support ticket instead [https://www.ranorex.com/support-query/].

However if you don't mind sharing your solution, I would be happy to take a look. The easiest way to share your solution is to open it in Ranorex studio and then go to Tools -> Compress solution and open folder.

Hope this helps

dos
Posts: 3
Joined: Wed Jul 15, 2020 10:17 am

Re: Compile issue: CS0108 - hides inherited member - Use the new keyword if hiding was intended

Post by dos » Fri Jul 17, 2020 7:46 am

I have cleared it with my collegue and he said it was okay. The sln is attached.
Attachments
ReactComponentTest.zip
(2.33 MiB) Downloaded 3 times

User avatar
Vega
Certified Professional
Certified Professional
Posts: 222
Joined: Mon Jul 11, 2016 2:15 pm

Re: Compile issue: CS0108 - hides inherited member - Use the new keyword if hiding was intended

Post by Vega » Tue Jul 21, 2020 2:14 pm

Thank you for sharing; I was able to build the solution without errors, but I did receive the warning you have. From your original post you mentioned you are getting an error, but does your build complete?

I have seen this warning once before and it was caused by having a validation screenshot as a direct child of an app folder in the repository. Looking through the XML for your repository, there was a direct child validation image for the detailslist app folder which I removed (delete image tag) however this did not resolve the warning so there may be another spot within your repository where a validation image is a direct child of an app folder.

Overall this warning should not impact your test at all, and can easily be suppressed in Project -> Project Options -> Compiling tab -> Suppress warnings (just type CS0108)

hope this helps