Visual Studio 2017无法选择新项目初始位置的技术咨询
Hey Lucas, sorry your desktop's Visual Studio is being stubborn about hiding the project location field when creating WinForms apps—especially since your laptop works perfectly. Let's walk through the most common fixes for this, since it's almost always a setting or installation glitch on the desktop side.
1. Flip the "Advanced Options" Toggle (Most Likely Fix!)
Visual Studio has a hidden toggle that shows/hides extra fields in the new project dialog. Here's how to check it:
- Open Visual Studio on your desktop, head to
Tools > Options - Drill down to
Projects and Solutions > Locations - Look for the checkbox labeled "Show advanced options in the New Project dialog"—make sure this is checked!
- While you're here, double-check that the default "Projects location" is set to your usual path (like
C:\Users\YourName\source\repos)
2. Reset Visual Studio's Settings
Corrupted user settings can mess with dialog layouts. Let's reset them to default:
- Close Visual Studio completely
- Open Command Prompt as Administrator
- Run this command:
devenv /ResetSettings - Restart Visual Studio and try creating a WinForms project again—this should restore the default dialog layout.
3. Repair Your Visual Studio Installation
If settings reset doesn't work, there might be a corrupted component:
- Open the Visual Studio Installer
- Find your installed VS version, click the three dots (
...) next to it, and select "Repair" - If there's an update available, install that first—outdated versions often have UI bugs that get fixed in patches.
4. Refresh the WinForms Project Template
Sometimes the template itself gets corrupted:
- In Visual Studio, go to
Tools > Get Tools and Features - Switch to the "Individual components" tab, search for ".NET Desktop Development"
- Uncheck it, click "Modify" to uninstall the component, then recheck it and install again. This refreshes all the WinForms templates.
5. Check Folder Permissions
Make sure your desktop user account has write access to the default projects folder (C:\Users\YourName\source\repos). If VS can't write to that path, it might hide the location field to avoid errors. Right-click the folder, go to Properties > Security and confirm your user has full control.
Since your laptop works flawlessly, the issue is definitely isolated to your desktop's VS setup—one of these steps should bring that location field back!
内容的提问来源于stack exchange,提问作者Lucas Winkler

