Oct 1, 2012

ASP.NET ASPX Pre-compile Errors

MS Visual Studio, by default, does not compile a project’s ASPX/ASCX pages until runtime (via IIS Just-In-Time compiler).  Unfortunately, the IIS JIT compiler is very forgiving, ignoring some syntax errors, missing custom tag libraries, un-handled events, etc.  Therefore, these types of errors may exist in ASPX pages even though the web page “works”.


This Visual Studio Post-Build Event will show these hidden ASPX errors in the Error Window when a normal REBUILD ALL is performed.


Framework 2.0, 3.0, 3.5:
VS2010 -> Project -> Properties -> Build Events -> Post-build event command line:
"%systemroot%\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler" -errorstack -c -v "$(TargetName)" -p "$(ProjectDir)\"


Framework 4.0, 4.5:
VS2010 -> Project -> Properties -> Build Events -> Post-build event command line:
"%systemroot%\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler" -errorstack -c -v "$(TargetName)" -p "$(ProjectDir)\"


64-bit Framework 2.0, 3.0, 3.5:
VS2010 -> Project -> Properties -> Build Events -> Post-build event command line:
"%systemroot%\Microsoft.NET\Framework64\v2.0.50727\aspnet_compiler" -errorstack -c -v "$(TargetName)" -p "$(ProjectDir)\"


64-bit Framework 4.0, 4.5:
VS2010 -> Project -> Properties -> Build Events -> Post-build event command line:
"%systemroot%\Microsoft.NET\Framework64\v4.0.30319\aspnet_compiler" -errorstack -c -v "$(TargetName)" -p "$(ProjectDir)\"

Jul 1, 2008

MS SQL Server Error Codes

SELECT * FROM [master].[dbo].[sysmessages]

Severity Levels:
0 to 10 Messages with a severity level of 0 to 10 are informational messages and not actual errors.
11 to 16 Severity levels 11 to 16 are generated as a result of user problems and can be fixed by the user. For example, the error message returned in the invalid update query, used earlier, had a severity level of 16.
17 Severity level 17 indicates that SQL Server has run out of a configurable resource, such as locks. Severity error 17 can be corrected by the DBA, and in some cases, by the database owner.
18 Severity level 18 messages indicate nonfatal internal software problems.
19 Severity level 19 indicates that a nonconfigurable resource limit has been exceeded.
20 Severity level 20 indicates a problem with a statement issued by the current process.
21 Severity level 21 indicates that SQL Server has encountered a problem that affects all the processes in a database.
22 Severity level 22 means a table or index has been damaged. To try to determine the extent of the problem, stop and restart SQL Server. If the problem is in the cache and not on the disk, the restart corrects the problem. Otherwise, use DBCC to determine the extent of the damage and the required action to take.
23 Severity level 23 indicates a suspect database. To determine the extent of the damage and the proper action to take, use the DBCC commands.
24 Severity level 24 indicates a hardware problem.
25 Severity level 25 indicates some type of system error.