locked
Can I delete files from the client user code folder RRS feed

  • Question

  • something went horribly wrong and I deleted a screen that was critical to my project in stead of deleting a screen I was no longer using. Anyways the following is what I did afterword.

    I tried simply creating a new screen using the lightswich +screen button I created a details screen of a parent table and child table. I then renamed the screen from "LocationSpecificAreaDetailDetail" to "SpecificAreaDetails". Upon playing I relized that the screen I should have created was a "list and details" not a "details" screen so I deleted the "SpecificAreaDetails" entirely.

    I am now getting errors with the LocationSpecificAreaDetailDetail.cs which still exists in my project under the path C:\Users\Jordan Walker\Documents\Visual Studio 2012\Projects\Campaign Press\Campaign Press\Client\UserCode\LocationSpecificAreaDetailDetail.cs.

    I do no know why it still even exists since I have deleted the associated screen and wondered if I could just delete that .cs text file to clean up project. I also noticed that SpecificAreaDetails.cs still exists as well.

    The code file LocationSpecificAreaDetailDetail.cs I want to delete is as follows...

    using System;
    using System.Linq;
    using System.IO;
    using System.IO.IsolatedStorage;
    using System.Collections.Generic;
    using Microsoft.LightSwitch;
    using Microsoft.LightSwitch.Framework.Client;
    using Microsoft.LightSwitch.Presentation;
    using Microsoft.LightSwitch.Presentation.Extensions;
    
    namespace LightSwitchApplication
    {
        public partial class SpecificAreaDetails
        {
            partial void LocationSpecificAreaDetail_Loaded(bool succeeded)
            {
                // Write your code here.
                this.SetDisplayNameFromEntity(this.LocationSpecificAreaDetail);
            }
    
            partial void LocationSpecificAreaDetail_Changed()
            {
                // Write your code here.
                this.SetDisplayNameFromEntity(this.LocationSpecificAreaDetail);
            }
    
            partial void LocationSpecificAreaDetailDetail_Saved()
            {
                // Write your code here.
                this.SetDisplayNameFromEntity(this.LocationSpecificAreaDetail);
            }
        }
    }

    The errors I get are as follows...
    Error    1    No defining declaration found for implementing declaration of partial method 'LightSwitchApplication.SpecificAreaDetails.LocationSpecificAreaDetail_Loaded(bool)'    C:\Users\Jordan Walker\Documents\Visual Studio 2012\Projects\Campaign Press\Campaign Press\Client\UserCode\LocationSpecificAreaDetailDetail.cs    15    22    Client

    Error    2    No defining declaration found for implementing declaration of partial method 'LightSwitchApplication.SpecificAreaDetails.LocationSpecificAreaDetail_Changed()'    C:\Users\Jordan Walker\Documents\Visual Studio 2012\Projects\Campaign Press\Campaign Press\Client\UserCode\LocationSpecificAreaDetailDetail.cs    21    22    Client

    Error    3    No defining declaration found for implementing declaration of partial method 'LightSwitchApplication.SpecificAreaDetails.LocationSpecificAreaDetailDetail_Saved()'    C:\Users\Jordan Walker\Documents\Visual Studio 2012\Projects\Campaign Press\Campaign Press\Client\UserCode\LocationSpecificAreaDetailDetail.cs    27    22    Client

    Error    4    'LightSwitchApplication.SpecificAreaDetails' does not contain a definition for 'SetDisplayNameFromEntity' and no extension method 'SetDisplayNameFromEntity' accepting a first argument of type 'LightSwitchApplication.SpecificAreaDetails' could be found (are you missing a using directive or an assembly reference?)    C:\Users\Jordan Walker\Documents\Visual Studio 2012\Projects\Campaign Press\Campaign Press\Client\UserCode\LocationSpecificAreaDetailDetail.cs    18    18    Client

    Error    5    'LightSwitchApplication.SpecificAreaDetails' does not contain a definition for 'LocationSpecificAreaDetail' and no extension method 'LocationSpecificAreaDetail' accepting a first argument of type 'LightSwitchApplication.SpecificAreaDetails' could be found (are you missing a using directive or an assembly reference?)    C:\Users\Jordan Walker\Documents\Visual Studio 2012\Projects\Campaign Press\Campaign Press\Client\UserCode\LocationSpecificAreaDetailDetail.cs    18    48    Client

    Error    6    'LightSwitchApplication.SpecificAreaDetails' does not contain a definition for 'SetDisplayNameFromEntity' and no extension method 'SetDisplayNameFromEntity' accepting a first argument of type 'LightSwitchApplication.SpecificAreaDetails' could be found (are you missing a using directive or an assembly reference?)    C:\Users\Jordan Walker\Documents\Visual Studio 2012\Projects\Campaign Press\Campaign Press\Client\UserCode\LocationSpecificAreaDetailDetail.cs    24    18    Client

    Error    7    'LightSwitchApplication.SpecificAreaDetails' does not contain a definition for 'LocationSpecificAreaDetail' and no extension method 'LocationSpecificAreaDetail' accepting a first argument of type 'LightSwitchApplication.SpecificAreaDetails' could be found (are you missing a using directive or an assembly reference?)    C:\Users\Jordan Walker\Documents\Visual Studio 2012\Projects\Campaign Press\Campaign Press\Client\UserCode\LocationSpecificAreaDetailDetail.cs    24    48    Client

    Error    8    'LightSwitchApplication.SpecificAreaDetails' does not contain a definition for 'SetDisplayNameFromEntity' and no extension method 'SetDisplayNameFromEntity' accepting a first argument of type 'LightSwitchApplication.SpecificAreaDetails' could be found (are you missing a using directive or an assembly reference?)    C:\Users\Jordan Walker\Documents\Visual Studio 2012\Projects\Campaign Press\Campaign Press\Client\UserCode\LocationSpecificAreaDetailDetail.cs    30    18    Client

    Error    9    'LightSwitchApplication.SpecificAreaDetails' does not contain a definition for 'LocationSpecificAreaDetail' and no extension method 'LocationSpecificAreaDetail' accepting a first argument of type 'LightSwitchApplication.SpecificAreaDetails' could be found (are you missing a using directive or an assembly reference?)    C:\Users\Jordan Walker\Documents\Visual Studio 2012\Projects\Campaign Press\Campaign Press\Client\UserCode\LocationSpecificAreaDetailDetail.cs    30    48    Client


    • Edited by reigh7 Tuesday, April 29, 2014 2:28 AM
    Tuesday, April 29, 2014 2:26 AM

Answers

  • I do no know why it still even exists since I have deleted the associated screen and wondered if I could just delete that .cs text file to clean up project.

    Yes, you can delete your user code file after deleting a screen if the user code still exists in your project. I believe the behavior is that when deleting a screen, the user code for that screen is not delete but is excluded from the project. In more recent versions, where the user code file is nested directly under the screen definition, the user code file seems to be deleted along with the screen.


    Justin Anderson, LightSwitch Development Team

    • Proposed as answer by Angie Xu Wednesday, May 7, 2014 10:01 AM
    • Marked as answer by Angie Xu Friday, May 9, 2014 1:24 AM
    Tuesday, April 29, 2014 5:18 PM
    Moderator

All replies

  • I do no know why it still even exists since I have deleted the associated screen and wondered if I could just delete that .cs text file to clean up project.

    Yes, you can delete your user code file after deleting a screen if the user code still exists in your project. I believe the behavior is that when deleting a screen, the user code for that screen is not delete but is excluded from the project. In more recent versions, where the user code file is nested directly under the screen definition, the user code file seems to be deleted along with the screen.


    Justin Anderson, LightSwitch Development Team

    • Proposed as answer by Angie Xu Wednesday, May 7, 2014 10:01 AM
    • Marked as answer by Angie Xu Friday, May 9, 2014 1:24 AM
    Tuesday, April 29, 2014 5:18 PM
    Moderator
  • Yes, you can delete your user code file after deleting a screen if the user code still exists in your project.

    I believe the behavior is that when deleting a screen, the user code for that screen is not delete but is excluded from the project. In more recent versions, where the user code file is nested directly under the screen definition, the user code file seems to be deleted along with the screen.


    Justin Anderson, LightSwitch Development Team

    So I cut the misbehaving file out of the project folder but now I simply get the following error when I try and run the debugger.

    Error    1    Source file 'C:\Users\Jordan Walker\Documents\Visual Studio 2012\Projects\Campaign Press\Campaign Press\Client\UserCode\LocationSpecificAreaDetailDetail.cs' could not be opened ('Unspecified error ')    Client

    PS is there anyway that files used to create my original screen that I accidentally deleted still exist but are excluded.
    • Proposed as answer by Angie Xu Wednesday, May 7, 2014 10:00 AM
    • Unproposed as answer by Angie Xu Wednesday, May 7, 2014 10:01 AM
    Thursday, May 1, 2014 2:15 AM
  • PS is there anyway that files used to create my original screen that I accidentally deleted still exist but are excluded.

    For this issue, I think you need recreate your screen manually.

    Regards

    Angie


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, May 7, 2014 10:00 AM
  • Thanks I did that and it turned out I had to comment out the code in the file and not delete the file to fix the errors. Still not sure why they were left behind.
    Saturday, May 17, 2014 3:10 AM
  • I actually could not delete the files without causing other problems. I simply commented out the code inside the file and let the file still exist.
    Saturday, May 17, 2014 3:12 AM