none
Visual Studio 2017 does not "like" control name. RRS feed

  • Question

  • Recently, I switch from Visual Studio 2013 to 2017, and almost right away faced strange thing: when I ran one of my applications, it stopped on the point, where I called one form. The program didn’t give any messages, just pointed on the command frmCtat.ShowDialog(). I don’t want to tell you about my researches, just would like to explain, what I found out:

    1. The problem is with control’s name. It doesn’t matter if I add combo or text box, panel, label etc., I just cannot name it cmbDeptDesc (upper or lower case – doesn’t matter).

    2. At first, I thought that problem was with that form, but when I renamed control, added new control to other form and assigned name cmbDeptDesc to new control, I got the same problem when application called the form with this control.

    3. None of other applications have this problem

    4. I didn’t have any problem with this application under Visual Studio 2013

    Any suggestions would be appreciated.

    Friday, June 21, 2019 1:28 PM

All replies

  • Hi

    Do you have any other Control that may have the same name already.


    Regards Les, Livingston, Scotland

    Friday, June 21, 2019 1:45 PM
  • For the record, file structure is the same between VS2013 and VS2017. VS2015 adds a hidden folder at the solution level. With that if you check for an existing control via

    • IDE file menu
    • View
    • Other windows
    • Document Outline window which shows all controls and permits selecting them.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Friday, June 21, 2019 2:12 PM
    Moderator
  • No. At least, the "Find" option with "Current Project" environment didn't find any.
    Friday, June 21, 2019 2:49 PM
  • Thank you for reply, but I am kind of beginner and don't understand what are IDE file menu and View.

    At least, the "Find" option with "Current Project" environment didn't find any control or form with such name.

    Friday, June 21, 2019 2:56 PM
  • Hi

    Try using

    View->Other Windows->Document Outline (as Karen suggested)

    and see if a control is listed with that name.


    Regards Les, Livingston, Scotland

    Friday, June 21, 2019 2:57 PM
  • In what point should be my application?

    When I point on control cmbDeptDesc and go through View->Other Windows->Document Outline I can see all controls in my form. Please, read again point #2 in my question:

    2. At first, I thought that problem was with that form, but when I renamed control, added new control to other form and assigned name cmbDeptDesc to new control, I got the same problem when application called the form with this control.

    It means, the problem is not with the certain form. It happens when I put the control with the name cmbDeptDesc in ANY form of this project. Even, if no other form contains control with such name

    Friday, June 21, 2019 3:16 PM
  • Hi

    OK, ensure that the name has no space character at the end.

    I have no trouble adding a ComboBox and renaming to 'cmbDeptDesc' here, but, if a space character is included on the end, it causes the error Identifier 'cmbDeptDesc ' is not valid.


    Regards Les, Livingston, Scotland

    Friday, June 21, 2019 3:43 PM
  • Hi,

    Here is my statement #3:

    3. None of other applications have this problem

    It happens ONLY with this particular project. And, again, it doesn't matter, what control I add. The whole application doesn't "like" name cmbDeptDesc. I know, it sounds weird, but I really spent a few days to find it out.

    Just to prevent your next question:

    I added new form to the project and started copying there one by one all controls from existing form and running application after each step. That is how I found what control was causing the problem. After that, I started "playing" with name. Then I removed (or renamed) control from one form and added to another. And, like I said, it was the problem when I called form with this control. I don't know how to say it, but my feeling is that the problem is hidden somewhere in the project's body


    • Edited by IosifK Friday, June 21, 2019 4:22 PM
    Friday, June 21, 2019 4:11 PM
  • Hi

    Last suggestion.

    Close Visual Studio.  Go to the project folder and open each (if more than 1) xxxx.Designer.vb file in NotePad and search for the offending name (cmbDeptDesc).


    Regards Les, Livingston, Scotland

    Friday, June 21, 2019 4:29 PM
  • There are 3 of them. Not found
    Friday, June 21, 2019 4:49 PM
  • The only way I can get an issue is by placing a space after the name e.g. "cmdDeptDesc "


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Friday, June 21, 2019 5:09 PM
    Moderator
  • Hi

    OK, I'm all out of ideas. Good luck.


    Regards Les, Livingston, Scotland

    Friday, June 21, 2019 5:10 PM
  • I have had similar problems and I went to the Build menu item in VS and select the "Clean" item.  This will get rid of some internal stuff that will sometimes give you the kind of problem you are seeing.

    Lloyd Sheen

    Friday, June 21, 2019 5:16 PM
  • Hi, Lloyd,

    Clean Solutions or Clean projects?

    Friday, June 21, 2019 5:21 PM
  • Lloyd,

    I run both. Same result.

    Any other ideas?

    Friday, June 21, 2019 5:58 PM
  • Les,

    Thank you so much. In any case, you gave me a lot of ideas.

    Friday, June 21, 2019 6:08 PM
  • Hi,

    You can see the error details,as other Control already have the same name below.


    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, June 24, 2019 7:35 AM
  • Thank you, Alex.

    I don't receive any error message. And from my previous replies you can see that I already checked Document Outline, all xxxx.Designer.vb files and cleaned Solutions and Project. Also, I already said that "Then I removed (or renamed) control from one form and added to another. And, like I said, it was the problem when I called form with this control."

    I definitely don't have other control with the same name.

    Monday, June 24, 2019 11:49 AM
  • Karen,

    I found this article: "Visual Studio 2017 15.3.0 git changes include "storage.ide" even though …"

    (unfortunately, I cannot copy the link).

    Now I know something about .ide files. I copied storage.ide file and then removed from the original all references to cmbDeptDesc. However, it didn't help. Also, I wasn't able to open two other files, storage.ide-shm and storage.ide-wal.

    Under Team Explorer tab I clicked on the Manage Connections button (it is not green but blue instead, which differs from article) there is nothing under Git Repositories

    I am wondering: if I delete this file (or even all three files), or its contest, will it somehow harm my project?

    Thanks,

    Iosif

    Monday, June 24, 2019 12:08 PM
  • Karen,

    I found this article: "Visual Studio 2017 15.3.0 git changes include "storage.ide" even though …"

    (unfortunately, I cannot copy the link).

    Now I know something about .ide files. I copied storage.ide file and then removed from the original all references to cmbDeptDesc. However, it didn't help. Also, I wasn't able to open two other files, storage.ide-shm and storage.ide-wal.

    Under Team Explorer tab I clicked on the Manage Connections button (it is not green but blue instead, which differs from article) there is nothing under Git Repositories

    I am wondering: if I delete this file (or even all three files), or its contest, will it somehow harm my project?

    Thanks,

    Iosif

    Perhaps the following may help clear things up

    https://stackoverflow.com/questions/45802083/visual-studio-2017-15-3-0-git-changes-include-storage-ide-even-though-vs-in/45802211


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Monday, June 24, 2019 2:57 PM
    Moderator
  • Karen,

    Sorry, I haven't noticed your reply.

    Actually, in my question I mentioned the same site.

    1. First, I didn't have any repo, so I was unable to right click on something.

    2. I added one empty repo C:\Users\ikushni\Source\Repos\NewRepo>

    3. Then: right click -> Open Command prompt -> typed "git rm " and after that I put different codes from the article's suggestions, but every time received the same message:

    "'git' is not recognized as an internal or external command, operable program or batch file."

    What I do wrong?

    Thanks,

     

    Monday, June 24, 2019 6:42 PM
  • Karen,

    Sorry, I haven't noticed your reply.

    Actually, in my question I mentioned the same site.

    1. First, I didn't have any repo, so I was unable to right click on something.

    2. I added one empty repo C:\Users\ikushni\Source\Repos\NewRepo>

    3. Then: right click -> Open Command prompt -> typed "git rm " and after that I put different codes from the article's suggestions, but every time received the same message:

    "'git' is not recognized as an internal or external command, operable program or batch file."

    What I do wrong?

    Thanks,

     

    Hi,

    see the link,Git Installation instructions

    https://docs.microsoft.com/en-us/azure/devops/repos/git/command-prompt?view=azure-devops

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, June 26, 2019 9:25 AM