<p>I had been happily coding along on a decent sized solution (just over 13k LOC, 5 projects) which utilizes Linq to Sql for it's data access. All of sudden I performed a normal build and I received a sweet, sweet ambiguous message:</p>

<p><strong>Error 1 Build failed due to validation errors in C:\xxx\xxx.dbml. Open the file and resolve the issues in the Error List, then try rebuilding the project. C:\xxx\xxx.dbml</strong> </p>

<p>I had not touched my data access layer for weeks and no adjustments had been made to the DBML file. I tried plenty of foolhardy tricks like re-creating the layout file, making copies and re-adding the existing files back to the project after restarting Visual Studio (in case of some file-level corruption); all to no avail.</p>

<p>I forgot to wear my Visual Studio Skills +5 talismans, so I began searching around and the only answer that I found which made sense was to reset my packages because Visual Studio was not loading an assembly correctly.  After running "<em>devenv.exe /resetskippkgs</em>" I was, in fact, able to add the dbml file back to the DAL project and rebuild the solution.</p>

<p>I’m glad it’s fixed, but I would rather also gain a deeper understand from this experience. <strong>Does anyone know how or why this happens in Visual Studio 2008?</strong></p>

<p><strong>New Edit: 10/30/2008</strong>
<strong>THIS WAS NOT SOMETHING THAT JUST HAPPENED TO ME.</strong>
Rich Strahl recently wrote on his "web log" <a href="http://www.west-wind.com/Weblog/posts/505990.aspx" rel="nofollow noreferrer">about the same experience</a>. He links to another <a href="http://blog.mjjames.co.uk/2008/07/build-failed-due-to-validation-errors.html" rel="nofollow noreferrer">blog with the same issue and used the same action</a>.</p>

<p>I have encountered this issue a few times since this original post as well, making me think that this is not some random issue. If anyone finds the definitive answer please post.</p>

[{'answer_id': 28873, 'author': 'Rob Cooper', 'author_id': 832, 'author_profile': 'https://Stackoverflow.com/users/832', 'pm_score': 2, 'selected': True, 'text': '<p>TBH, I have had a couple of instances like this where files "seemed to go crazy".. However, upon investigation it has appeared that the files have changed in some way, shape or form.. (e.g. sometimes changes can be made to the file by inadvertantly changing a property somewhere that <em>seems</em> unrelated).</p>\n\n<p>I think there are too many possible issues that could really cause this, and based on the fact that the problem has been resovled, it seems like an answer will not be found..</p>\n'}, {'answer_id': 483731, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 2, 'selected': False, 'text': '<p>After installing Phalanger for Visual Studio 2008, I attempted to create a new PHP WinForms Application. The project creation failed with a similar error message, stating that a DLL required could not be loaded (Failed to load file or assembly...). Running the devenv.exe /resetskippkgs command in Visual Studio 2008 Command Promtp resolved the issue immediately. </p>\n\n<p>Thanks for the info.</p>\n'}, {'answer_id': 3512753, 'author': 'JERKER', 'author_id': 344887, 'author_profile': 'https://Stackoverflow.com/users/344887', 'pm_score': 2, 'selected': False, 'text': '<p>I also get this error when trying to compile the data access layer in the second solution (installer). What I do is that I run Custom Tool on the dbml-file, and this does it.</p>\n\n<p>There is really no errors in the dbml file that needs to be corrected.</p>\n\n<p>My theory in this is that Visual Studio caches the compiled version of the dbml file, and that the cache is invalid for other solutions. I guess running /resetskippkgs does the same thing as recompiling the dbml file.</p>\n\n<p>Anyway, there are no fix for this yet?</p>\n'}, {'answer_id': 14585567, 'author': 'Richard Pursehouse', 'author_id': 994269, 'author_profile': 'https://Stackoverflow.com/users/994269', 'pm_score': 1, 'selected': False, 'text': '<p>I had the same issue in VS 2010 (build failed due to validation errors in dbml file). I resolved this by viewing the designer view of the dbml file and dragging a table slightly to a different location so that it refreshed the dbml layout etc files. This seemed to do the trick, but was a bit of a weird issue.</p>\n'}]
['https://Stackoverflow.com/questions/28839', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2213/']