index > Visual Studio Team System - Architects > Reverse Engineering C# projects

Reverse Engineering C# projects


Hello,

I'm trying to reverse engineer a UML model from my very large solution and it's not working. I'm hoping someone reading this can help.

I've got a solution with 170+ projects. Three are C++ projects, the others C#. I've got all but 9 C# projects unloaded. I select the solution node in the solution explorer, then select Project->Visio UML->Reverse Engineer. DevStudio says it completed, Visio starts, but all I get is an empty UML model. Below is the output window results:

Performing pass number: 1.

Performing pass number: 2.

Number of warnings: 0.

Exporting UML model to Visio...

Reverse engineering succeeded.

I'm running DevStudio 2005, and Visio for Enterprise Architects. Some of my projects were created with Whidbey Beta1, others with Beta2. All of my assemblies are strong named. One thing that might be of interest is that all of the projects have file references to the output assemblies of the other projects (for reasons I won't go into now).

I'm able to reverse engineer UML models for individual projects, just not the solution as a whole. Has anyone seen this before?

Thanx in advance,

Dave

Dave Yasko

Hi Dave,

Could you try performing the same in a solution that has a couple of projects? Does it work okay in that case? We are wondering if the problem you are seeing is due to the high number of unloaded projects.

Cheers,

Ramesh Rajagopal.




This posting is provided "AS IS" with no warranties, and confers no rights.
Ramesh Rajagopal

Ramesh,

Thanx for the reply. Did you recall a previous message? I received an email with a different response (which I'd have to disagree with). The Visio help specifically states that it supports reverse engineering at the solution level, and it works with new solutions.

To answer this message, I did try a new trival test of a new solution with 3 new projects, and reverse engineering works just fine with that solution. I tried reloading all the projects in this solution, but it acted exactly the same, same output window contents, same empty Visio diagram. There was one difference however, it took longer to do that same amount of nothing.

Some other things that might be useful to know: While the vast majority of projects are C# class libraries, some of the unloaded projects are unmanaged C++ projects, there are several C# application projects, and most of the projects were created with Whidbey Beta2.

Dave

Dave Yasko

Hi Dave,

You are correct that Visio does support reverse engineering the entire solution as well as individual projects. Could you try creating a new solution and then adding a small number of the projects from your existing solution to see if you are able to reverse engineer that? As Ramesh says, it's possible that the size of the solution and the number of unloaded projects is causing a problem. The mix of C# and C++ projects shouldn't be an issue as that is a supported scenario.

Thanks,

Ian Bavey
Software Development Engineer
Visual Studio Team Edition for Software Architects

Ian Bavey

Ian,

Thanks for the reply. I did try reloading all 170+ projects to no avail. I can try with a new solution, adding a few projects at a time, but you can imagine how painful that might be. Has anyone there ever tested this functionality with anywhere near this many projects or am I the first?

Also, I've noticed that the Visio models produced only depict class inheritence and interface implementation. Is it possible to also indicate type usage and composition without having to manually add those relationships?

Thanx,

Dave

Dave Yasko

Hi Dave,

You're right, rebuilding the solution with all 170+ projects would be painful. Right now my goal is to see if adding a few projects to a new solution allows you to successfully reverse engineer those projects. It's quite possible that there are just a handful of projects that are causing the problem and if we can identify those projects then we can at least get the majority of your solution into a model. Most of our testing is done with smaller solutions than the one you are using.

You are correct that Visio only reverse engineers inheritance and interface implementation relationships. You'd have to manually add other relationship types to your model after reverse engineering it.

Please let me know if the mini-solution works.

Regards,

Ian Bavey
Software Development Engineer
Visual Studio Team Edition for Software Architects

Ian Bavey

Something else just occurred to me. I've got my projects organized into many, MANY folders and subfolders in my solution. For examle:

Solution - MySolution

- _SolutionFiles (folder)

MyKey.snk (file)

- SomeRootFolder

- SomeSubFolder1

- MyProject1Folder

MyProject1 (project)

- MyProject2Folder

MyProject2

etc...

Does that make sense? With that many projects, it is really necessary to keep the solution really organized.

Dave

Dave Yasko

That's almost certainly your problem as, unfortunately, we don't walk into folders to look for projects (at least not in the version of the code I'm looking at). At this point your best bet is to create a second solution containing all of your projects in a flat hierarchy and reverse engineer that solution. You could use the DTE automation APIs to write a macro that would simplify this work.

Ian Bavey

Software Development Engineer

Visual Studio Team Edition for Software Architects

Ian Bavey

I started seeing that in my test solution when I received the alert for your reply. Then I tested it by putting my projects in folders and seeing what didn't make it into the visio UML model. Should I post a bug on the Ladybug site, or is this thread enough to get the ball rolling?

Thanks for your help. Btw, what DTE automation APIs? Is that a way to more easily modify a solution file than that the text manipulation I've been doing? I've got a program I wrote that parses the sln file, finds all of the projects therein, reads all of the specified project files to determine which projects have file references to each other, then it mods the sln to add project dependencies to each project so that I've got the correct build order. Is there an API that makes it easier for me? That would be too cool.

Thanx,

Dave

Dave Yasko

Ladybug is your best bet as bugs logged there get more visibility.

If you bring up the Tools->Macros->Macros IDE you can write your own macros that automate tasks in VS. DTE is the root object and you can access the solution and projects from it. For example, if you fill in the parameters in the method below it will add an existing project to a solution. You could write a simple macro that walks your existing solution and writes the filenames of each project to file, then write another macro that reads the file and calls AddFromFile to add your projects to a new solution. There's a lot of online help that explains the DTE object model much better than I can - you can get a starter to it by typing the macro below, selecting AddFromTemplate, and pressing F1.

Sub AddExistingProject()

DTE.Solution.AddFromFile(...)

End Sub

Ian Bavey

Software Development Engineer

Visual Studio Team Edition for Software Architects

Ian Bavey

Thanx, I'll give that a try. I was able to reverse engineer a large portion of the solutiuon, but ran into a few issues. Most of them are with Visio, the confusion it experiences when there are multiple constructors for a particular type, but I think I can live with that.

Thanx again,

Dave

Dave Yasko
Re-marking answer to this post.


Esther Fan | User Education | Visual Studio Team Edition for Software Architects
Esther Fan MSFT
reply 12

You can use google to search for other answers

 

More Articles

DSL Tools versus .sdm sdk
WinFx and Application Designer
Distributed System template
shared types in the distributed system designer
Visual Studio 2005
Is this feasable?
System Definition Model Extension Package for Visual Studio 2005
Systems Designer does not update web.config
Problems with Application Designer
Hot to fix "A reference to document must be specified"?
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

Looking for book suggestions
Visio Enterprise Architect 2003 - Suppor…
Building Installer: How do I have it pro…
Cannot open certain files in VEA 2005 su…
application designer - generic application
Power Toys for Modeling Tools
How to implement database size constrain…
How can I export an Application Diagram?
Application/System Designer question
App Designer vs System Designer
Welcome...!!!
Validate Diagram in Logical Datacenter D…
DSL Tools versus .sdm sdk
Enterprise Templates
Synchronization for Element ResourceType…

Hot Articles

Problem with UnitofWork
Looking for a sample LLD
Application Diagram and MapPoint Web Ser…
automatic data generation tool
Regular Project Type Templates
Extending Microsoft.WebApplication compo…
Visual Studio Code Name "Orcas"…
Why no Library Project representation in…
Reverse Engineer and Sequence Diagram
PasswordFormat Error when deploying an a…
Saving diagram changes
About Interpreter Pattern
New System definition using SDM SDK
Visio for Enterprise Architects 2005 doe…
Extending Application Designer

Recommend Articles

Can not uninstall SDM model
Default implementation language for dist…
Availability of Visio for Enterprise Arc…
SDM and WebProject
shared types in the distributed system d…
AD -> SD: Override settings
DSL Tools versus .sdm sdk
WHAT IS INCLUDED IN VS For Software Arch…
Generate Application Diagram from the pr…
Representing external non-WSDL Web Servi…
Updated MSDN content for VS Team Edition…
Distributed System template generates VB…
Printing Settings and Constraints from a…
Logical Datacenter
Extending Microsoft.WebApplication compo…