Archive for the ‘ Windows/.NET ’ Category

EntityClient Provider Named Connection Not Found Or Not Valid

When using Entity Framework models in an environment with multiple projects, such as an N-Tier web applications, the following run-time exception may appear:

The specified named connection is either not found in the configuration, not intended to be used with the EntityClient Provider, not valid.

Read more

Model-First Entity Framework With .MDF Database Files in App_Data

The recommended way to create SQL databases from Entity Framework models is to use a dedicated database server. However, in some instances you may want to create the database in a .mdf file inside the application’s App_Data directory. While this is definitely possible, the solution is certainly not straightforward and not entirely possible from within Visual Studio alone. One needs to connect to an existing SQL Server database instance in SQL Server Management Studio and manually attach the .mdf database file to that instance.

Read more

Asynchronous Streaming Reverse Proxy for IIS 6.0

I recently started to use Subsonic on my Windows Home Server to make my music collection available over the internet. Subsonic must be configured to run on a port other than port 80, because this port is already used by the IIS web server. This is a major inconvenience, because it may prevent you from accessing the media from firewall restricted networks, and it will make the URLs to your media server somewhat more ugly. In order to get around these two problems, IIS has to serve as a proxy for the media server.

Unfortunately, IIS does not have built-in proxy functionality, and after looking at many possible solutions, including proxy servers (such as Squid), ISAPI filters (such as IIS Mod-Rewrite, IIS Proxy, ISAPI_Rewrite, IIRF and ManagedFusion Url Rewriter) and various ASP.NET scripts, I found that they either cost money, did not work for my purpose or had other disadvantages. One blog post even suggested the parallel installation of Apache with mod_proxy to provide the required functionality, but you may agree that installing a second web server for such a simple problem cannot be an elegant solution.

I came to the conclusion that the best workaround would be to write a custom HTTP handler DLL, which can easily be added to an existing IIS installation. Based on existing implementations on the internet, I wrote an asynchronous reverse proxy with support for content streaming and URL reversal. The HTTP handler has been written and tested with Subsonic, but it should be generic enough to work with many other types of HTTP based servers, including HTTPS and ASP.NET. I have also included the full source code and a sample configuration file for use with Subsonic.

Read more

Glassy Vista Aero Forms in .NET

This article is part of a backup. It was originally posted on Sunday, March 25. 2007.

A search on Google will return quite a lot of more or less complicated and complete articles on how to implement Windows Vista’s Aero glass look in your own .NET applications. This posting will describe how to achieve this effect with as little code as possible, and how to get a bit more out of it by processing user input accordingly.

Read more

Visual C++ Express, Microsoft Windows SDK & Windows Vista 64-bit

This article is part of a backup. It was originally posted on Wednesday, February 21. 2007.

The following article describes how to use Visual Studio C++ 2005 Express Edition with the new Microsoft Windows SDK on 64-bit Windows Vista systems. It will, at least for the better part, apply to other Windows Operating systems as well.

Read more

Getting Started with WPF in Visual C# Express Edition

This article is part of a backup. It was originally posted on Tuesday, February 27. 2007.

Currently, none of the Visual Studio suites have out-of-the-box support for the new Windows Presentation Foundation (WPF) in the .NET Framework 3.0. This article explains what you need to get started with the development of WPF based .NET applications in Visual C# Express (and other Visual Studio Editions).

Read more

Embedding QuickTime Media into .NET Applications using Visual C#

This article is part of a backup. It was originally posted on Friday, February 23. 2007.

Adding the ability to play embedded QuickTime media in your .NET application is fairly easy using the QuickTime COM/ActiveX Control provided by Apple as part of their QuickTime for Windows player software. However, although the online documentation for the QuickTime Framework is quite extensive and detailed, the COM/ActiveX Section leaves much to be desired, especially if it comes to the initial installation and setup. This article provides a detailed description on how to get started, and it also resolves the difficulties you will encounter when developing for 64-bit platforms.

Read more