Missing Connectionstring for DBML

By Dries Marckmann
September 22, 2008

I encountered a problem today which in the end had an easy solution, but nevertheless took me over an hour to fix.

Our project had been running for weeks without any problems, but today it suddenly failed with the message:

‘ProjectDataContext’ does not contain a constructor that takes ‘0’ arguments.

The Connection setting was empty and I couldn’t re-select the Connectionstring from the App.Config. If I changed the ‘Application Settings’ to false the project did build but this wasn’t the setting it used to have.

In the end my Settings.settings file was corrupt. Trying to open the settings file gave me the error: “Value does not fall within the expected range”.

I deleted the settings file, have the property sheet create a new one and the problem was fixed.


Technorati Tags: ,,

Comments: 1

  1. Don says:

    It’s unbelievable how fragile the DBML generator is. Very much appreciate your hint on the settings file. When I tried to open mine, VS2008 crashed instantly. Restarting VS2008, closing the DBML window, and restarting VS2008 again fixed my issue (including the crash-producing settings file).

Leave a Reply

Your email address will not be published. Required fields are marked *