SAF(NET) = STEPHEN A. FUQUA operating on the Web since 1995

Stephen is a web developer, Bahá'í, and interfaith activist in St. Paul, Minnesota. He likes to write about religion, social justice, sustainability, science, programming, &c.

December 2007 Archives

NUnit Ignores App.Config

| | Comments (0)

Problem: You want to run NUnit tests in a class library (dll). These test rely on an application configuration file (app.config) for some settings, i.e. custom appSettings or database connection strings. The code compiles and runs fine by itself, but your unit tests always fail. Attaching the Visual Studio debugger to NUnit and stepping through the code, you see that the config seems to be ignored.

Solution: This is a perfectly reasonable thing to do, and it works fine. That is, it works if your "project" in NUnit consists of the assembly, not the Visual Studio Project. If you setup the NUnit project by clicking on Project > Add VS Project, then for some reason the configuration file will be ignored. If, however, you simply drag your assembly file into NUnit, then it should work as expected.

Reusing Code in SSIS

| | Comments (0)

Problem: you have an SSIS package that you want to reuse, as a template, in a number of new packages.

Solution: follow Microsoft's simple instructions.

One of the casualties of not having a full computer science education is that I was barely exposed to threading. In my two Java classes we touched upon it, and wrote some basic examples in the second semester, but that could hardly be called extensive use. Thus, a number of years on, it has been a bit of a struggle for me to use threads in a practical manner. Further complicating the matter is that I've wanted to use anonymous methods (aka delegates) and generally want to do some work after all threads have finished executing.

Problem: without thinking about the ramifications, you've taken your default database in SQL Server offline. When you try to login through SQL Server Management Studio (or Query Analyzer) you get an error message because the app couldn't switch to the default database. Obviously, one feels pretty dumb after doing this. Thankfully it happened to me in development, not production!

Solution: It turns out the solution is just as easy as the mistake: when you log in, click the options button and choose a different database. More detail at public class:ben harrell.

deprecated

On safnet.com

Other sites managed or developed by S.A.F.

S.A.F. elsewhere on the web

  • LinkedIn
    LinkedIn can actually be useful when looking for prospective hires and business or organizational partners
  • GoodReads
    A fun and relatively-unknown social networking site geared towards one's book list
  • Live Journal
    Mirror of the blog at safnet.com, so that a few LJ friends can more easily read and comment there