2010-05-04 38 views
0

在Visual Basic中,當「frmMain事件:加載」,我得到以下錯誤運行代碼時爲「projData.projDataModule」的類型初始值引發了異常

The type initializer for 'projData.projDataModule' threw an exception. 

var = 180 

「變種」 在projDataModule定義爲

Module projDataModule 
    Public var As Double 
End Module 

當我重新生成解決方案,它說: 「0錯誤,0警告」而實際上編譯,但錯誤列表顯示了以下錯誤:

Error 1 Custom tool error: Failed to generate file: There is an error in XML document (1, 1). I:\Documents and Settings\Bill\Desktop\Projects\Data\My Project\Application.myapp 1 1 Data 

Application.myapp是包含以下內容的XML文件:

<?xml version="1.0" encoding="utf-16"?> 
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
    <MySubMain>true</MySubMain> 
    <MainForm>frmMain</MainForm> 
    <SingleInstance>false</SingleInstance> 
    <ShutdownMode>0</ShutdownMode> 
    <EnableVisualStyles>true</EnableVisualStyles> 
    <AuthenticationMode>0</AuthenticationMode> 
    <SplashScreen>frmSplash</SplashScreen> 
    <SaveMySettingsOnExit>true</SaveMySettingsOnExit> 
</MyApplicationData> 

任何意見或幫助都將不勝感激。提前致謝。

回答

0

我同樣的問題,但我在同一個解決方案中有多個項目,所以他們中的一些正在工作,有些不是我跟蹤之間的XML文件,我通過更改utf-16 utf-8來修復它

+0

我試了一下,編譯它,然後再次返回值爲16,並沒有錯誤編譯它,我不知道發生了什麼,我聯繫微軟小組,並獲得更多關於什麼是錯的,以及我可以打破的信息。 – jprbest 2010-11-05 16:10:06

相關問題