Posts

Showing posts from 2012

Debug VBScript / VBS files in Visual Studio 2010

Image
I needed to be able to step through a VBScript file that was being run in an environment that I did not have on my machine and this environment did not have a debug environment that I could use to step through the VBScript being executed.  The VBScript was simply looking to see if a folder exists on a network drive and if the folder did exist, create the folder.   Then the script would copy some files to the network drive / folder location.  My machine and user id had access to this network drive so I could run this VBScript from my machine. So placed the VBScript file (script.vbs) on my computer at C:\Projects\VBS\. Then I ran the Visual Studio 2010 Command Prompt as Admin and changed the directory to the above location: I then typed in the following and selected the enter key to run the Visual Studio Just-In-Time Debugger: cscript /x /d script.vbs The following will be presented: Be sure you select the "New instance of Microsoft Visual Studio 2010" and selec

Browser / Document Compatibility

While changing a client's existing code, I ran into some compatibility issues with IE9 and some existing code.  The client had only tested up to IE8 with the current release but their customers were having issues with what turned out to be IE9 and its ability to process the same JavaScript.  So the client would not have to change the custom control immediately, I added the following to the Master Page: <head runat="server">     <title>master title</title>     <%--Mimic Internet Explorer 8--%>     <meta http-equiv="X-UA-Compatible" content="IE=8" /> </head>    And while I was looking for the Meta tag syntax, I ran into this which I didn't realize .Net could do: <asp:Label runat="server" ID="labelText"     ie:Text="This is IE text"     mozilla:Text="This is Firefox text"     Text="This is general text" />    <asp:Button runat="server&

Re-Throwing Exceptions Across Project and Process Boundaries

In reworking a customer’s error handling framework, I wanted to be able to write one error capturing process without having to reference the code across different projects.  I simply wanted to catch the error at the point of failure with a try-catch, perform any error handling locally and then rethrow the error to the calling UI process so that the UI layer could decide what message to display.  So for a database duplicate key I could display, something like "Item already exists".  I also wanted to capture the error in one project.  I didn’t want the error capturing results spread across different machines when the solution is scaled if the database was unavailable to house the error.  Also, because different applications shared the same middle tiered objects, I didn't want extra logic to determine the what UI was making the call when capturing the error.  I wanted a simple but elegant solution.  Logically, it seemed to me that this should be done not at the place the