Category name:connectionstring

Missing Connectionstring for DBML

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: ,,