View Class Diagram in Visual Studio - Illegal characters in path

Locked View Class Diagram in Visual Studio - Illegal characters in path

  • Friday, March 02, 2012 10:44 AM
     
     

    Hi all,

    I am supposed to provide UML diagram for a C++ project by using Visual Studio. In principle that is a very easy issue: right click on the project file and choose "View Class Diagram". However I find an error message saying:

    Cannot load '..../...cd'

    Illegal characters in path

    It's two day since I started looking on internet but I didn't find a similar error message around. Other user had an "Illegal characters in path" erros for other reasons. One of them looked into HKEY_LOCAL_MACHINE  and found something odd (http://www.mofeel.net/970-microsoft-public-vsnet-ide/409.aspx), another used process monitor and found an odd characters in the path of the temp folder (http://jagbarcelo.blogspot.com/2008/01/illegal-characters-in-path-deploying.html). None of these solutions apply to my case.

    Any idea?

All Replies

  • Friday, March 02, 2012 11:38 AM
     
     

    Of course there is no special character in the path. The path for the ".cd" file is correct. I tried to store the ".cd" file somewhere else and double click on it: I have the same problem. I also tried to store my project into a folder with a different path: I have the same error message. On internet somebody write that he had a similar problem that was cused by the Resharper installation. I don't have this program on my Laptop.

    Anyone of you has any idea about where to look into? 

  • Monday, March 05, 2012 12:05 PM
    Moderator
     
     

    Hi Voltrack,

    Welcome to the MSDN Forum.

    Would you like to post a screenshot here? 

    In addition, how about view it with  "XML (Text) Editor"? If you can open it this way, it indicates there is nothing wrong with the file name or file path, it should be related to the content. So my suggestion is:

    1. Make a backup of the .cd file.

    2. delete the xml node one by one to check which part is the issue part. When you find it, remove the illegal characters. There may be some invisible characters in the node, so you can try to remove the node and build the node again.

    If you cannot open the file this way, there should be something wrong with the file name or file path, please check it again.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Monday, March 05, 2012 1:33 PM
     
     

    Hallo Mike,

    thanks for your answer. Your idea does sound very clever to me therefore I'm very excited to go ahead with it. However, I'm not sure I understood which file should I work with.  I don't find any .xml around. I guess you mean that I have to open the .cd file with xml editor. Here in my company they use visual studio for .xml file.  If I open the .cd file with a text editor, I find out that it is simply empty. 

    Probably you mean a .xml file of my C++ project?! So here in the company they didn't do any?! Is there any  automatic way to generate .xml file from a C++ project.

    Regarding the screenshot I'm not sure whether I'm allowed to provide any. I'll have to ask in the company first.

    Thanks in advance


    • Edited by Voltrack Monday, March 05, 2012 1:59 PM
    •  
  • Monday, March 05, 2012 2:58 PM
    Moderator
     
     

    Hi Voltrack,

    I don't mean a XML file, please right-click on your .cd file and choose "open with", and you can found "XML (Text) Editor", this editor will open the .cd file in a xml format.

    You have mentioned " If I open the .cd file with a text editor, I find out that it is simply empty.", if so, you can just delete this file, and generate a new one for your project.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Monday, March 05, 2012 4:11 PM
     
     

    Hi Mike,

    thank for your quick answer. I don't see any "XML (Text) Editor" when I click on "open with". I assume that the xml editor is not installed. However everytime I create a new .cd file it is empty: probably that#s the sign that the problem is somewhere else. Do you have any further suggestion?

  • Monday, March 05, 2012 4:58 PM
    Moderator
     
     

    Hi Voltrack,

    When you create a whole new one, it should be an empty file.

    Is your issue .cd file is also empty?

    I try the class diagram file in VS2010 professional edition, what is your edition?

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Tuesday, March 06, 2012 9:16 AM
     
     

    Hi Mike,

    thanks for your patience. So I found "XML (Text) Editor" and I opened the ".cd" file with it, but it's empty. I can open the file but it is empty! What I do is to right click on the name of the project and choose "View Class Diagram". I would have the same problem if I right click just on one of the class-file of the project. The project is very complex. When I tried with a simple project that  I made my own, then everything works fine: I see the class diagram and I can open the ".cd" file with "XML (Text) Editor" and it's not empty.

    I've tried to generate the class diagram from other collegues' pc and I would get the same errore message. So I assume there is no problem with the way Visual studio 2010 was installed on my pc.

    The error message reads:

    Cannot load 'D:\...\ClassDiagram222.cd'

    Illegal characters in path

    and ClassDiagram222.cd' is empy. The problem must be very early in the generation of the class diagram.

    New hints would be very welcome.

     

  • Thursday, March 08, 2012 11:37 AM
    Moderator
     
     

    Hi Voltrack,

    Thank you for your further clarification.

    Is the path the file located path? 

    >>I've tried to generate the class diagram from other collegues' pc and I would get the same errore message.

    So there should be something wrong with the VS in your PC, rather than the .cd file, so I suggest you to try to repair VS or re-install it.

    Here is a reference for VS 2008, but it also works for VS 2010: http://msdn.microsoft.com/en-us/library/aa983433(v=vs.90).aspx 

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Thursday, March 08, 2012 1:16 PM
     
     

    Hi Mike,

    thanks for your help. Yes, the file is located in that path. I doubt that the problem is related to the installation of VS. As I mentioned, I would have the same error on all pcs here in my company. Furthmore, when I try to generate class diagram for a small project, the "View Class Diagram" works without problem, on my pc and on the others' one.  How could it be related with the installation?! Thanks for your link,  I'll try to repair VS anyway and I'll let you know what happens.

    There must be an illegal character hidden somewhere, but I don'T know how to find it!

  • Thursday, March 08, 2012 1:47 PM
    Moderator
     
     

    Hi Voltrack,

    You mentioned "when I try to generate class diagram for a small project, the "View Class Diagram" works without problem", so where do you put the small project at? The same folder with the issue project? If not, please try this way.

    And you can also build another small test project with the exactly same name with the issue project, and then try to add a .cd file again.

    This should narrow the problem down.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


  • Friday, March 09, 2012 1:16 PM
     
     

    Hi Mike,

    thanks for your answer. So If I store the small working project into the path of the issue project, the small working project works fine.

    Regarding the second hint, you want me to rename the small working project as the issue project, don't you? Then I'm not sure what do you mean when you say <<and then try to add a .cd file again>>. Which .cd file?! An old one or the one that would be created for the small working project? Where should I add it?! Please, could you leave more details about that?!

    Anyway, I'm confident that this illegal character is not in the path that I see, but rather in some hidden path. For example, I've just notice that the project require a database that in turn requires the intranet connection to work, unless you copy the database on your own machine. In both case it doesn not work. This gives you an idea of how complex the project is. Is there any other wy than process monitor to check the intermediate step of the code? 

  • Tuesday, March 13, 2012 9:13 AM
    Moderator
     
     

    Hi Voltrack,

    Thank you for clarification.

    >>Which .cd file?! An old one or the one that would be created for the small working project? Where should I add it?! Please, could you leave more details about that?!

    I mean a new .cd file. Add it to the small working project.

    Do you try to repair or re-install your VS again? How about that? 

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Tuesday, March 13, 2012 12:44 PM
     
     

    Hi Mike,

    thanks for your answer. I would have the same problem after repairing and re-installing VS. I will try the other hint for the small working project. I've recently started with a new project here in the company. That would use only part of the entire code and I stored it in a different folder. The code works fine but for the diagram class view I would have the same problem. It's something wrong with the code itself ... 

  • Wednesday, March 14, 2012 9:33 AM
    Moderator
     
     

    Hi Voltrack,

    Since you have test the project on another computer, and it works will, I would say there is something wrong with your VS on this computer. So re-install VS should be helpful.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Thursday, March 15, 2012 7:02 AM
     
     

    Hi Mike,

    thanks for your quick answer. I don't understand where did you read that I <<have test the project on another computer, and it works>>. Probably I was not clear enough. I started a different project on my PC. That would use only a part of the entire code of my company. With this new project I have always the same problem with the Class Diagram View!

    The code works fine and compiles correctly but it's not able to generate class diagram. That's true for the entire code or for a part of it. There must be a bug, a path with an illegal character apparently, and I wonder if how to find it ...

  • Thursday, March 15, 2012 7:46 AM
    Moderator
     
     Answered

    Hi VolTrack,

    Since a class diagram is only related to the classes and methods, So I suggest you just to try to remove methods or classes one by one in your test project to find out which method or property caused this issue.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked As Answer by Voltrack Tuesday, April 03, 2012 12:45 PM
    •  
  • Thursday, March 22, 2012 9:00 AM
    Moderator
     
     

    Hi VolTrack,

    Any update?

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Friday, March 23, 2012 7:18 AM
     
     

    Hi Mike,

    thanks for asking. Well, your solution sound very interesting ... however it takes a bit of time to understand where to start from and go ahead with that. I'm currently busy with another project

    I'll let you know where I get with it

  • Monday, March 26, 2012 1:07 PM
    Moderator
     
     

    Hi VolTrack,

    Any update?

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Tuesday, April 03, 2012 12:45 PM
     
     

    Hi Mike,

    I'm not done yet, but I'm going ahead with it

    Best