Warnings on Cleaning a build if the bin folder does not exist

Bug reports.
Stev
Posts: 2
Joined: Wed Mar 31, 2021 3:19 am

Warnings on Cleaning a build if the bin folder does not exist

Post by Stev » Wed Mar 31, 2021 3:41 am

If the bin folder does not exist, then performing a Clean results in warnings.
We're in the process of upgrading from Ranorex 8.3 to 9.4.1 and this behavior did not occur before the upgrade.

Repro Steps
1. Create a new blank solution
2. Open the project folder in explorer
3. Delete the bin folder
4. Clean Solution or Project

Result

Code: Select all

Failed to clean generated shortcuts. Could not find a part of the path '.\Ranorex\RanorexStudio Projects\MyTest1\MyTest1\bin\Debug'.
Failed to clean report metadata files. Could not find a part of the path '.\Ranorex\RanorexStudio Projects\MyTest1\MyTest1\bin\Debug'.
Failed to clean integration metadata files. Could not find a part of the path '.\Ranorex\RanorexStudio Projects\MyTest1\MyTest1\bin\Debug'.
I think the fix would be as simple as updating Ranorex.MSBuild.Targets to use a condition for running the CleanGeneratedFiles target.

Code: Select all

    
<Target Name="CleanGeneratedFiles" AfterTargets="Clean" Condition="Exists($(OutDir))">
        <CleanGeneratedFiles OutputDirectory="$(OutDir)"
                                 Project="$(MSBuildProjectFullPath)"
                                 Platform="$(Platform)"
                                 IntermediateOutputPath="$(IntermediateOutputPath)"/>
</Target>

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Warnings on Cleaning a build if the bin folder does not exist

Post by odklizec » Tue Apr 13, 2021 11:16 am

Hi,

I can confirm this issue. However, it's quite unusual to delete the bin folder manually and then perform clean build? ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Stev
Posts: 2
Joined: Wed Mar 31, 2021 3:19 am

Re: Warnings on Cleaning a build if the bin folder does not exist

Post by Stev » Tue Apr 13, 2021 5:24 pm

Deleting the bin folder manually is just a fast/easy way to reproduce the issue. Our company manages Ranorex alongside several other projects, so for us there is another targets file involved that removes the bin folder for all projects (Ranorex or otherwise) on Clean and that those instructions are executed before those in the Ranorex targets file.

robinyao
Posts: 1
Joined: Wed Apr 06, 2022 7:27 am

Re: Warnings on Cleaning a build if the bin folder does not exist

Post by robinyao » Thu Apr 07, 2022 2:09 am

Hi,
Any updates for this issue?
we see a lot of warning messages when build solution after changed output folder.

BCTest
Posts: 127
Joined: Tue Jun 03, 2014 10:15 am
Location: Hamburg, Germany

Re: Warnings on Cleaning a build if the bin folder does not exist

Post by BCTest » Thu Sep 14, 2023 2:28 pm

Hi,

what about a different approach: In the Compiling tab of the project, it's possible to suppress warnings.
How do I phrase the entry to suppress the warnings 'warning : Failed to clean generated shortcuts' 'warning : Failed to clean report metadata files,' and 'warning : Failed to clean integration metadata files'?
Unfortunately, these warnings don't have numbers like 'warning C4005,' so the question is: How can we suppress these warnings?

Regards,
BcTest