none
Data source not displaying correctly when using Add Existing Item

    Question

  • Visual Studio 2012
    vb.net 3.5

    I have some new data source files in my project directory but when I try to use Add Existing Item to add them to my project they don't appear correctly. Included screenshots will describe my problem. For the purposes of this demonstration we are using two data sources.. one which displays correctly and one that does not:

    Working: dsPCATypeList
    Not: dsPCAListSB

    I open the project, rightclick on the project Node and select Add Existing Item


    I select the dsPCAListSB.xsd file


    dsPCAListSB.xsd now shows in the project item lists but the icon is different than the other data sources

    If I toggle the Show All Files (A) button you can see that the file structure for dsPCAListSB is not the same as dsPCATypeList. Letter B shows the dsPCAListSB.Designer.vb file is listed by itself (B) rather than under the dsPCAListSB.xsd file (C). Letter D shows the structure of the working data source.



    If I look at the files for both data sources on the disk they seem the same


    The only way I've found to get around this problem is to edit the .vbproj file directly and add the relevant sections. Text is for a different, non-working data source which was fixed by this code.



    I would really like to use the Add New Item functionality so I don't have to edit the .vbproj file but I'm clueless as to why this is happening. Any information or instruction would be most appreciated.

    Thank you!



    Monday, January 11, 2016 5:01 PM

Answers

  • Hi Jake Fosheezee,

    Please create a new project and add these two data source into new project to check whether it also has this problem.

    If just this specific project, this problem is related to your project. Please delete the .suo file under solution file which save user settings for current solution.

    If for all project, please create another data source to make sure whether this problem occurs with other data source file. Since one of the data source file is correctly, I think this problem is more related to the specific file. Please compare the file properties, whether there any differences.

    In addition, please select all related files (.Designer.vb file, .xsc file, .xsd file, .xss file) when adding existing items in Visual Studio to check whether it still has this problem.

    Best Regards,
    Weiwei

    Tuesday, January 12, 2016 8:58 AM
    Moderator