Search code examples
c#gitvisual-studio-2013visual-studio-lightswitchlightswitch-2013

LightSwitch project failed to load after merging Git branches


I've a LightSwitch project under Git source control. I merged two branches and got conflicts, after solving them my project wont load and gives me this error:

Error 1 Item with id 'LightSwitchApplication.RentEx.DesktopClient:' conflicts with another model item in file 'F:\Projects\RentEx\RentEx\RentEx.DesktopClient\Properties\Proxies.lsml'. F:\Projects\RentEx\RentEx\RentEx.DesktopClient\Properties\Proxies.lsml 0 1

This error is repeated five times !

Errors


Solution

  • Here's the problem: There were 2+ commits that included a modified DataSource. I worked on a large LightSwitch project recently with approximately 6 developers. We were in merge hell like you until we realised what was going on.

    To avoid the issue here's what you and every other developer on your team must do:

    1. git pull
    2. make changes to your database and DataSource
    3. git add, commit and push!

    If you don't want to check in your current branch, just commit your work to a new branch first, then switch to the main branch, update the DataSource and push. This way your Proxies.lsml doesn't 'break'.

    Alternatively you could do the whole lsml ninja thing and manually go through the changes in the Proxies.lsml every time, in my experience this can take up to a few hours to fix.

    Good luck.