Get Compile Errors From CodeDom Compiler with

Good Morning All….

Last night I wasted another Tuesday night watching "The Shield" on FX. The writing which had been the strength of the show the first 6 years has really taken a nose dive. I was bummed they were pulling it after this year prior to this season’s start but now I agree. It is time for it to go. Yet I can’t pull away before I find out how Vic Mackey’s character is going to go out.

On the work front, somebody went in the database and changed a value they wanted to set so that no one could achieve a particular number. They changed it to 375,000,000,000,000,000,000,000,000,000,000,000,000,000,000

Well I can’t even write the whole thing here. So code that worked fine before was now bombing on this. Of course I spent two hours tracking this error. Hence what you see below.

So have you ever had a situation like this one where you were mystified at where the line number was where an error occurred in your code or what the text was behind the error? I was. So this is what I came up with.

Make it a great day!

Dim parameters As New CompilerParameters()
            parameters.GenerateExecutable = False
            parameters.GenerateInMemory = True
            parameters.IncludeDebugInformation = True
            Dim results As CompilerResults = provider.CompileAssemblyFromSource(parameters, code)
            if results.Errors.HasErrors Then
                For Each err As CompilerError in results.Errors
                    Debug.WriteLine("File={0}, Line={1}, Column={2}", err.FileName, err.Line, err.Column)
                Next err
            End If


  1. #1 by John on October 8, 2008 - 8:34 am

    Maybe you should try this from PDC 2008
    Seriously though, thanks for the vb stuff… I am not even a novice coder but understand it a little and your nuggets of code have been very helpful.

  2. #2 by Kelly on October 8, 2008 - 10:18 am

    Hey man good to hear from you. I tried to submitting "How do I suppress security alert in Outlook when accessing address book?" and it said "So many possible responses…yet none come to mind. On the other hand, I can tell you a fair amount about PDC2008.Tell your friends about Brianna, the PDC Brain." So that was kind of weird.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: