r/learnrust • u/withthisname • 23d ago
Windows 11 Smart App Control keeps blocking Cargo build scripts. How do you deal with this?
Hi everyone!
I'm developing a Rust application on Windows 11, and I keep running into an issue with Windows Smart App Control whenever I use cargo build.
Windows shows this warning:
"Part of this app has been blocked. Some features of cargo.exe may not work because we can't confirm who published build-script-build.exe."
Sometimes I can successfully build my application, but after changing my code and rebuilding, Windows blocks it again.
I've tried running cargo clean and rebuilding. Sometimes that works temporarily, but the problem keeps coming back.
Has anyone experienced this issue? Is there a way to make Windows trust locally compiled Rust executables without disabling Smart App Control entirely?
Thank you
1
u/patmorgan235 22d ago
Maybe creating a self signed authenticode certificate, trusting it, and signing the executable each time?
3
u/dnew 22d ago
I would think the easiest approach is to turn that off. You're creating new executables every few minutes, and you're leaving turned on the "don't run code not signed by microsoft" setting.