在visual studio中,我创建了对Aspose程序集的引用,并在我的代码中使用了Document类。它在设计时看起来很好,但是当我去编译时,我得到的错误'Type Aspose.Words.Document'没有定义。'如果我做了任何改变项目文件的事情,比如添加或删除一个引用或添加一个新文件,这些错误就会消失......直到我再次尝试编译为止。错误'类型Aspose.Words.Document'未定义。'当试图编译
有没有其他人看到这种奇怪的行为,并知道如何解决它?这是我的代码,如果它很重要,但它并没有变得更简单:
Module Module1
Sub Main()
Dim license As New Aspose.Words.License()
license.SetLicense("Aspose.Words.lic")
Dim files = My.Resources.files.Split()
For Each file In files
If file <> "" Then
Dim changed As Boolean = False
Console.Write("Processing " & file & "...")
Dim doc = New Aspose.Words.Document(file)
If doc.Range.FormFields("CurrDate") IsNot Nothing Then
doc.Range.FormFields("CurrDate").TextInputType = Aspose.Words.Fields.TextFormFieldType.RegularText
doc.Range.FormFields("CurrDate").TextInputFormat = ""
doc.Save(file)
Console.WriteLine("done.")
Else
Console.WriteLine("not applicable.")
End If
End If
Next
Console.Read()
End Sub
End Module
只有一个库,我不需要导入语句,因为它们是完全限定的,对吗? – adam0101 2010-11-11 21:56:32