Tuesday, July 24, 2018
Try Catches are not necessary for logging exceptions
I support a large system where there are try catches everywhere to log the exception. See my post Simple and secure exception handling for .NET web applications for a better way. I found an instance where instead of just removing the (unnecessary) try catch, I simply removed the line that logged the error and then threw the exception expecting the Application_Error event to log. Unfortunately, the stack trace that was logged only indicated the line number of the Throw statement and not where the error actually occurred! The lesson is, if you use a try catch, then log it right there. If not, just get rid of the try catch completely.
Thursday, July 19, 2018
Remove TFS source control from a .NET solution
Sometimes, you want to remove all TFS source control bindings from a solution. This is helpful if you are moving the solution to a different TFS project or you want to use a different source control product.
First remove the .vssscc file from the solution folder, and the .vspscc file in each individual project folder.
Then, open up the solution file in Notepad. Remove the following section completely:
First remove the .vssscc file from the solution folder, and the .vspscc file in each individual project folder.
Then, open up the solution file in Notepad. Remove the following section completely:
GlobalSection(TeamFoundationVersionControl) = preSolution SccNumberOfProjects = 2 SccEnterpriseProvider = {########-####-####-####-############} SccTeamFoundationServer = https://tfs.yourdomain.com/tfs/my_collection SccLocalPath0 = . SccProjectUniqueName1 = MyProject\\MyProject.vbproj SccProjectName1 = MySolution SccLocalPath1 = MySolution EndGlobalSection
Thursday, July 12, 2018
Add an Alpha Channel to GIMP Images to support transparency
A common task when using GIMP, is to remove the background of an image and make it transparent. Use the fuzzy select tool to select the background. An image must have something called an "alpha channel" in order to support transparency. If the image already has an alpha channel, pressing the delete button will make the background transparent. If it doesn't, pressing delete will do nothing while your frustration mounts. Simply, select Transparency in the Layer menu and choose Add Alpha Channel.
Subscribe to:
Posts (Atom)