Cannot Drag Class Onto Class Diagram
-
Tuesday, November 23, 2010 4:55 AM
I'm using class modeling for the first time and cannot drag a class from the Architecture Explorer onto the canvas of a new class diagram. When I try to drag it, the cursor is a circle with a line through it (indicating that I cannot drop).
I'm using VS2010 Ultimate and downloaded the Visual Studio 2010 Feature Pack 2 (x86) - (English) from my MSDN subscription.
What gives? Any ideas?
All Replies
-
Wednesday, November 24, 2010 11:52 PM
Hi Sisdog.
This sounds like it should work, but a couple questions for you to sort this out -
- What language are you trying? For this simple approach, VB, C#, or C++ should work, but it'll help for me to reproduce the problem.
- What's your selection when you attempt the drag? Just the one class or ...?
Can you try the same thing on a very simple C# class library project? Just drag out the one default class and see what you get.
Thanks.
Phil Lee | Program Manager | Visual Studio Architecture Tools -
Saturday, November 27, 2010 4:33 AM
Language = C#
I've create a new model project inside a solution that already has a plain class project. The next thing I did was created a class diagram inside my model project. From there I opened the Architecture Explorer, clicked on the "Solution View", clicked on my project, and saw all my classes. From there I tried to drag any of the classes from my project onto the diagram but couldn't. I've also tried dragging classes directly from the Solution Explorer onto the diagram canvas without success.
This is really frustrating. Thx for any help.
-
Tuesday, November 30, 2010 12:23 AM
Hmm.
I'm having a hard time reproducing the problem. One more question though, when you say you can see your classes, are you looking at the files ("Class1.cs") or the actual class ("Class1")? When I follow what you've described above, I see two files - AssemblyInfo.cs and Class1.cs. This is in the 3rd of the wider lists/columns. Then, when I select the Class1.cs file, I see a "Types" vertical column and then a new list of types - only Class1 is in that list. This is the forth of the wider lists/columns.
While I can't drag out the class file, I can drag out the class.
Does this help?
Thanks.
Phil Lee | Program Manager | Visual Studio Architecture Tools -
Thursday, December 02, 2010 4:16 PM
The situation with class diagrams is following. There are 2 types of class diagrams: UML and .NET.
UML you are creating from scratch, .NET is generated from existing code.
1. UML diagrams: you can add class from UML Model Explorer or creating new from Toolbox.
2. .NET diagrams: you can add new class from solution explorer to existing diagram by drag&drop or you can create new class diagram by clicking right mouse and choose "View Class Diagram".
Classes from Architecture Explorer you can add diagram by using "Create new graph document from all selected nodes" or "Add to currently visible diagram" or you can drag&drop from Architecture Explorer.
Valdis Iljuconoks (C# MVP) Latvian Microsoft .NET User Group- Proposed As Answer by Esther FanMicrosoft Employee, Owner Monday, December 06, 2010 7:01 PM
-
Thursday, December 02, 2010 5:05 PM
Hi Valdis.
Thanks for adding the reminder about the .NET class diagram v. the UML class diagram. I had assumed that Sisdog was using the UML class diagram since he'd created a model project. Sisdog, you should certainly confirm that...
Also, Valdis, what you say about creating DGML diagrams is correct in VS2010. However, we've also released two "feature packs" that expand the capabilities released in the base product. With either of these feature packs, users can reverse engineer their code through the Arch Expl, and then drag/drop some selections from the Arch Expl to the UML class diagram to populate their UML model from thier existing code base. They can also create a DGML diagram and drag/drop from there to a UML class diagram. I think this is what Sisdog is attempting. I say some selections above because you can't drag out files. Only types. You can drag namespaces to get UML packages and all the contained types. You can drag out selections of classes, interfaces, enums, etc.
Hope this helps.
Phil Lee | Program Manager | Visual Studio Architecture Tools- Proposed As Answer by Esther FanMicrosoft Employee, Owner Monday, December 06, 2010 7:01 PM
- Marked As Answer by Esther FanMicrosoft Employee, Owner Tuesday, December 28, 2010 9:42 PM
-
Thursday, December 30, 2010 8:49 PM
I'm having the same issue as Sisdog. Situtaion:
- Visual Studio 2010 Ultimate, Feature Pack 2
- Solution with C# Class Library Project and Modeling Project
- Blank UML Class Diagram (not .NET Class Diagram)
Tried:
- Architecture Explorer-->Select Class View-->Select Namesapce-->Select Class (not file)
- Drag class to class diagram. Drag Icon shows image of number of classes selected and the "cannot drop" icon.
- Also tried selecting class and clicking "Add selected nodes to the curently visible graph document". Doesn' t work.
- What did work is that I CAN drag classes from Arch. Exlp, to graph document (*.dgml)
Thanks!
-
Monday, January 03, 2011 9:40 PM
Hi guys.
I'm sorry this isn't working. Let's try to dig further to see what we can find. Try this -
- What happens when you try to drag out the class lib namespace? You should get a UML package shape and the class inside it. If not, tell me what happens.
- What happens when you try to drag our a VB class?
- What other extensions do you have installed?
- 64 or 32-bit machine? Only drives the installation directory.
- How many files do you have in this directory - C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\Visualization and Modeling Feature Pack\2.0 -- I have 27 (64-bit machine).
- Did you get the correct behavior with the original feature pack? This behavior should not have changed, but with FP2, it's not installed as a VS extension.
Thanks.
Phil Lee | Program Manager | Visual Studio Architecture Tools -
Tuesday, May 08, 2012 1:57 PM
Hi,
I faced similar issue with the Visual Studio 2010 Ultimate edition when using the Architecture features. The solution is to install <label class="description">Visual Studio 2010 Feature Pack 2 (x86) and it fixed my problem. I am now able to d</label>rag and drop existing C# classes onto Class Diagram
Thanks,
Kishore
Never be afraid to try something new.Remember, amateurs built the ark.Professionals built the Titani
-
Tuesday, June 19, 2012 2:38 AMKidding me... Just hope that you can read Sisdog's post more carefully... The drag-n-drop simply doesn't work!! What you said is noooo solution.
-
Friday, September 28, 2012 8:07 PM
If you have VS 2012, you can expand the Class.cs file in the Solution Explorer, and the actual class will be a nested node. You can drag this onto the UML Class Diagram and it will reverse engineer it.- Proposed As Answer by cp.net Thursday, October 04, 2012 9:17 AM

