Page 1 of 1

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

Posted: Wed Mar 31, 2021 3:41 am
by Stev
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>

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

Posted: Tue Apr 13, 2021 11:16 am
by odklizec
Hi,

I can confirm this issue. However, it's quite unusual to delete the bin folder manually and then perform clean build? ;)

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

Posted: Tue Apr 13, 2021 5:24 pm
by Stev
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.

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

Posted: Thu Apr 07, 2022 2:09 am
by robinyao
Hi,
Any updates for this issue?
we see a lot of warning messages when build solution after changed output folder.

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

Posted: Thu Sep 14, 2023 2:28 pm
by BCTest
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