Skip to main content


Showing posts from October, 2009

MySQL Connector - Error with Multiple Versions on Dev Machine - "...column 'InvariantName' is constrained to be unique..."

I installed another version of the MySQL connector on my development machine yesterday, parallel to my existing version - so I now have both 5.0.6 and 5.07 installed. I use these two different versions of it for a couple of different applications I work with. Now however I find that I’m unable to open EDMX files in projects using Entity Framework. I get the following error when I double click on the designer file:

Looking at the machine.config file, I can see there are 2 entries in there for MySQL and sure enough, the invariant names are the same:

<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=&quo…

The potential PROs and CONs of using ASP.NET MVC 1.0 for your next web project...


Properly testable and allows you to develop more elegant code.You are ‘forced’ to apply the MVC design pattern by the framework, so the only option is to have a properly defined data model + business logic layer (Model), presentation layer (View) and controller to manage their interaction.You also don’t have to deal with the ASPX page lifecycle.Because ASP.NET MVC is RESTful also, it can be used easily with jQuery/JSON, etc - the way the application is organised is more like a RESTful service. The ‘Views’ are like enhanced transforms, layered across the top of the service, that convert the dynamic application output into HTML (if that’s how you choose to define your View), rather than a series of concrete ‘pages’.Because of the way the URLs are put together (i.e. you mostly don’t need to use a suffix - like .aspx - especially under IIS7), the style is better aligned for web search engine optimisation. Web design is much easier - if you get a nice HTML page from a designer, it’s m…

SQL Server - database mail - just “because you can”, doesn’t make it right!!

Was thinking the other day (discussing across the office with a couple of colleagues actually ;-) about using database mail out of SQL Server in relation to using .NET components to send mail – kind of a hot topic for us, or at least one that's heating up.My opinion on this type of thing (thankfully shared by our DBA) is that despite the fact that SQL Server provides a very adequate email platform, and there are lots of MSDN type examples out there showing you how do this type of thing, sending bulk email from the database server (for – e.g. – an email marketing campaign type stuff) is bad form.For one thing you're putting unnecessary load on the server and slowing down applications that are using the server for doing what it's designed to do (manage and serve up relational data), and for another thing – there is simply much better support for doing this type of thing outside of the database, in application code.Here's my analogy; say you want to do some work on your c…

Using ASP.NET MVC 1.0 with Dynamic Data...

Getting Started:
Dynamic data is part of 3.5 SP1, but if you want to use MVC you need to specify that the DLLs should be copied to your \bin folder:

Setting “Copy Local” to True for the highlighted DLLs will copy them to the output folder automatically when you build and publish. Makes a bin-deploy of the MVC project easier.

...And Then:
Read Scott Hanselman's talk about MVC and DD sites together:
Then, go to this site:
...and get this sample:
You need to reference system.web.dynamicdata:
Here's what needs to be done to enable configuration of DD for a new site:

Web.Config Inheritence to Virtual Directory Application - 'inheritInChildApplications' Attribute...

Had a problem recently where an ASP.NET MVC 1.0 site was not reading the web.config in the virtual directory that we has created for it (using Helm). It was defaulting back to the main site's web.config file (in the wwwroot directorty). The error message we got was like this:
Server Error in '/blah' Application.
Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 
Parser Error Message: Could not load file or assembly 'MagicAjax' or one of its dependencies. The system cannot find the file specified. (<path_to_folder>\wwwroot\web.config line 133)
============================================================, (FYI, this has nothing to do with MagicAjax, just using this error as an example of the type of problem that can crop up) th…