I've created a LightSwitch application not long ago, and it all goes OK for several days. It even ran without problem.
Today I have added a few comments in the project. When I try to run it, 2 errors appeared forbidding me to finish building it.
Error 1 The name 'Query 'IdleAssetQuery' in the Domain Source 'ApplicationData'' is also used by type 'Query'. Error 2 Application definition contains critical errors.
The IdleAssetQuery was the latest query added based on another table. On the day when I created it the project compiled and ran smoothly. But now it refuses to run.
Thinking that I may have unintentionally screwed something, I later restored a backup before I made the modification today. It seems to run properly - until I try to rebuild the solution. The same errors appeared.
I have also tried deleting the IdleAssetQuery but the project won't build anyway. It even adds another "Application definition contains critical errors" error.
Is there anyone who can help me to resolve this mystery?
FYI, I am using Visual Studio Pro 2013 Version 12.0.30110.00 Update 1
Update 1: I've finally resorted to restoring an older backup before IdleAssetQuery was created in the first place. Will update after trying to get that re-created.
I did encounter the same problem today. Yesterday I was working on a LightSwitch project, solving some issues. I finished my work, built the project and everything was fine. Today I wanted to continue my work on other isseus of the project, but all of a sudden the same error appeared - but for one of my own queries of course. What happened? After some time trying to solve the problem without success, I then decided to go one changeset back in TFS history. There still was an error, but a different one with a more helpful error message! Now I was able to figure out what was going on.
The query that seemed to cause the problem was a query I used for reporting (with DevExpress XtraReports for LightSwitch). The problem was that I tried to set some standard values for parameters in the report query, but couldn't figure out where to put the code. One of my wrong attempts to find the right place must have added some XML (<QueryOperation>...</QueryOperation>) to the query's client-side lsml-file (project-folder/Client/MyProject/ApplicationData/Query.lsml). I removed this bit of XML and reloaded and rebuilt the project - and all was working fine again. So, I changed back to the current version of my project in TFS and once again removed the XML from the query's lsml-file. The project now builds and runs again without problems.
Sure, the source of your problem might not be exactly the same as mine - but it might be quite similar, I guess. Anyway, I hope this will give a hint to anyone who encounters the same problem!