首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SandCastle生成单据来自网站

SandCastle生成单据来自网站
EN

Stack Overflow用户
提问于 2013-04-23 22:22:39
回答 1查看 313关注 0票数 0

我正在尝试为WebSite生成文档,但是,我没有项目,换句话说,我只是在Visual Studio中打开一个WebSite,我不能从这个web项目样式生成XML文档:

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

代码语言:javascript
复制
  <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中,当我尝试构建的时候,编译器返回了很多错误,就像这样:

代码语言:javascript
复制
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

并且,我尝试用BUt代码创建一个web项目,我得到了同样的错误。如何生成此web syte项目的文档??

EN

回答 1

Stack Overflow用户

发布于 2013-06-11 15:40:55

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

代码语言:javascript
复制
<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)

在那之后,一切都运行得很完美。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16171843

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档