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: 6557
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.