13
------ Clean started: Project: DataService, Configuration: Debug Any CPU ------
O/R Designer validation failed for file: a.dbml
O/R Designer validation failed for file: b.dbml
O/R Designer validation failed for file: c.dbml
O/R Designer validation failed for file: d.dbml
O/R Designer validation failed for file: e.dbml
O/R Designer validation failed for file: f.dbml
Error: The operation could not be completed. Unspecified error 

This error is intermittent. Sometimes the clean is fine, sometimes this happens.

I'm running VS2008 version 9.0.30729.1 SP - 64bit.

Is there some way I can disable the O/R designer's validation or otherwise stop this from occuring?

Gert Arnold
  • 105,341
  • 31
  • 202
  • 291
Amy B
  • 108,202
  • 21
  • 135
  • 185

7 Answers7

16

I had to close Visual Studio and reopen it. Solved this for me. In another case I had to roll back my DBML file, then close Visual Studio, and reopen it.

Looks like a bug for Microsoft to fix.

Chris Moschini
  • 36,764
  • 19
  • 160
  • 190
6

I had also the same problem, but the following procedure let VS always compile the code correctly:

Close VS

delete all files in the obj\x86 (and eventually x64)\Debug (and Release)\ directory

Then start VS again via command line using

<Path>\devenv.exe /ResetSkipPkgs (optionally: <Name>.sln to open directly the correct project)

(Not sure whether the /ResetSkipPkgs is necessary, but another article told so. I made a small batch script which does all of this automatically). The code should compile now without any problems!

For reference, my script file looks like this:

del /Q C:\[...]\[...]\obj\x86\Debug\*.*

"C:\Programme (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe" /ResetSkipPkgs C:\[...]\[...]\<Name>.sln

(I always develop in debug mode, thus I only delete the matching x86\Debug directory...)

Andre
  • 81
  • 1
  • 3
  • I was able to solve this problem by just closing Visual Studio and deleting my obj directory. I was then able to clean and build correctly without having to do the /ResetSkipPkgs step. – David Dowdle Sep 27 '13 at 20:09
  • I have the same error. VS Community Edition 2015. I tried to reopen vs with /ResetSkipPkgs but it does not help. Moving tables and other solutions failed too. – Sergey Lobanov Dec 13 '16 at 13:01
  • @AbdusSalamAzad If I remember right - I had changes in *.csproj and *.csproj.vspscc files and these files were corrupted (I don't know how), I made rollback and it worked. – Sergey Lobanov Jul 01 '21 at 08:45
3

This problem appeared after I copied a property in a table. For some reason the copied property had the same storage name. Deleting this storage attribute in dbml xml for those copied properties solved the issue.

So the source of this problem is most likely some error in the dbml file. If you have version control, check what you changed and maybe you'll spot the error.

jahu
  • 5,427
  • 3
  • 37
  • 64
  • same error for me. viewed dbml file in text editor and was able to see that my new columns had old storage variables that were already used elsewhere in the columns that i had copied. renamed and fixed. – user2983931 Apr 07 '21 at 10:33
1

vs2010 was giving me this error while vs2017 was building it fine, running vs2010 with /ResetSkipPkgs (Andre's answer) solved for me.

numan
  • 71
  • 1
  • 4
0

I solved moving a table around in the .dbml designer (so basically not changing anything), saving and rebuilding the project.

Vland
  • 4,151
  • 2
  • 32
  • 43
0

VS2017 was giving this error for one of my DBML files, and was preventing me from successfully building the project. None of these answers worked for me. Things I tried were: (1. Check csproj file for any inconsistencies such as missing item groups or appended numbers on filenames 2. Running devenv.exe /ResetSkipPkgs 3. Deleting visual studio temporary files)

This error was driving me crazy as the error visual studio shows is very cryptic. My eventual solution was to open the problematic DBML in design mode, and delete every stored procedure (I left the tables). Ran a build and the error stopped generating. Then I simply re added all the stored procedures back to the DBML, and that seemed to have done the trick.

0

So far, deleting and re-adding the dbml file is the only thing that has worked for me.

hobwell
  • 538
  • 1
  • 8
  • 26