【问题标题】:SandCastle generate doc. from websiteSandCastle 生成文档。从网站
【发布时间】:2013-04-23 14:22:38
【问题描述】:

我正在尝试为网站生成文档,但是我没有项目,换句话说,我只是进入 Visual Studio 并打开一个网站,我无法从该网站生成 XML 文档项目风格:

而且,我在that 文档中看到我需要这样写:

  <system.codedom>
    <compilers>
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
        compilerOptions="/docpath:C:\Publish\Docs"
        type="EWSoftware.CodeDom.VBCodeProviderWithDocs,
              EWSoftware.CodeDom, Version=1.1.0.0, Culture=neutral,
              PublicKeyToken=d633d7d5b41cbb65">
        <providerOption name="CompilerVersion" value="v2.0"/>
      </compiler>
    </compilers>
  </system.codedom>

好的,但是当我把它放在我的 web.config 中时,当我尝试构建时,编译器会返回很多错误,比如:

error BC30451: 'DDtoCC' is not declared. It may be inaccessible due to its protection level.
0error BC30451: 'HojetoCC' is not declared. It may be inaccessible due to its protection level.
error BC30451: 'CCtoDD' is not declared. It may be inaccessible due to its protection level.
error BC30002: Type 'SqlConnection' is not defined.
error BC30002: Type 'SqlCommand' is not defined.
error BC30002: Type 'SqlConnection' is not defined.
error BC30002: Type 'SqlCommand' is not defined.
error BC30002: Type 'SqlConnection' is not defined.
error BC30002: Type 'SqlCommand' is not defined.
error BC30002: Type 'SqlDataReader' is not defined.
error BC30002: Type 'SqlConnection' is not defined.
error BC30002: Type 'SqlCommand' is not defined.
error BC30002: Type 'SqlConnection' is not defined.
error BC30002: Type 'SqlCommand' is not defined.
error BC30002: Type 'SqlDataReader' is not defined.
error BC30002: Type 'SqlConnection' is not defined.
error BC30002: Type 'SqlCommand' is not defined.
error BC30002: Type 'SqlConnection' is not defined.
error BC30002: Type 'SqlCommand' is not defined.
error BC30002: Type 'SqlDataReader' is not defined.
error BC30002: Type 'SqlConnection' is not defined.
error BC30002: Type 'SqlCommand' is not defined.
error BC30002: Type 'SqlConnection' is not defined.
error BC30002: Type 'SqlCommand' is not defined.
error BC30002: Type 'SqlDataReader' is not defined.
error BC30002: Type 'SqlConnection' is not defined.
error BC30002: Type 'SqlCommand' is not defined.
error BC30002: Type 'SqlCommand' is not defined.
error BC30002: Type 'SqlConnection' is not defined.
error BC30002: Type 'SqlDataReader' is not defined.
error BC30002: Type 'SqlConnection' is not defined.
error BC30002: Type 'SqlCommand' is not defined.
error BC30002: Type 'SqlDataReader' is not defined.
error BC30451: 'DataDiff' is not declared. It may be inaccessible due to its protection level.
error BC30451: 'AddDiastoCC' is not declared. It may be inaccessible due to its protection level.
error BC30451: 'AddDiastoCC' is not declared. It may be inaccessible due to its protection level.
error BC30451: 'QueryDB' is not declared. It may be inaccessible due to its protection level.
error BC30451: 'AddDiastoCC' is not declared. It may be inaccessible due to its protection level.
error BC30451: 'QueryDB' is not declared. It may be inaccessible due to its protection level.
error BC30451: 'Truncate' is not declared. It may be inaccessible due to its protection level.
error BC30002: Type 'SqlConnection' is not defined.
error BC30002: Type 'SqlDataReader' is not defined.
error BC30002: Type 'SqlCommand' is not defined.
error BC30451: 'QueryDB' is not declared. It may be inaccessible due to its protection level.
error BC30002: Type 'SqlConnection' is not defined.
error BC30002: Type 'SqlCommand' is not defined.
error BC30451: 'HojetoCC' is not declared. It may be inaccessible due to its protection level.

而且,当我删除它时,代码会正常编译;x

而且,我尝试使用此代码创建一个 Web 项目,但是,我遇到了同样的错误.. 我如何生成这个 web syte 项目的文档??

【问题讨论】:

    标签: vb.net sandcastle


    【解决方案1】:

    因为 VisualBasic 编译器中存在错误(根据 Sandcastle 文档),您需要手动添加所有导入。甚至像SystemMicrosoft.VisualBasic 这样的基本导入。这是我的 web.config 的一个示例:

    <system.codedom>
     <compilers>
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" 
          compilerOptions="/docpath:C:\Sandcastle\XML /imports:System,System.Resources,System.Web,Microsoft.VisualBasic,..."
          type="EWSoftware.CodeDom.VBCodeProviderWithDocs, EWSoftware.CodeDom, 
          Version=1.1.0.0, Culture=neutral, PublicKeyToken=d633d7d5b41cbb65">
        <providerOption name="CompilerVersion" value="v4.0"/>
      </compiler>
     </compilers>
    </system.codedom>
    

    当您添加所有需要的导入时,这些错误不会影响发布过程。虽然,当您发布项目时仍可能存在一些编译错误。我的所有 for each 循环中的数据类型隐式分配都有问题。

    我不得不将循环更改为
    For Each i as Integer = 0 In List(Of Object)
    之后,一切都完美无缺。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-09
      • 1970-01-01
      • 2010-09-21
      • 1970-01-01
      • 2010-09-17
      • 1970-01-01
      相关资源
      最近更新 更多