# VS.Net Solution - Added two script properties to get compiler warning and error count

**URL:** https://www.finalbuilder.com/forums/t/vs-net-solution-added-two-script-properties-to-get-compiler-warning-and-error-count/1508
**Category:** Discussion
**Created:** [June 22, 2010, 3:12am UTC](https://www.finalbuilder.com/forums/t/vs-net-solution-added-two-script-properties-to-get-compiler-warning-and-error-count/1508 "2010-06-22T03:12:55Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [June 22, 2010, 3:12am UTC](https://www.finalbuilder.com/forums/t/vs-net-solution-added-two-script-properties-to-get-compiler-warning-and-error-count/1508/1 "2010-06-22T03:12:55Z")

</div>

Today I learned that BuildBot can log build warning counts. So I immediately searched that functionality in FinalBuilder. I found it mentioned in the changelog for version **6.3.0.1712** but not in the online help or the forum.&nbsp;Also the auto completion feature in the script editor didn't come up with it.

So, how exactly are the properties called, and where would I&nbsp;generally search for information like this?

---

<div class="post-metadata">

### Author: ![paulsamways](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/e8c25b/32.png) [@paulsamways](https://www.finalbuilder.com/forums/u/paulsamways)
#### Post date: [June 22, 2010, 10:59am UTC](https://www.finalbuilder.com/forums/t/vs-net-solution-added-two-script-properties-to-get-compiler-warning-and-error-count/1508/2 "2010-06-22T10:59:06Z")

</div>

Hi Richard,   
  
 The Build [VS.NET](http://VS.NET) Solution action has two properties, CompilerWarningCount and CompilerErrorCount, that can be used to get the number of warnings and errors of a project.   
  
 Example (AfterAction):   
 Action.SendLogMessage("Errors: " + Action.CompilerErrorCount, stInformation);   
 Action.SendLogMessage("Warnings: " + Action.CompilerWarningCount, stInformation);   
  
 Regards,   
 Paul.

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [June 23, 2010, 12:02pm UTC](https://www.finalbuilder.com/forums/t/vs-net-solution-added-two-script-properties-to-get-compiler-warning-and-error-count/1508/3 "2010-06-23T12:02:34Z")

</div>

Hi Paul,   
  
 thanks for the info.   
 That gives me something like this:   
  
 [code]…1\>Build log was saved at “file://c:\PointLine\3d\_OwCh\App\SHBaseObjects\Release\BuildLog.htm"1\>SHBaseObjects - 0 error(s), 1 warning(s)========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========Errors1: 0Warnings1: 0Errors2: 0Warnings2: 0…1\>Build log was saved at “file://c:\PointLine\3d\_OwCh\App\OGL\Release\BuildLog.htm"1\>OGL - 0 error(s), 76 warning(s)========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========Errors1: 0Warnings1: 0Errors2: 0Warnings2: 0 [/code]   
  
 In fact it always reports 0.   
  
 Are there special restrictions as to when the counters work?   
 The font coloring in the log window picks the warnings and errors up correctly.   
  
 Rgds   
 Richard   
  
 Here’s the action for reference:   
  
 [code] \<Object Class=“TFBVSDotNetAction” XMLID=”{B56BBA58-F01D-4B4C-88DA-8CCF9B84D77B}”\>\<Property MultiValue=“0” name=“ActionComment” type=“string”\>\</Property\>\<Property MultiValue=“1” name=“ActionDescription” type=“string”\> \<![CDATA[Build VS [PL20\_VC8.sln build] SHBaseObjects]]\>\</Property\>\<Property name=“ActionTextColor” type=“Cardinal”\>0\</Property\>\<Property MultiValue=“0” name=“ActionTypeID” type=“string”\>\</Property\>\<Property name=“AllowUnsafe” type=“Boolean”\>False\</Property\>\<Property name=“AllWarningsAsErrors” type=“Boolean”\>False\</Property\>\<Property name=“ApplyAssemblyInfoTo” type=“TVSDotNetBuildType”\>btAllProjects\</Property\>\<Property name=“ApplyResourceInfoTo” type=“TVSDotNetBuildType”\>btSelectedProjects\</Property\>\<Property MultiValue=“0” name=“AssemblyComment” type=“string”\>\</Property\>\<Property MultiValue=“0” name=“AssemblyCompany” type=“string”\>\</Property\>\<Property MultiValue=“0” name=“AssemblyCopyright” type=“string”\>\</Property\>\<Property MultiValue=“0” name=“AssemblyDescription” type=“string”\>\</Property\>\<Property MultiValue=“0” name=“AssemblyFileVersion” type=“string”\>|||\</Property\>\<Property MultiValue=“0” name=“AssemblyProductName” type=“string”\>\</Property\>\<Property name=“AssemblySelectedProjects” type=“TStrings”\> \<![CDATA[]]\>\</Property\>\<Property MultiValue=“0” name=“AssemblyTitle” type=“string”\>\</Property\>\<Property MultiValue=“0” name=“AssemblyTradeMark” type=“string”\>\</Property\>\<Property MultiValue=“0” name=“AssemblyVersion” type=“string”\>|||\</Property\>\<Property name=“AutoIncAssemblyBuildNumber” type=“Boolean”\>False\</Property\>\<Property name=“AutoIncAssemblyFileBuildNumber” type=“Boolean”\>False\</Property\>\<Property name=“AutoIncAssemblyFileRevisionNo” type=“Boolean”\>False\</Property\>\<Property name=“AutoIncAssemblyRevisionNo” type=“Boolean”\>False\</Property\>\<Property name=“AutoIncBuild” type=“Boolean”\>False\</Property\>\<Property name=“AutoUpdateFileVersion” type=“Boolean”\>False\</Property\>\<Property name=“BuildAction” type=“TVSDotNetBuildAction”\>baBuild\</Property\>\<Property name=“BuildType” type=“TVSDotNetBuildType”\>btSelectedProjects\</Property\>\<Property name=“BuildVersion” type=“Integer”\>0\</Property\>\<Property name=“CodePage” type=“Integer”\>1200\</Property\>\<Property MultiValue=“0” name=“CompilerConstants” type=“string”\>\</Property\>\<Property name=“DebugConstant” type=“Boolean”\>False\</Property\>\<Property MultiValue=“1” name=“Description” type=“string”\> \<![CDATA[Build VS [PL20\_VC8.sln build] SHBaseObjects]]\>\</Property\>\<Property name=“DisableSelectedWarnings” type=“Boolean”\>False\</Property\>\<Property MultiValue=“0” name=“DisableWarnings” type=“string”\>\</Property\>\<Property name=“DoNotValidateAction” type=“Boolean”\>False\</Property\>\<Property MultiValue=“0” name=“DotNetVersionInfoPropertySetName” type=“string”\>\</Property\>\<Property name=“Enabled” type=“WordBool”\>True\</Property\>\<Property name=“EnableTimeout” type=“Boolean”\>False\</Property\>\<Property name=“ExpandActionLogTitle” type=“Boolean”\>True\</Property\>\<Property name=“ExpandImpersonationToken” type=“Boolean”\>False\</Property\>\<Property MultiValue=“0” name=“ExtraCmdLineParams” type=“string”\>\</Property\>\<Property name=“ExtraMSBuildProperties” type=“TStrings”\> \<![CDATA[]]\>\</Property\>\<Property name=“HideActionFromLog” type=“Boolean”\>False\</Property\>\<Property name=“IgnoreFailure” type=“WordBool”\>False\</Property\>\<Property MultiValue=“0” name=“ImpersonateToken” type=“string”\>\</Property\>\<Property name=“ImpersonateUser” type=“Boolean”\>False\</Property\>\<Property MultiValue=“0” name=“ImpersonateUserName” type=“string”\>\</Property\>\<Property name=“IncludeCompileDate” type=“Boolean”\>True\</Property\>\<Property name=“IsDebug” type=“Boolean”\>False\</Property\>\<Property name=“IsDLL” type=“Boolean”\>True\</Property\>\<Property name=“IsPreRelease” type=“Boolean”\>False\</Property\>\<Property name=“IsPrivate” type=“Boolean”\>False\</Property\>\<Property name=“IsSpecial” type=“Boolean”\>False\</Property\>\<Property name=“LinkAssemblyFileVersionInfo” type=“Boolean”\>False\</Property\>\<Property name=“LinkFileAndProductVersion” type=“Boolean”\>True\</Property\>\<Property name=“Locale” type=“Integer”\>2055\</Property\>\<Property name=“LogActionProperties” type=“Boolean”\>False\</Property\>\<Property name=“LogLevel” type=“TMSLogLevel”\>llNormal\</Property\>\<Property MultiValue=“0” name=“LogToVariable” type=“string”\>\</Property\>\<Property name=“MajorVersion” type=“Integer”\>21\</Property\>\<Property name=“MaxCPUs” type=“Integer”\>0\</Property\>\<Property name=“MaxRetryAttempts” type=“Cardinal”\>0\</Property\>\<Property name=“MinorVersion” type=“Integer”\>0\</Property\>\<Property name=“Optimize” type=“Boolean”\>False\</Property\>\<Property MultiValue=“0” name=“OutputDirectory” type=“string”\>\</Property\>\<Property name=“OverrideCompiler” type=“Boolean”\>False\</Property\>\<Property name=“OverrideReferencePaths” type=“Boolean”\>False\</Property\>\<Property name=“OverrideTargetFramework” type=“Boolean”\>False\</Property\>\<Property name=“OverrideWarnings” type=“Boolean”\>False\</Property\>\<Property name=“PauseInterval” type=“Cardinal”\>0\</Property\>\<Property name=“ProjLocationDetectMethod” type=“TProjLocDetectMethod”\>useWMI\</Property\>\<Property name=“ReferencePaths” type=“TStrings”\> \<![CDATA[]]\>\</Property\>\<Property name=“ReleaseVersion” type=“Integer”\>0\</Property\>\<Property name=“ResourceSelectedProjects” type=“TStrings”\> \<![CDATA[{493CF96A-C326-4025-885C-7B600E9B5363}]]\>\</Property\>\<Property name=“RetryPauseInterval” type=“Cardinal”\>1000\</Property\>\<Property name=“SelectedProjects” type=“TStrings”\> \<![CDATA[{493CF96A-C326-4025-885C-7B600E9B5363}]]\>\</Property\>\<Property name=“SelectedWarningsAsErrors” type=“Boolean”\>False\</Property\>\<Property MultiValue=“0” name=“SharePath” type=“string”\>wwwroot$\</Property\>\<Property MultiValue=“0” name=“Solution” type=“string”\>%PL20SOURCEDIR%\PL20\_VC8.sln\</Property\>\<Property MultiValue=“0” name=“SolutionConfiguration” type=“string”\>%VcConfiguration%\</Property\>\<Property name=“StructuredOutput” type=“Boolean”\>True\</Property\>\<Property name=“SuppressStatusMessages” type=“Boolean”\>False\</Property\>\<Property name=“TargetFramework” type=“TVSDotNetTargetFx”\>fx20\</Property\>\<Property name=“TerminateOnTimeout” type=“Boolean”\>False\</Property\>\<Property name=“TimeoutLength” type=“Cardinal”\>1\</Property\>\<Property name=“TraceConstant” type=“Boolean”\>False\</Property\>\<Property name=“UpdateAssemblyComment” type=“Boolean”\>False\</Property\>\<Property name=“UpdateAssemblyCompany” type=“Boolean”\>False\</Property\>\<Property name=“UpdateAssemblyCopyright” type=“Boolean”\>False\</Property\>\<Property name=“UpdateAssemblyDescription” type=“Boolean”\>False\</Property\>\<Property name=“UpdateAssemblyFileVersion” type=“Boolean”\>False\</Property\>\<Property name=“UpdateAssemblyInfo” type=“Boolean”\>False\</Property\>\<Property name=“UpdateAssemblyProductName” type=“Boolean”\>False\</Property\>\<Property name=“UpdateAssemblyTitle” type=“Boolean”\>False\</Property\>\<Property name=“UpdateAssemblyTradeMark” type=“Boolean”\>False\</Property\>\<Property name=“UpdateAssemblyVersion” type=“Boolean”\>False\</Property\>\<Property name=“UpdateWin32Resource” type=“Boolean”\>True\</Property\>\<Property name=“UseDotNetPropertySet” type=“Boolean”\>False\</Property\>\<Property name=“UseEnv” type=“Boolean”\>False\</Property\>\<Property name=“UseErrorDialogMonitor” type=“Boolean”\>False\</Property\>\<Property name=“UseMSBuild” type=“Boolean”\>False\</Property\>\<Property name=“UseWin32PropertySet” type=“Boolean”\>True\</Property\>\<Property MultiValue=“1” name=“VersionInfoKeys” type=“string”\> \<![CDATA[CompanyName=BORM GRUPPE AGFileVersion=21.0.0.0LegalCopyright=Copyright © 2002-2009 BORM GRUPPE AG,SwitzerlandOriginalFilename=PLObGl.DllProductName=Dynamic Link LibraryProductVersion=%STR\_VERSION%]]\>\</Property\>\<Property name=“VStudioVersion” type=“TVSDotNetVersion”\>vs2005\</Property\>\<Property name=“WarningLevel” type=“Integer”\>4\</Property\>\<Property MultiValue=“0” name=“WarningsAsErrors” type=“string”\>\</Property\>\<Property MultiValue=“0” name=“WebDAVPassword” type=“string”\>\</Property\>\<Property MultiValue=“0” name=“WebDAVUsername” type=“string”\>\</Property\>\<Property MultiValue=“0” name=“Win32VersionInfoPropertySetName” type=“string”\>PL\_Version\</Property\>\<Property name=“WMIWebsiteNum” type=“Integer”\>1\</Property\>\<Property MultiValue=“0” name="\_WebDAVPassword" type=“string”\>\</Property\>\<Object Class=“TBuildScript” XMLID="{8A9CC311-89B5-4648-B163-57E4A74D33DE}"\> \<Property MultiValue=“0” name=“BreakPointsStore” type=“string”\>\</Property\> \<Property MultiValue=“0” name=“Name” type=“string”\>BeforeAction\</Property\> \<Property MultiValue=“1” name=“Script” type=“string”\>\<![CDATA[ActionStartTime = new Date().getTime();]]\> \</Property\> \<Property MultiValue=“0” name=“ScriptLanguage” type=“string”\>JavaScript\</Property\>\</Object\>\<Object Class=“TBuildScript” XMLID="{2DB55F26-FEBC-469C-8DD0-16DE891F741A}"\> \<Property MultiValue=“0” name=“BreakPointsStore” type=“string”\>\</Property\> \<Property MultiValue=“0” name=“Name” type=“string”\>AfterAction\</Property\> \<Property MultiValue=“1” name=“Script” type=“string”\>\<![CDATA[ReportSuccessToDb(Action, ActionResult);Action.SendLogMessage("Errors1: " + Action.CompilerErrorCount, stInformation);Action.SendLogMessage("Warnings1: " + Action.CompilerWarningCount, stInformation);if(ActionResult){ReportDurationToDb(Action, ActionStartTime);ReportWarningCountToDb(Action, ActionStartTime);}]]\> \</Property\> \<Property MultiValue=“0” name=“ScriptLanguage” type=“string”\>JavaScript\</Property\>\</Object\> \</Object\>[/code]   
  
 and in the project global java script:   
 [code] function ReportWarningCountToDb(Action, actionStart){ var sqls; var dbconn; var warningcount; dbconn = new ActiveXObject(“ADODB.Connection”); dbconn.Open(“PerformanceMeasures”); Action.SendLogMessage("Errors2: " + Action.CompilerErrorCount, stInformation); Action.SendLogMessage(“Warnings2: " + Action.CompilerWarningCount, stInformation); warningcount = Action.CompilerWarningCount; sqls = “INSERT INTO PerformanceMeasures (test\_name, computer\_name, user\_name, test\_start, variation, src\_branch, measure, numelem, numloop, numnest)”; sqls += " VALUES (‘WarningCount’, ‘BuildHost’, ‘Entwickler’, Now(), '” + Action.Description + “’, '” + BranchToBuild + "’, " + warningcount + “, 0, 0, 0)”; dbconn.Execute(sqls); dbconn.Close();}[/code]
