http://msdn.microsoft.com/en-us/library/87x5f80y%28v=vs.80%29.aspx函數'<procedurename>'在所有代碼路徑上不返回值
我知道錯誤和原因。我只是好奇。對於某些項目而言,這顯示爲警告,而對於其他項目則完全不顯示。
我該如何設置才能顯示警告?
http://msdn.microsoft.com/en-us/library/87x5f80y%28v=vs.80%29.aspx函數'<procedurename>'在所有代碼路徑上不返回值
我知道錯誤和原因。我只是好奇。對於某些項目而言,這顯示爲警告,而對於其他項目則完全不顯示。
我該如何設置才能顯示警告?
的警告信息:後藤的項目設計的編譯標籤:http://msdn.microsoft.com/en-us/library/87x5f80y(v=vs.80).aspx
如何隱藏或把它當作錯誤信息。
注意:您創建的對象類型有差異。在下面的例子中,只有test1會發出警告,而不是test2的功能。
Function test1() As String
End Function
Function test2() As Integer
End Function
您還可以使用編譯器選項來隱藏警告或將它們威脅爲錯誤。這種特定的警告有ID 42105: 功能或操作員沒有返回值警告它是如何在這裏工作
Generated when the function does not have a return value specified. Default for new projects is on. ID: 42105 function
的更多信息:http://msdn.microsoft.com/en-us/library/3y20cc1z(v=vs.80).aspx
When Option Strict is set to Off, Option Strict related warnings cannot be treated independently of each other. When Option Strict is set to On, the associated warnings are treated as errors, no matter what their status is. When Option Strict is set to Custom by specifying /optionstrict:custom in the command line compiler, Option Strict warnings can be toggled on or off independently.
您運行的是什麼版本的Visual Studio?你可以發佈一些不顯示此警告的代碼嗎? –