What Was I Thinking?

Follies & Foils of .NET Development
posts - 85 , comments - 250 , trackbacks - 0

January 2010 Entries

How to get Pre-Build Event support for Web Site Projects
In Visual Studio (2008) Web Site Projects do not support pre/post build events. Web applications do, but web sites do not. This doesn’t mean you can’t have pre/post build events however. You just have to be a little creative. In my scenario, I needed a pre-build event to fire. 1. I added a new class library project to my solution and configured its post build event to execute the pre-build event I wanted. 2. I added a project dependency on the Web Site of the new class library. Right click the solution ......

Posted On Saturday, January 30, 2010 4:01 PM | Comments (1) |

Useful DOS Batch functions: Substring() and Length()
Recently I needed to determine the length of a string and perform a Substring operation on a variable in a DOS Batch (.bat) file. (Yes, people still use DOS batch files!) After some Googling and some playing around I came up with the following functions. :Substring ::Substring(retVal,string,s... :: extracts the substring from string starting at startIndex for the specified length SET string=%2% SET startIndex=%3% SET length=%4% if "%4" == "0" goto :noLength CALL SET _substring=%%string:~%start... ......

Posted On Saturday, January 30, 2010 2:26 PM | Comments (4) |

Running Batch Files from the Solution Explorer in Visual Studio
If you want to run a batch (.bat) file from within Visual Studio, you need to add an external tool. From the Tools menu select External Tools, and then click Add. Fill out the values as illustrated below: Click OK to close the dialog. Now you can select the bat file to run in solution explorer, and select the Run Batch File command from the Tools menu. The output of the batch file will be echoed to the output window inside visual studio. <Revised 6/2/10> You can also run .bat files from the ......

Posted On Thursday, January 28, 2010 12:29 PM | Comments (2) |

Deploying Sub folders for VS Unit Tests
My unit test project uses a app.config file that has external source references to other config files located in my “configuration” folder. My configuration folder is a sub folder of the unit test project. When the unit test runs, I need to deploy this folder to the TestResults/Out folder so the app.config can be properly loaded during test execution. Here’s the easiest way to accomplish deploying folders to the TestResults folder: Right click on the .testrunconfig file in your solution explorer. ......

Posted On Thursday, January 28, 2010 12:10 PM | Comments (0) |

How to Host Silverlight Apps under IIS6
Found this online, it proved VERY helpful and wanted to pass it along. Silverlight Error #2104 Could not download the silverlight application in IIS6 If you receive this error while trying to deploy your Silverlight application, make sure you did the following things: 1. Adjust the Content Expiration Setting You should adjust the content expiration setting to 1 minute. The following procedure outlines how to do this with IIS. Right-click your Web Site and select Properties from the context menu. ......

Posted On Saturday, January 9, 2010 12:11 PM | Comments (0) |

Powered by: