Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Clean" target does not delete all files in bin/obj folders #21971

Open
marcoburato-ecutek opened this issue Jan 14, 2025 · 1 comment
Open
Labels
msbuild Issues affecting our msbuild tasks/targets
Milestone

Comments

@marcoburato-ecutek
Copy link

Apple platform

iOS

Framework version

net8.0-*

Affected platform version

.NET 8.0.404, iOS workload 18.0.8319/8.0.100, JetBrains Rider 2024.3.3

Description

After upgrading to the latest .NET SDK, iOS workload and Xcode, our iOS app would build but crash on startup with an odd error:

System.DllNotFoundException: __Internal

I tried rebuilding the project but go the same behaviour.
I then switched to our Android app (within the same solution) just to test my code changes.

Today I switched back to the iOS project and it would no longer even build:

error : clang++ exited with code 1:
error : Undefined symbols for architecture x86_64:
error :   "_xamarin_is_object_valid", referenced from:
error :       <initial-undefines>
error :   "_xamarin_is_user_type", referenced from:
error :       <initial-undefines>
error : ld: symbol(s) not found for architecture x86_64
error : clang++: error: linker command failed with exit code 1 (use -v to see invocation)

At this point, I manually deleted the bin and obj folders, built the project again and it all worked correctly, like it used to.
It looks like the MSBuild Clean target does not delete all files within those output folders and some old files are not compatible with the new build tools.

Specifically, when I clean the project from my IDE, JetBrains Rider, there are about 137MB of files left under obj/Debug/net8.0-ios/iossimulator-x64.
Interestingly, cleaning the project from the command line with dotnet clean does work as intended, all files in obj/Debug/net8.0-ios get deleted.

Looking at the MSBuild outputs, it looks like CoreClean is not deleting any file when invoked from the IDE.
Since I experienced the same symptoms with Visual Studio for Mac, I suspect there's an issue with the MSBuild script and this not a bug in Rider. From what I can see, it's just invoking the Clean target as it should.

Steps to Reproduce

  1. Build the project from the IDE
  2. Clean the project from the IDE
  3. Check bin/obj folders, observe there are still many files left

Did you find any workaround?

Manually deleting the bin/obj folders fixes the build.

Build logs

No response

@rolfbjarne
Copy link
Member

Thanks for the report, we'll have a look and see what we can figure out.

@rolfbjarne rolfbjarne added the msbuild Issues affecting our msbuild tasks/targets label Jan 16, 2025
@rolfbjarne rolfbjarne added this to the Future milestone Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
msbuild Issues affecting our msbuild tasks/targets
Projects
None yet
Development

No branches or pull requests

2 participants