简体   繁体   中英

Undo “Folder '<folderName>' do not introduce namespace” from Resharper

I created a class within a sub-folder of my project, and the namespace didn't match the folder structure. Resharper underlined the namespace and, while looking at the options Resharper presented to fix the problem, accidentally selected the option for "Folder does not generate a namespace". Where is that setting stored? I want to undo that choice so that Resharper enforces namespace / directory parity, at least for that folder.

I've checked in the .sln and then .csproj file, along with the directory in question for any loose files that might contain the information, and can't find how Resharper is storing that in order to remove it.

在此输入图像描述

Thanks to DavidG for the technical answer, but I just stumbled on what could be considered the "correct" way to change the setting, at least it is friendlier than manually editing a raw XAML file.

If you select the folder in the Solution Explorer and check the properties window, there is a property called "Namespace Provider" under a "ReSharper" catagory. Setting it to true will restore the default behavior of ReSharper expecting the namspace to match the directory structure.

属性窗口

You should have a file next to your project file called projectname.csproj.Dotsettings . You will find the settings in there. If that's the only project specific setting, just delete the file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM