在 Visual Studio 2017 中指定 /doc 开关的位置

Where to specify the /doc switch in Visual Studio 2017

要生成 XML 文档文件,我需要将 /doc-doc 开关添加到构建选项。我不知道在哪里添加这个。我正在使用(今天早上更新)Visual Studio 17 社区版。正如您在下面粘贴的文件中看到的那样,该解决方案稍早于 2015 年。下面是 vs2017 中的 windows 的屏幕截图,这将是隐藏此设置的合适位置。

项目属性

解决方案属性

解决方案文件

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26430.16
MinimumVisualStudioVersion = 10.0.40219.1
          XXXXXXXX-YYYY-XXXX-YYYY-XXXXXXXXXXXX
Project("{XXXXXXXX-YYYY-XXXX-YYYY-XXXXXXXXXXXX}") = "Anchor", "http://localhost:9637", "{XXXXXXXX-YYYY-XXXX-YYYY-XXXXXXXXXXXX}"
    ProjectSection(WebsiteProperties) = preProject
        UseIISExpress = "true"
        TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.6.1"
        Debug.AspNetCompiler.VirtualPath = "/localhost_9637"
        Debug.AspNetCompiler.PhysicalPath = "..\..\WebSites\Anchor\"
        Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_9637\"
        Debug.AspNetCompiler.Updateable = "true"
        Debug.AspNetCompiler.ForceOverwrite = "true"
        Debug.AspNetCompiler.FixedNames = "false"
        Debug.AspNetCompiler.Debug = "True"
        Release.AspNetCompiler.VirtualPath = "/localhost_9637"
        Release.AspNetCompiler.PhysicalPath = "..\..\WebSites\Anchor\"
        Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_9637\"
        Release.AspNetCompiler.Updateable = "true"
        Release.AspNetCompiler.ForceOverwrite = "true"
        Release.AspNetCompiler.FixedNames = "false"
        Release.AspNetCompiler.Debug = "False"
        SlnRelativePath = "..\..\WebSites\Anchor\"
        DefaultWebSiteLanguage = "Visual C#"
    EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C24735CF-C0CF-4FF2-AABE-0A1EDD678318}"
EndProject
Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "AnchorDb", "AnchorDb\AnchorDb.sqlproj", "{722FE50A-126F-41E6-AC1C-126303A5C131}"
EndProject
Global
    GlobalSection(SolutionConfigurationPlatforms) = preSolution
        Debug|Any CPU = Debug|Any CPU
        Release|Any CPU = Release|Any CPU
    EndGlobalSection
    GlobalSection(ProjectConfigurationPlatforms) = postSolution
        {XXXXXXXX-YYYY-XXXX-YYYY-XXXXXXXXXXXX}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {XXXXXXXX-YYYY-XXXX-YYYY-XXXXXXXXXXXX}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {XXXXXXXX-YYYY-XXXX-YYYY-XXXXXXXXXXXX}.Release|Any CPU.ActiveCfg = Debug|Any CPU
        {XXXXXXXX-YYYY-XXXX-YYYY-XXXXXXXXXXXX}.Release|Any CPU.Build.0 = Debug|Any CPU
        {XXXXXXXX-YYYY-XXXX-YYYY-XXXXXXXXXXXX}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {XXXXXXXX-YYYY-XXXX-YYYY-XXXXXXXXXXXX}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {XXXXXXXX-YYYY-XXXX-YYYY-XXXXXXXXXXXX}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
        {XXXXXXXX-YYYY-XXXX-YYYY-XXXXXXXXXXXX}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {XXXXXXXX-YYYY-XXXX-YYYY-XXXXXXXXXXXX}.Release|Any CPU.Build.0 = Release|Any CPU
        {XXXXXXXX-YYYY-XXXX-YYYY-XXXXXXXXXXXX}.Release|Any CPU.Deploy.0 = Release|Any CPU
    EndGlobalSection
    GlobalSection(SolutionProperties) = preSolution
        HideSolutionNode = FALSE
    EndGlobalSection
    GlobalSection(ExtensibilityGlobals) = postSolution
        VisualSVNWorkingCopyRoot = ..\..\WebSites\Anchor
    EndGlobalSection
EndGlobal

Where to specify the /doc switch in Visual Studio 2017

根据官方文档Documenting your code with XML comments and /doc (Process Documentation Comments) (C/C++)

If you are developing an application using Visual Studio, right-click on the project and select Properties. In the properties dialog, select the Build tab, and check XML documentation file. You can also change the location to which the compiler writes the file.

If you are compiling a .NET Framework application from the command line, add the /doc compiler option when compiling.

对于 C++ 项目:

Open the project's Property Pages dialog box.

Expand the Configuration Properties node.

Expand the C/C++ node. Select the Output Files property page.

Modify the Generate XML Documentation Files property.

但是,我注意到你正在使用网站项目,看起来没有“direct" 网站的选项不同于 Web 应用程序项目。很少有工具 vsdocman,SandCastle 可以生成最终文档和 XML 文件,甚至来自网站项目。

有关更多详细信息,请参阅