Attempting to learn C# .NET etc self study. I have subscribed to LearnNowOnline and one of the courses has a Lab module that shows the tutor using Class Designer to view a Class Diagram. Does the Express version have the Class Designer feature? Where can I find details about the difference between the free and paid versions?
I am using VS 2013 Express (Desktop) and the directions on "How to add class diagrams..." as documented on MSDN.
1) In Solution Explorer, right-click the project name. Then choose Add New Item or Add, New Item.
2) Under Templates, choose Class Diagram. I don't even see a Templates selection item.
For Visual C++ projects, look under Templates, and then under Utility to find this template.
3)The class diagram opens in Class Designer and appears as a file that has a .cd extension in Solution Explorer in the project hierarchy. Use the Class Designer toolbox to drag shapes and lines to the diagram.
The lab solution has a .cd file and when I click and view this .cd file the window shows:
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram MajorVersion="1" MinorVersion="1">
<Font Name="Tahoma" Size="8.25" />
<Class Name="ClassesLabCompleted.LogFile" Collapsed="true">
<Position X="0.5" Y="0.5" Width="1.5" />
<TypeIdentifier>
<FileName>LogFile.cs</FileName>
<HashCode>AAAAAAAAgAAAAAAAAAAAAAAAAAAAACQAAAgAAABAAAA=</HashCode>
</TypeIdentifier>
</Class>
</ClassDiagram>
No pretty UI like in the tutorial's video. Further, I have no right click context menu selection to "View Class Diagram"
If Visual Studio 2013 Express supports this feature, how do I access it?
This is a Visual Studio Professional or better feature. Express doesn't have the Code Visualization and class Designer features (nor any of the other UML features).
As far as I can tell there is no official feature comparison for Visual Studio that includes the Express editions. But there is a blog post that describes the 2012 features and they have remained almost identical with the upgrade to 2013.
The 2013 feature comparison for the other editions can be found here.
UPDATE
Now that the Visual Studio Community Edition is available, you may be able to use that instead of Express. It depends on whether you fall in the license category for the Community Edition:
Q: Who can use Visual Studio Community?
A: Here’s how individual developers can use Visual Studio Community:
Any individual developer can use Visual Studio Community to create their own free or paid apps.
Here’s how Visual Studio Community can be used in organizations:
An unlimited number of users within an organization can use Visual Studio Community for the following scenarios: in a classroom learning environment, for academic research, or for contributing to open source projects.
For all other usage scenarios: In non-enterprise organizations, up to 5 users can use Visual Studio Community. In enterprise organizations (meaning those with >250 PCs or > $1 Million US Dollars in annual revenue), no use is permitted beyond the open source, academic research, and classroom learning environment scenarios described above.
Source
Related
We had used Visual SVN for Eclipse before starting a new project with Visual Studio 2017 and now we are looking a similar one for VS. We have look at several version control plugin and tried some of them i.e. Team Foundation Server, AnkhSVN but we do not think that they fulfilled our requirements. We have many problems while synchronisation and we do not want to use it anymore. So, we are looking a good version control plugin or software similar to Visual SVN in Eclipse as described below:
It uses Windows Server rather than Linux, etc.
It should be free.
It should be as useful as Visual SVN as used for Eclipse.
Could you please suggest us some plugin or tool having the features above for Visual Studio 2017 except from AnkhSVN? Any help would be appreciated.
I have been using VS 2015 and like the Class Diagram item.
I recently upgraded to 2017 and can't seem to find the Class Diagram item.
Anyone know how I get to it?
Using VS2017 Enterprise:
Go to the Quick Launch Bar (top right) Ctrl + Q
Type "Class Designer" and an install link will pop up
Click install, restart, and your off to the races... Enjoy!
Noticed this in the beta and thought I had a bad install. The UI elements to add new Class Diagrams were missing and I was unable to open existing *.cd Class Diagram files in my solutions. Just upgraded to 2017 and found the problem remains. After some investigation it seems the Class Designer component is no longer installed by default.
Re-running the VS Installer and adding the Class Designer component restores both my ability to open and edit Class Diagrams as well as the UI elements needed to create new ones
You need to install “Visual Studio extension development” workload and “Class Designer” optional component from the Visual Studio 2017 Installer to get the feature.
See: Visual Studio Community 2017 component directory
But this kind of item is not available on all project types. Just try for yourself:
In a Console App (.NET Framework) is available;
In a Console App (.NET Core) is not available.
I couldn't find more info on future availability also for .NET Core projects.
Woo-hoo! It works with some hack!
According to this comment you need to:
Manually edit Microsoft.CSharp.DesignTime.targets located in C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\Managed (for VS Community edition, modify path for other editions), append ClassDesigner value to ProjectCapability (right pane):
Restart VS.
Manually create text file, say MyClasses.cd with following content:
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram MajorVersion="1" MinorVersion="1">
<Font Name="Segoe UI" Size="9" />
</ClassDiagram>
Bingo. Now you may open this file in VS. You will see error message "Object reference not set to an instance of object" once after VS starts, but diagram works.
Checked on VS 2017 Community Edition, v15.3.0 with .NETCore 2.0 app/project:
GitHub issue expected to fix in v15.5
the following procedure worked for me:
Close VS.
Run Visual Studio Installer.
Click on the 'Modify' button under 'Visual Studio Professional 2017'
In the new window, scroll down and select 'Visual Studio Extension Development' under 'Other Toolsets'.
Then on the right, if not selected yet, click on 'Class Designer'
Click on 'Modify' to confirm
VS 2017 Professional edition-
Go to Quick launch type "Class..." select Class designer and install it.
Once installed go to Add New Items search "Class Diagram" and you are ready to go.
In addition to #ericgol's answer:
In the French version of Visual Studio Community 2017, type "Concepteur de classes" in the search bar.
Open Visual Studio Installer from the Windows Start menu, or by
selecting Tools > Get Tools and Features from the menu bar in Visual
Studio.
Visual Studio Installer opens.
Select the Individual components tab, and then scroll down to the
Code tools category.
Select Class Designer and then select Modify.
The Class Designer component starts installing.
For more details, visit this link:
How to: Add class diagrams to projects
I am using VS 2017 Enterprise, you can find an option to install the class diagram extension using he Quick Launch in VS.
A further note on Dmitry's 2017 answer. I opened up
C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\MSBuild\Microsoft\VisualStudio\Managed\
Microsoft.CSharp.DesignTime.targets
and went to the <ProjectCapability> element. I already had this:
<ProjectCapability Include="
CSharp;
Managed;
ClassDesigner**;**" />
with ClassDesigner already there, and yet I was still unable to drag items to my hack-made Diagram.cd using the XML editing method Dmitry mentioned (
Manually create text file, say MyClasses.cd with following content:
<?xml version="1.0" encoding="utf-8"?> <ClassDiagram MajorVersion="1"
> MinorVersion="1">
> <Font Name="Segoe UI" Size="9" /> </ClassDiagram>
). But when I took off the semicolon off 'ClassDesigner' in that element then reopened Visual Studio, voila, I was able to drag classes from my Solution Explorer to my Diagram.cd window.
So in conclusion, this element in Microsoft.CSharp.DesignTime.targets worked:
<ProjectCapability Include="
CSharp;
Managed;
ClassDesigner" />
I am using VS 2019, version 16.1.5.
I am trying to find a way to generate UML diagrams (sequence diagrams, class diagram, etc) from my C# code written in Visual Studio 2012.
I saw a link on http://office.microsoft.com/en-us/visio-help/about-reverse-engineering-code-to-the-uml-HP001208803.aspx that I could bring my Visual Studio project into Visio.
But its first part where it says "In the Visual Studio environment, reverse engineering is activated from a command on the Project menu." doesn't work for me because I cannot find a reverse engineering option under the Project menu.
How can I generate UML diagrams from C# code written in Visual Studio 2012 into Visio 2010?
Microsoft no longer considers Visio to be a software engineering tool. There was a version known as "Visio for Enterprise Architects", which had this integration with Visual Studio. It was available with the highest-end edition of Visual Studio.
I believe it was last supported with Visual Studio 2005, though that might have been 2003.
Visual Studio Ultimate now has its own built-in UML features which do not rely on Visio.
Blast from the past. It's been a while since I've reverse engineered anything into UML so my knowledge may be outdated.
In any case, as far as I remember, code reverse engineering using Visio is a Visio feature not a Visual Studio feature, thought some versions of Visual Studio have their own modelling features.
In order to use Visio reverse engineering you need make sure the Visio UML addin is installed (it should be available in Professional and above versions of Visio, but may not be installed by default.)
Here's a rather old step by step of the process for an old version of Visio and Visual Studio. I don't think the process has changed that much (though obviously the languages supported have changed.)
In any case I never liked Visio for UML (truth be told I never liked Visio.) I rather liked Sparx System's Enterprise Architect for modelling, and their reverse engineering was quite good when I used it on .Net 2.0. I don't know how their current version copes with the newer features. I also like their "from scratch" modelling environment better.
Finally keep in mind UML is supposed to be a modelling not a programming language. I.e. it is meant to convey the high level design so the overall architecture of a solution can be more easily understood; or to model key dynamic interactions, again, so the implemented or proposed solutions to the modeled problem can be more easily understood.
Reverse engineered UML diagrams often have too much information for them to be useful, and it is difficult in any case to translate the precise semantics of a specific language into UML. You may be better off creating diagrams from scratch. Other than deployment and package diagrams, it should be understood that UML diagrams represent a high level overview or specific high level dynamic interaction representation, not an as-developed representation.
This depends on which version of the product you are using. I have Visual Studio Professional 2012 and I don't see this option. This makes sense if you look at the product features. If, however, you look at the product features of Visual Studio 2012 Ultimate, you will see UML modelling, and various other visualisation tools.
Visual Studio 2010 non-Ultimate version allowed for this UML generation by using Feature Pack, which hasn't been developed for Visual Studio 2012 yet. As Dominic mentioned (he beat me to it), Visual Studio 2012 Ultimate should allow for this though.
Visual Studio Ultimate 2012 can generate very nice sequence diagrams for C# code when you just select a member (method name); and it fails constantly at my place if I do the same for in VB code.
This in contrast to Enterprise Architect from Sparx, the most advanced CASE tool for UML and other modelings AFAIK.
I am novice and work with Visual Studio, .Net, C#.
Could you please help me with the following question:
If I already created a solution
How can I create and view its block-schema in Visual Studio?
I mean diagram showing iteraction between mthods and variables etc
When you mean creating UML Class Diagrams from code then look here:
http://msdn.microsoft.com/en-us/library/ff657806.aspx
Also there is set of videos about modeling features of Visual Studio
http://channel9.msdn.com/blogs/clinted
But architecture explorer feature is present only in Visual Studio 2010 Ultimate
Also look at Visualization and Modeling Feature Pack
http://msdn.microsoft.com/en-US/vstudio/ff655021.aspx
When you have no Ultimate version of VS, maybe NClass will be good free alternative for you in this case.
Right click on your project, "View class diagram". This is available only in Ultimate edition.
What you're describing sounds more like a "Sequence Diagram". If you have Visual STudio 2010 Ultimate, you and right-click within any method and select "Generate Sequence Diagram".
But, sequence diagrams don't show all interactions with local variables; just method (and optionally property) invocations.
I have a C# class library that I need to document. Is there a way I can convert the project or class to a Visio Uml.
I am using Visual Studios 2008 Professional.
I think this thread answers your question:
http://social.msdn.microsoft.com/forums/en-US/vstsarch/thread/07b39757-eac4-49fa-81d5-8d167c9b9d21/
As mentioned by "Program.X" the above link no longer works.
Short answer: Reverse engineering of code in to Visio UML models works with the combination of Visio Pro 2007 and Visual Studio Team System for Software Architects 2005. It does not work with Visio Pro 2007 and Visual Studio Team System Architecture Edition 2008. However, Visio Pro 2007 does allow you to do reverse engineering of databases.
Why?: The ability to reverse engineer code is now provided by all versions of Visual Studio in the form of the class designer where the code is continuously synchronized with model. Additional modeling functionality will be provided within Visual Studio Team System in the future.
Apparently someone found a workaround for VS2008 but use it at your own risk.
http://www.nullify.net/Article/298.aspx
There is also an MSDN article on the subject:
http://msdn.microsoft.com/en-us/library/cc947873.aspx