Windows Server 2022 You Can't Access This Shared Folder

The compiler defaults for a new VS project are different from those on the command line. Especially for a Debug configuration, additional compile-time and run-time checks are enabled. You encountered one of these, generated interface checking. From the command line this is /warn:interface . Another option enabled in a Debug configuration is array and string bounds checking (/check:bounds).