BOGUS BUILD ERRORS - Possible solutioin

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Igor

    BOGUS BUILD ERRORS - Possible solutioin

    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_Err ors()
    '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.publi c.dotnet.langua ges.vb/browse_frm/thread/54beeb73cf254ec f/f2c47cfb4a05f66 3?q=hack1+%22ta sk+list%22&rnum =1&hl=en#f2c47c fb4a05f663

    Dim Props As Properties
    Dim PropObj As [Property]
    Dim myToken As String = "Remove idiotic build errors and blow me MS!!!"
    Try
    Props = DTE.Properties( "Environmen t", "TaskList")
    For Each PropObj In Props
    If PropObj.Name.To Upper.Equals("C OMMENTTOKENS") 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).ToStrin g
    If s.StartsWith(my Token) Then
    Dim i As Integer = _
    CInt(s.Substrin g(myToken.Lengt h, 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.Inf ormation)
    Catch ex As System.Exceptio n
    MsgBox(ex.Messa ge, MsgBoxStyle.Cri tical, "Error")
    End Try
    End Sub

Working...