Visual Studio 2010 Ultimate Layer Diagram - Open Source Equivalent? - visual-studio-2010

I really like the feature of having a dependency diagram and preventing certain assemblies from having references to other assemblies - ensuring other developers adhere to good programming practices.
Is there an open source equivolent of Visual Studio 2010 Ultimates Dependency Diagram? I checked out NDepend, however, this is for business use, so I cannot use the free version.
Edit: Perhaps I'm referring to the layer diagram? Whatever diagram that can be used to ensure certain assemblies do not have references to other assemblies
I.E.
Business assembly
Data assembly
Data.EntityFramework assembly
Data.EntityFramework implements interfaces from the Data assembly. The Business assembly only has a reference to the Data assembly, and has an instance from Data.EntityFramework via Unity or another IoC container.
I only have Visual Studio 2010 Professional :(

I haven't found anything that is a full equivalent of the layer diagrams in VS 2010.
ConQAT will let you visualize and analyze architectural conformance, but won't enforce rules at compile time like layer diagrams can. Also, ConQAT doesn't seem to work with VS 2010 solutions, which is a shame because it looks like it could be a very useful tool. It does support VS 2008 solutions.
Gendarme is the closest match to what you want, I think. This is a rule-based tool from the Mono team, and can be integrated into the IDE or your build server. So it will help you identify and enforce good programming practices, but it's not going to generate any diagrams for you.
Out of the box, Gendarme comes with lots of rules for catching bad practices (long methods, lack of cohesion, deep inheritance trees, etc.). You would have to write your own custom rules to enforce your specific architectural constraints - in your case by iterating through the assemblies and checking references.
The rules are written in C# - here's an example.

Related

Visual Studio project generation

Is there any way to auto generate visual studio projects with a, lets say, some kind of UML tool, so I can design project dependencies upfront and it will output the solution and its projects.
Bonus: I can do classical UML design (classes, interfaces, etc.) aswell
I'd appreciate any hint for any tool.
You could try GenMyModel. It lets you doing your model, writing and executing your own template generators directly from your browser.

Nesting Projects

I see that MS has documentation on how to implement nesting projects when implementing new project types. While this looks do-able, I'd rather not write and maintain my own VS extension if I can avoid doing so. Is there any "generic" project type already implemented by some extension that will allow project nesting? The idea would be that the parent project does nothing but include its children and allow building, adding references, etc.
Managed Package Framework for Projects is for Visual Studio 2013 and includes "a project system that supports nesting" (see the NestedProject sample). I have not tried it myself, though I did look through it a while back (the VS 2010 version) and it has thorough documentation.
It may or may not be as extensive as what you are looking for. From the overview in the documentation:
Creating a new project type in Visual Studio is complex task. Using MPF_Proj is a good starting point for creating custom project types in Visual Studio written in managed code but there are limitations that would have to be considered before using the framework.
MPF_Proj is not a .NET library. It is rather a framework of source files (classes, utilities etc.) that can be included in a VSPackage project.

Creating custom designer over XML file as VSIX 2010 package

We have a set of VS 2008 packages which leverages custom Project/Item templates, designers around XML files for our in house product development using VS. We are planning to move to VS 2010 and looking for migrating our VS 2008 packages to 2010. I see that there has been a rewrite of VS from ground up using WPF/MEF, but still could not figure out how we can leverage it for our packages. I am seeing some guidelines, samples and community material on how we should be extending the VS 2010 WPF based text editor, but could not find any reference implementations on how one should implement a custom designer on top of XML using the WPF/MEF APIs of VS SDK.
Only sample I have come across regards to any custom designer implementation so far was Example.XmlWpfDesigner - http://code.msdn.microsoft.com/Designer-View-Over-XML-20a81f17 which does not talk anything about WPF/MEF way of doing custom designers.
Has anybody come across any reference implementations along these lines? Any help regarding this would be much appreciated.
Thanks,
Siva
The sample you linked to is the right one to be looking at for a designer over an XML file. It is a WPF-design surface that edits VSTemplate XML files.
The only part of the VS API's that moved to MEF in VS 2010 was the core text editor. While you are welcome to use MEF for the implementation details of your designer, you'll still need to talk to the VS COM API's to do things like buffer management, interfacing with Source Control interfaces, etc...

Reverse Engineering a C# Solution

I know Visual Studio 2010 Ultimate has some abilities, and I would normally do this by instinct, but I am on a very tight schedule. I also have Visio 2010 installed and integrated into VS, but its reverse engineer function doesn't seem to do much, and has to be run on a per project basis, and a hindrance here is the solution structure, with several solution folders each holding a multitude of projects.
I would like some advice on how to go about reverse engineering a C# solution into dependency diagrams, sequence diagrams and class diagrams.
If you use Visual Studio, the 2010 Ultimate edition supports 5 commonly-used UML diagrams (class , sequence , use case , activity , and component ). You can generate sequence diagrams and layer diagrams from code . If you also install the Visualization & Modeling Feature Pack with VS 2010 Ultimate, you can create UML class diagrams from code and generate code from UML class diagrams .
You can also explore existing code by using Architecture Explorer and visualize relationships in code by generating dependency graphs , which you can then also use to create layer diagrams.
As alternative, you can use Altova Usemodel or Sparx System's Enterprise Architect
since C# is using JIT compilation, an intermediate code is generated in compilation and there is a way to see that intermediate code.
reverse engineering in C#
This tip is from : http://www.devx.com/tips/Tip/30046
I am just pasting here. You should give credit to the original author if he is on StacOverflow
Open a window in VS.NET. Go to Project—>Visio UML—>Reverse Engineer. This automatically shows you the class diagrams with perfect relationships.
Note: This tip will work with VS.NET Version 1.0.0 and higher.

Designing a Visual Studio 2010 Integration Package

I'd like to get started with the Visual Studio 2010 SDK and creating integration packages. All I would like to do for now is provide a new project type and language service. However, I don't know how I should design it...
The package will provide an editor for a programming language that compiles for x86 or ARM processors. The problem is that there are a few language differences depending on which processor you're developing for. I'd rather not have a separate project type for each architecture, however. Preferably, the programmer chooses the architecture when they create the project and the package automatically loads up the specific parts such as the correct language service, configuration settings, and whatever custom tools and dialogs are associated with that architecture.
How would I go about doing this? I've read about "flavored projects", but I don't really understand how to implement them. Is that what I need?
A couple of points to note to get you headed in the right direction:
The interfaces for a language service to hook into the editor have completely changed for VS 2010. I would recommended asking questions on the VS Editor Forum where all the devs for the core VS editor hang out for the speediest answers since the documentation and samples are still incomplete at this point. (There is a compatibility layer to support "old" language services, but you'd be better off just using the new interfaces since you're starting from scratch.)
A "flavored project" (referred to in the docs as a Project Subtype) is a way to add/remove functionality from an existing project system. For example, there is are project flavors for Web Projects, WPF, Devices, Database, etc.... on top of CSProj and VBProj. In these cases C# and VB are the "base" project systems and WPF, Web, Database are flavors that extend the base C#/VB project systems. Since you have a custom language, you should implement your own base project system. Your best bet for starting from scratch would be to build something based off the MPFProj source library.
I'm working on something very similar -- here is my starting point:
http://blogs.msdn.com/noahric/archive/2010/02/15/markdown-part-4-outlining.aspx
It's a very nice example of how to implement an editor extension.

Resources