Hi all!
As many of you, I have a big VB.NET solution and quite often get bogus build errors out of the blue.
This isn't declared, that is not a property of some shit and so on...
It's very frustrating and the only solution for me was to reload a solution which takes time...
I've browsed through usenet to find some solution, but nothing...
One of the posts gave me an idea, so I've put together a macro that fixes the problem for me.
The idea is to force the precompiler to scan the entire code and resets the (probable) overflow which causes the idiotic build errors.
Try the macro and let me know if it works for you.
If some of you have some other solution, let me know as well!
:)
Fight the power! ;)
--
-----------------------------
Igor A.
2005 VN800 Classic
From a galaxy far,far away...
Zagreb, Croatia
http://vulcanowners.com/crovn/
http://www.vroc.org/view_profile.php?user_id=18684
Sub Get_Rid_Of_The_Bogus_Build_Errors()
'Author : Igor Apostoloski
'Date : 08.06.2005
'
'If you are getting bogus build errors in your .NET solutions
'which dissapear when you reload solution or close and open
'IDE, try this macro...
'
'Works for me :)
'
'Microsoft can continue to look the other way all it wants as far as I'm concerned!
'
'Thanx to Danny Woolston for the idea!
'http://groups-beta.google.com/group/microsoft.public.dotnet.languages.vb/browse_frm/thread/54beeb73cf254ecf/f2c47cfb4a05f663?q=hack1+%22task+list%22&rnum=1&hl =en#f2c47cfb4a05f663
Dim Props As Properties
Dim PropObj As [Property]
Dim myToken As String = "Remove idiotic build errors and blow me MS!!!"
Try
Props = DTE.Properties("Environment", "TaskList")
For Each PropObj In Props
If PropObj.Name.ToUpper.Equals("COMMENTTOKENS") Then
Dim ar() As Object = PropObj.Value
Dim s As String
Dim cnt As Integer
For cnt = 0 To ar.Length - 1
s = ar(cnt).ToString
If s.StartsWith(myToken) Then
Dim i As Integer = _
CInt(s.Substring(myToken.Length, s.IndexOf(":") - myToken.Length)) + 1
ar(cnt) = myToken & i.ToString & ":2"
Exit For
End If
Next
If cnt = ar.Length Then
ReDim Preserve ar(ar.Length)
ar(ar.Length - 1) = myToken & "0:2"
End If
PropObj.Value = ar
Exit Sub
End If
Next
MsgBox("Can't open Environment -> Task List -> CommentTokens", MsgBoxStyle.Information)
Catch ex As System.Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error")
End Try
End Sub