2013-04-23 183 views
0

我想生成一個網站的文檔,但是,我沒有一個項目,換句話說,我只是去在Visual Studio中,我打開一個網站,我不能從這個XML文檔生成Web項目的風格:SandCastle生成文檔。從網站

enter image description here

而且,我在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. 

,當我刪除此,代碼被編譯normaly; X

而且,我試圖創建一個Web項目白衣這個代碼,但是,我得到了同樣的錯誤.. 我如何可以生成此WebStet項目的文檔?

回答

0

由於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 i as Integer = 0 In List(Of Object)
之後,這一切都非常完美。