Category Archives: Web

ASP.net and other C# web-application stuff

Finding Circular Dependencies in SQL Server

SQL Server doesn’t allow a cycle of foreign keys, nor two or more paths to cascadingly delete rows from a table. Thankfully, there’s a script you can use to detect at least table reference cycles. Continue reading

Posted in Libraries, Web, Wndows Forms, WPF | Tagged , , | Leave a comment

Rails-Style Test Database Creation in ASP.NET MVC

How can you get ASP.NET MVC to create your database on the fly for tests? Well, you can, if you use migrations for your application to build the tables, drop and recreate all the tables prior to running any tests. Continue reading

Posted in Core .NET, Web | Tagged , , | Leave a comment

Testing Rendered HTML in ASP.NET MVC3

HtmlUnit and IKVM together give you the power to test your ASP.NET MVC3 application. Submit forms, and even verify the resulting HTML! All with a little help from Java, and Steve Anderson. Continue reading

Posted in Libraries, Web | Tagged , , , , | Leave a comment

Integrating NUnit with CruiseControl.NET

Interested in using CruiseControl.NET to execute NUnit tasks and integrate the results in the dashboard, without using the nunit task type? You can do it through exec, if you merge the results. This article outlines how. Continue reading

Posted in Silverlight, Tools, Web, Wndows Forms | Tagged , | Leave a comment

Fetching Connection Strings from App.Config in a Library via ConfigurationManager

System.Configuration.ConfigurationManager doesn’t (easily) allow you to read connection strings from an App.Config file inside a library. You need to add a few extra steps to pull this off, like using KeyValueConfigurationElement. Continue reading

Posted in Core .NET, Web, Wndows Forms | Tagged , , | Leave a comment

Using NInject For Compile-Time AOP

An update to my aspect-oriented design pattern for compile-time checking: you can implement aspects as interfaces with singular implementations, and use Ninject to inject the interface implementations. Smooth, easy, and it works! Continue reading

Posted in Core .NET, Silverlight, Web, Wndows Forms, WPF | Tagged , , | Leave a comment

Sending Multiple Updates Through the Updater Block

Adding multiple updates to an updater block manifest is actually quite easy. Simply package every update into its own manifest XML file, reference the manifests from the main/index manifest, and update the ID of the main/index manifest so that clients can tell that changes occurred. That’s it! Continue reading

Posted in Libraries, Silverlight, Web, Wndows Forms | Tagged , | Leave a comment

An Overview of the Updater Application Block

The Updater Application Block from Microsoft’s Enterprise Library is not immediately obvious in design. How does it work? We go through the basics. It’s a client-server architecture, which exposes an XML file containing a list of updates — what to download, and what to execute when that’s done. It uses BITS for passive transferring. Continue reading

Posted in Libraries, Silverlight, Web, Wndows Forms | Tagged , | Leave a comment

Fixing ApplicationBlocks.Updater Exception in x64

Microsoft Enterprise Library’s Update block throws an exception in 64-bit machines; this is because of the BG_BASIC_CREDENTIALS struct that uses a field offset of 4 instead of 8. Change it to eight, and your exception will vanish. Continue reading

Posted in Libraries, Silverlight, Web, Wndows Forms | Tagged , , | Leave a comment

Enums, SQL Server, and Null

Ever wonder how to deal with enumerations that might be null? Should you have a “nothing” value? What about SQL Server? As it turns out, enumerations are value types (often represented by integers), which means that they can be nullable! Continue reading

Posted in Core .NET, Silverlight, Web, Wndows Forms, WPF | Tagged , , | Leave a comment