Tuesday, November 20, 2007

When opening a dbml file created in a pre-RTM version of Visual Studio 2008, you will probably see this error message:

Cannot load '[filepath].dbml': Error encountered, check Error List window for details.

Looking in the error list window, you might see the following errors:

Build failed due to validation errors in [filepath].dbml.  Open the file and resolve the issues in the Error List, then try rebuilding the project. 

and

There is no Unicode byte order mark. Cannot switch to Unicode.

Opening up the dbml file in the XML editor, the intellisense does not point out any validation errors.

 I couldn't see the problem.

Then I created a new LINQ to SQL file and looked at the xml,noticing that the encoding was:

<?xml version="1.0" encoding="utf-8"?>

while the old file had

<?xml version="1.0" encoding="utf-16"?>

So I modified the old file changing the encoding to utf-8 and voila, my project compiled and the file opened up in the designer.

Tuesday, November 20, 2007 7:29:07 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [1]  |