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.

Recently in .Net Framework Category

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.

Problem: In newly AJAX-enabled .Net 2.0 page, buttons that redirect user to another page are suddenly throwing the following error:

Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified bycalls to Response.Write(), response filters, HttpModules, or server trace is enabled. Details: Error parsing near '<BODY><ASP_SMARTNAV_'.

Problem: Microsoft .Net Framework 1.1 and .Net Framework 2.0 don't play well together (as ASP.Net apps) on Windows 2003 Server 64 Bit Edition.

Solution: either upgrade any ASP.Net 1.1 to 2.0 or switch to 32 bit compatibility mode. Of course switching to 32 bit mode will cause you to lose out on some performance benefits, but maybe you're okay with that (unless you're running under a very high load). Two easy steps:

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