Visual Studio Makes Class diagrams and if we open it in text editor program it is a simple XML. Surely we can generate that on runtime. But the problem is although you have visual studio to see the Class Diagram Generated but what solution is there if we want to deploy application where there is no Visual Studio Installed?
Is there any possibility or available plugin or library that can generate Class diagram or UML diagram from XML?
Can we somehow use Visual Studio Class Diagram to view it on runtime?
Not Sure but what if we generate xml on Back end and then if possible create Image (png or gif) using some builtin plugin and display that? (I am really not sure about this idea :()
I have seen NClass It is very good but a bit complex and it is not developed through XML.
I suggest to use PowerToys for Class Designer (http://modeling.codeplex.com). It improves the Class Designer and allows you to export diagrams to HTML. This way is easy to distribute to any machine.
As an alternative, you can take a different path with reflection, in this case you don't need the visual studio class diagram; the diagrams are generated by inspecting the requested types. I suggest to read the articles by Sacha Barber (http://www.codeproject.com/Articles/17823/100-Reflective-Class-Diagram-Creation-Tool and http://www.codeproject.com/Articles/207280/200-Reflective-Class-Diagram-Creation-Tool). Maybe you can customize his application.
In Visual Studio Enterprise 2017:
Quit Visual Studio if it is running
Start Visual Studio Installer
Click dropdown list "More" and select "Modify"
In section "Code tools", check the option for "Class Designer"
Click button: Modify
Result: now the Class Diagram should load from Solution Explorer as UML.
Related
Visual Studio Code seems like it would be a very nice tool, but right out of the gate it seemingly cannot read any configuration that would make it part of the Visual Studio family. How can I import my sln/csproj files so that Code knows how to understand them?
Visual Studio Code isn't designed to work with sln/csproj files unfortunately (or fortunately depending on how you look at it).
In order to use your project created in Windows create a .NET Core application and use 'Portable Class Libraries' instead of standard class libraries then Open Folder in Visual Studio Code.
You can open it, using vscode-solution-explorer link for more info
(P.s. Not everything works as smoothly as we would like, but it's still better than nothing)
In Visual Studio (2013/2015/2017), the Document Outline window for C# files is always empty ("There are no items to show for the selected document.").
It seems that this functionality is not (not yet / no more) implemented.
But then, how do I view the structure of the file? Is there any extension which implements this functionality?
showing only the selected/opened file
show regions
move/rename members
show documentation
Using the Solution Explorer and Class View are NOT the solution.
In the old Visual Studio 2003, I did use a self written Add-In, because it was easy to read the structure. (There were also other tools but I cannot find them anymore). So I ask here which solution you know. :-)
EDIT: Similar question also found:
How to show code outline in Visual Studio?
UPDATE: After 10 years the feature has finally arrived in VS 2022
This feature has been added in Visual Studio 2022 17.4.0:
You can now easily view a file’s structure at a glance in the Document Outline window. The Document Outline window displays the symbol tree of the file in the editor helping you quickly navigate and edit project files. You can open Document Outline by going to View > Other Windows > Document Outline or by using the shortcut Ctrl+Alt+T.
Update: This feature was disabled in v17.4.4 for the following reason:
After we released 17.4, we found some significant performance problems with the C# implementation of Document Outline that we didn’t catch during preview usage. We’ve temporarily disabled the feature, and are spending more time working on it to address these issues. These changes are larger than we’d usually like to include in a revision release, and need more bake time, so 17.4.3 [sic] onwards & 17.5 will both ship with the feature disabled. I know this is disappointing, but we have it back in no time and enabled in a future VS update.
There is also CodeMaid which provides the same functionality as JetBrains Resharper, but is free.
The best solution I found at present is:
JetBrains ReSharper (v8.0+) has a File Structure window which shows the structure of the current file as tree (types/members) and regions are also supported.
If you don´t have ReSharper, you can´t miss the Productivity Power Tools, made by Microsoft itself.
There's a specific version for each of Visual Studio versions. More info on these links:
VS2013
VS2012
VS2010
They have a feature called Solution Navigator
Also, there's this one that seems very interesting for bring alot of cool customizations to Visual Studio IDE, called VSCommands. It's worth to checkout their website => http://vscommands.squaredinfinity.com/features
It helps you look at the nested structure of certain types of files, e.g. windows forms designer file, open a form designer you should see all controls on the form shown in nested structure in the document outline window.
I've been given a folder with many .cs files and a .sln to work on with the express interest of designing a GUI for the entire project. The only problem is, I don't know how.
I have both Visual Studio 2010 and SharpDevelop 4.4 at my disposal; though I'd like to learn both evenly if possible, because I like open-source IDEs, but value experience in Visual Studio as well.
I can't find any information on how to enable design mode in this situation because of how narrow my experience is with the tools; You see, I know to right-click on a .cs file in order to view its code or design in Visual Studio 2010... but that isn't available here. The only item I can see is "view code", which is not what I'm trying to do.
If I can't enable the form, I'm wondering if I can just... create a new one? Since one does not exist?
Thank you for your help.
EDIT: A screenshot of what I see (blurred for security)
Abstract answer
The designer only makes sense for some types of files. For example, Windows Forms designer exists for classes that inherit System.Windows.Forms.Control, and when the relevant attributes for that file are set in the project.
Practical answer
Make sure you have a project that allows Forms (like "Windows Forms Application" or "Windows Forms Control Library"), create one if needed.
In project tree, right-click on the project and use some "add new ..." in the context menu.
There, choose "Form" or "Control" depending on your intent. It should create and configure what's needed, and you'll be able to use the designer.
In Visual Studio you can switch between text and designer with a shortcut key (F7, Shift-F7) or context menu. In sharpdevelop use the "Source" and "Design" tabs.
In SharpDevelop if there is a designer available for the file then you can open the designer by:
Open the file into the text editor.
Click the Design tab at the bottom of the text editor.
I have a custom dialog in my Visual Studio Seup project and need to know how to make the field required, so the user cannot progress (click next), if they don't enter a value into the textbox.
It's very rare to someone use Visual Studio Setup Project in order to make it's custom Setup ... normally we would use WIX or any other tool for builind the setup if the "normal" Visual Studio does not fit our needs.
Scott Guthrie has a old post about creating custom actions... maybe it would be a good read for you.
This can be done by configuring some control events and creating a small message box custom action. You can find the generic approach here:
http://setupanddeployment.com/installation-user-interface/validate-user-input-installation/
Visual Studio setup projects do not support this directly, but you can edit your MSI with Orca. Another solution would be to use a setup authoring tool which allows you to modify control events.
I made an application at the office which runs a bunch of ProcessManager objects which themselves run a bunch of Process objects.
I have been thinking in creating a wizard to create automaticly the classes needed, but I want now to create a custom designer for creating and editing the classes. By designer, I mean like the LinqToSql designer and so on.
I wasn't able to find any information about it, or at least clear one. I've been looking at how to create a new editor for vs 2010 or add design-time ability, but none of theses researches helped me.
The ideal would be to have let's say ProcessManagerClass1.cs and ProcessManagerClass1.designer.cs and when opening the first one, it would open the custom designer.
Do you know how to do it and give me some links for tutorials or documentation??
Thank you for your help,
Vincent
I would start with the Visualization and Modeling SDK for Visual Studio 2010, which was formerly known as the Domain Specific Languages SDK. It is the way to create custom designers in Visual Studio. To use it, you first have to install the Visual Studio 2010 SDK (SP1 here, but you may have to run them in order, which means this first, then the Visualization SDK, then SP1)