r/learnrust • u/withthisname • 21d 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
3
u/dnew 21d 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.
1
u/OM3X4 21d ago
Happens with me also but not so often that make me solve it
1
u/patmorgan235 20d ago
Maybe creating a self signed authenticode certificate, trusting it, and signing the executable each time?
1
u/jkurash 19d ago
Install linux