我正在尝试为WebSite生成文档,但是,我没有项目,换句话说,我只是在Visual Studio中打开一个WebSite,我不能从这个web项目样式生成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
并且,我尝试用BUt代码创建一个web项目,我得到了同样的错误。如何生成此web syte项目的文档??
发布于 2013-06-11 15:40:55
因为VisualBasic编译器中有一个bug (根据Sandcastle文档),您需要手动添加所有导入。甚至像System或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)
在那之后,一切都运行得很完美。
https://stackoverflow.com/questions/16171843
复制相似问题