locked
LightSwitch 2013Preview - Removing Table From ApplicationData Causes Code Generation Problem RRS feed

  • Question

  • I have a Lightswitch project started in 2012 and imported into 2013 preview. The update log says everything went well and did not mention any manual changes that need to be made.

    I have need to delete a table from ApplicationData. While modifying code to support these changes, I removed relational references to the table and reworked code to not use it as well. This seemed to build and run fine. When I attempted to delete the table the following error was thrown: "The deletion failed. Could not resolve the session Id '4467' to an editable model item."

    After this occurs, the project fails to build and appears to be in an unworkable state. Any further changes fail to trigger code generation. I have no idea where to look or what to look for. Any suggestions would be appreciated.

    I have a backup and can continue to develop the project so long as I don't attempt to delete the table.

    Saturday, July 27, 2013 1:08 AM

Answers

  • The answer appears to be related to a calculated field in the table. So far as I know, all code references to the table are removed, and all relationships dropped. The table is just standalone at this point. When I try to delete the table, the error I mentioned originally is thrown. If I first remove the one calculated field which exists in the table, and rebuild, I can then successfully remove the table.

    There also was a user code file associated with the table to support the calculated field.

    When I remove the table using the above process, VS lists an error indicating the user code file associated with the table is missing and is referenced in the Client project. I had to show all files in the client project and navigate to UserCode\Shared in the client project. Since the file in question should no longer be referenced, simply deleting the reference resolves the issue. I imagine this should be happening automatically, but I suspect the problem driving this whole issue is to blame.

    Could this all be a problem with the conversion process (2012 to 2013)? I do know the calculated field existed before the conversion to 2013, which also means the code file was part of the conversion.

    • Marked as answer by LKSummy Monday, July 29, 2013 3:40 AM
    Monday, July 29, 2013 3:40 AM

All replies

  • Was the project under source control (TFS) ?

    paul van bladel

    Saturday, July 27, 2013 8:07 AM
  • No, it is not.
    Sunday, July 28, 2013 3:34 AM
  • The answer appears to be related to a calculated field in the table. So far as I know, all code references to the table are removed, and all relationships dropped. The table is just standalone at this point. When I try to delete the table, the error I mentioned originally is thrown. If I first remove the one calculated field which exists in the table, and rebuild, I can then successfully remove the table.

    There also was a user code file associated with the table to support the calculated field.

    When I remove the table using the above process, VS lists an error indicating the user code file associated with the table is missing and is referenced in the Client project. I had to show all files in the client project and navigate to UserCode\Shared in the client project. Since the file in question should no longer be referenced, simply deleting the reference resolves the issue. I imagine this should be happening automatically, but I suspect the problem driving this whole issue is to blame.

    Could this all be a problem with the conversion process (2012 to 2013)? I do know the calculated field existed before the conversion to 2013, which also means the code file was part of the conversion.

    • Marked as answer by LKSummy Monday, July 29, 2013 3:40 AM
    Monday, July 29, 2013 3:40 AM