Results 1 to 6 of 6

Thread: [RESOLVED] How to get rid of this error

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    4,967

    Resolved [RESOLVED] How to get rid of this error

    I was creating a UserControl called "userShuntGrid". I put a few controls on the Form and then ran the application real quick. I then decided to abort using the UC and instead of deleting the UC from within the IDE, I deleted the associated files from Windows Explorer. Now the app won't compile and I'm getting this message (see attached image). How do I resolve this?

    Thanks,
    Blake

  2. #2
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,573

    Re: How to get rid of this error

    You may have deleted the user control but you haven't stopped your forms from trying to use it.

    Open up any forms that use the user control in the designer - They will probably fail to open.
    Look at the Designer Code and you will probably still see several references to the User Control - delete those references.

    I should say that messing around in the designer code file is dangerous and if you delete the wrong thing you can irrevocably corrupt your project so
    1. Take a back up first
    2. Don't go in there unless you really have to.
    You can depend upon the Americans to do the right thing. But only after they have exhausted every other possibility - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

  3. #3
    You don't want to know.
    Join Date
    Aug 2010
    Posts
    4,580

    Re: How to get rid of this error

    There's a good reason to delete the UC from Visual Studio instead of directly from Windows Explorer.

    Most Windows Forms-related files add 2-3 'secret' files that are needed by the compiler to the project. If you only add or remove files from Solution Explorer, Visual Studio takes care of managing those secret files and updating your project file to stop referring to them.

    What has happened here is you've deleted the files, but the references to them linger within the project files. And forms might still refer to them, but since it mentions the .resx file I think you have a project file problem.

    So the first fix is to find your .vbproj file on your filesystem and open it in a text editor. It's just an XML file. Search it for any bits that reference "userShuntGrid.resx", and delete those sections. Be careful to maintain proper XML syntax within the file.

    If that doesn't fix everything, you'll have to go through a process like what FunkyDexter is saying: you have to look for all files referring to that control and manually remove those.

    If that doesn't work, or if you're just lazy, you could post your project and I'm sure an expert could sort it out.
    This answer is wrong. You should be using TableAdapter and Dictionaries instead.

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    4,967

    Re: How to get rid of this error

    I actually fixed the issue. I recreated the UC, saved the project and then deleted it from the IDE.
    Blake

  5. #5
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,155

    Re: [RESOLVED] How to get rid of this error

    Does the Solution Explorer still show your UC as part of the project? If so, which I would expect is the case, then you can still delete it there and that will delete it from the project and remove any lingering references.

  6. #6
    You don't want to know.
    Join Date
    Aug 2010
    Posts
    4,580

    Re: How to get rid of this error

    Quote Originally Posted by blakemckenna View Post
    I actually fixed the issue. I recreated the UC, saved the project and then deleted it from the IDE.
    This is the clever way to try and fix it, it doesn't always work right, but good job
    This answer is wrong. You should be using TableAdapter and Dictionaries instead.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width