By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,572 Members | 1,516 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,572 IT Pros & Developers. It's quick & easy.

BOGUS BUILD ERRORS - Possible solutioin

P: n/a
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

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!
' =en#f2c47cfb4a05f663

Dim Props As Properties
Dim PropObj As [Property]
Dim myToken As String = "Remove idiotic build errors and blow me MS!!!"
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
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
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

Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.