** Fatal Crash In My LS Project - HELP! **


  • Hi,

    I seem to have suffered a fatal crash in my LS project, and now the project seems corrupt. For whatever reason my machine crashed at the point I was updating the datasource. The project will no longer load, and for each of my forms ( about 55 of them ) I see an error along the lines of:

    Error 14 The DataService property of the SaveChangesTo in the Screen 'FormCountryCodeMaintenance' cannot be resolved:  Could not resolve Id 'KELplan_LightSwitchDataDataService' to any item.  No matched model item can be found. C:\KELplan SourceCode\DotNet\Kingfield_Development\PartQuotationManagerOld\PartQuotationManager\Data\ApplicationDefinition.lsml

    The home page tells me that there are critical errors in the application definition metadata, and presents a reload button.

    Also the solution explorer logical view has nothing in it anymore.

    Has anyone experienced this before ? If so, please help!



    mercoledì 13 luglio 2011 10:00

Tutte le risposte

  • I am also showing this error:-

    Error 1 There is no DataService defined for Domain Source 'KELplan_LightSwitchData'. C:\KELplan SourceCode\DotNet\Kingfield_Development\PartQuotationManagerOld\PartQuotationManager\Data\ApplicationDefinition.lsml 1986 1 

    So clearly I have lost my DB connection somewhere.



    mercoledì 13 luglio 2011 10:11
  • Hi Nick,

    Sorry to hear about this corruption.

    Do you have a backup of the lsml file? If so, maybe you could compare the sections that relate to the data source to work out where the corruption might lie?


    mercoledì 13 luglio 2011 10:27
  • Hi Tim,

    My backup is a couple of days old, but it could be compared I'm sure.

    I'll take a look and see if I can spot anything!



    mercoledì 13 luglio 2011 10:33
  • Hi Nick

    If you look in the \Bin\Debug\bin directory, there should be the lsml file from the last successful build.




    mercoledì 13 luglio 2011 12:16
  • @Paul - that's a fantastic suggestion! Hope Nick finds a working copy there.
    mercoledì 13 luglio 2011 12:43
  • Excellent try Paul, but that too seems trashed!

    I would have expected that one to be ok, and I am just wondering if I somehow managed to accidentally delete the datasource whilst working on the project.

    That said I have no option in the broken project to put it back, so I am out of ideas as to what has happened. I will have to revert to my previous back-up and go from there.

    Thanks for your help...


    mercoledì 13 luglio 2011 13:17
  • Nick,

    I know it doesn't help you now, & I don't mean this to sound "glib", but backing up more often is really going to be the only thing that will help you out of situations like this. Unfortunately, backing up even the simplest of projects is at least 200-300 Mb. You generally only *need* one, but of course you can keep as many of these as you feel may be necessary.

    I'm now in the habit of making such a backup BEFORE I start working on any particular LS project. The WHOLE solution. That way I only risk losing the work I did since I took the backup, not *days* worth of changes (& probably won't remember all that I've done anyway). I had to learn that the "hard way", lol.

    Something I hadn't thought of until your problem arose, is that it might also be useful to take a quick backup of JUST the lsml file (you can keep multiple versions to enable comparisons without taking up huge amounts of disk space) any time you're going to be making any significant changes (particularly something like updating a data source), because as you've discovered, if something goes wrong during an operation that affects the lsml file, it can become unusable.

    There only needs to be ONE small error in the file & LS will refuse to load the whole project.


    (plus ça change, plus c'est la même chose!)

    giovedì 14 luglio 2011 01:07
  • I use source control for my LS project and I'm starting to check that ISML file in after about every new feature that I add. That means I check it in 10 times per day if not more. Can't be too careful.
    giovedì 14 luglio 2011 02:59
  • Sadly Yann, I can't argue with that can I!?

    I'm now backing up twice daily ( to two different locations ), and after a few hours work yesterday most of my losses had been recovered.

    Your suggestion of backing up the lsml file is a good one especailly as I am coding new parts of an application with lots of new tables in the DB.  

    However doesn't the fact that the lsml file is so critical to the whole application give LS an inherent weakness ?




    giovedì 14 luglio 2011 14:49
  • That's a good move Xander ;o)
    giovedì 14 luglio 2011 14:50
  • Not that it would help now. Playing with EF 4.1 CodeFirst. It seems codefirst would be a better model for building models on LS instead of a bunch of xml and lsml files, etc.  Instead having 1 readable code file with the context and entities.  Have more control on database updates (or not) also. 
    giovedì 14 luglio 2011 18:58