This worked for me:
on Windows 11 go to settings:
Click on Privacy & Security and after, click on for developers option.
On for developers settings, activate the Developer mode option (Install apps from any source…).

Now try to run/build your flutter application with flutter run -d windows or flutter build windows command.