0

I am trying to generate documentation for a WebSite, but, I don't have a project, in other words, I just go in Visual Studio and I Open a WebSite, I can't generate the XML documentation from this web project style:

enter image description here

And, I see in that documentation I need to put this:

  <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>

Ok, but when i put this in my web.config, and When I try to build, the compiler return a lot of errors, like that:

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.

And, When I remove this, the code is compiled normaly ;x

And, I have tried to create a web project whit this code, BUt, I got the same error.. How I can generate the documentation of this web syte project ??

4

1 回答 1

1

因为 VisualBasic 编译器中存在错误(根据 Sandcastle 文档),您需要手动添加所有导入。System甚至像or之类的基本进口产品Microsoft.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)
之后一切正常。

于 2013-06-11T07:40:54.940 回答