When I opened an aspx page, or view in Visual Studio 2008 after a few keystrokes Visual Studio ‘froze’, I could not do anything with it anymore, like a modal dialog was open, only it was not.

Ofcourse I killed the proces in Task Manager and tried again and again, and again, and…
It is realy frustrating, after searching the web for some time i finally found this microsoft connect issue. It looks like MS knew, or should know about this for  some time.

Microsoft Visual Studio Web Authoring Component
The Microsoft Visual Studio Web Authoring Component is used by Microsoft Office and Visual Studio.
I upgraded from Office 2007 to office 2010, which changed the Microsoft Visual Studio Web Authoring Component Visual Studio 2008 is depending on.

The steps to fix this issue are different for the different flavours of Visual Studio (Express, Pro, Team Suite etc.) But here you can find the right steps for your configuration.

I removed the Microsoft Visual Studio Web Authoring Component, installed the version from the Visual studio installation DVD and reinstalled Visual Studio SP1

 

Henry Cordes, My thoughts exactly...
My thoughts exactly…

Currently rated 3.0 by 1 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

NDepend analyses staticly

Published 1/20/2009 by Henry in C#
Tags: ,

A few months ago Patrick Smacchia a C# MVP and the author of NDepend approached me to take a look at his product: NDepend.
I must admit until than I never done anything with it.

Nevertheless, after I checked the request was really from Patrick, I started to think about it and decided to do it, because:
A.) I felt honoured to be asked;
B.) I was curious if this product could be of value to me

FEATURES
A short overview of the area's NDepend focuses on, I took the area's from NDepend's site:

Conventions, Rules, Constraints Design, analyse and enforce your code conventions, naming guidelines and coding standards
Code Structure, Design, Dependencies     Know and control the design and structure of your code base
Build comparison Design rules to avoid breaking changes, only review changed and newly added code
Metrics Report over number of lines of code, increase testability and readability, coupling, dead code, design flaws
Code Coverage In general, but more important of newly added and refactored code, also it integrates with MS Visual Studio and NCover
Build Process / CI integration NDepend is designed to integrate with: CruiseControl.NET, VSTS Build Server, Nant and many other CI or Build tools

This list already shows that NDepend is more than just a dependency tool. Sure it can help you get an insight into the dependencies of your app or code base, but it is much more than just that.
It can help you get a deep understanding of the design and structure of any code base real fast, so if you are in the consulting business like me, this tool can really help you to get up to speed fast.
Also it can help you enforce design and coding standards, not only in the case of problems, reviews or in consulting gigs, but you can integrate it into your CI an/or build process, to get your code base to live up not only to your (quality) standards, but report about them to your clients and/or users also!
Now we know how valuable this tool is in theory, let's find out how it perform's in the real world.

INSTALLATION
So I installed NDepend, installing in the case of NDepend is nothing more than copying the files onto your harddrive and you are good to go!
I really like this approach, no registry hacks, no dependencies on stuff you do not want on your system, just the 16,6 MB of files and the .NET Framework 2.0 or higher (pic. 1).

 


Picture 1: NDepend Files

When we start it up it looks quite familiair to the Visual studio user (pic. 2):

Picture 2: Ndepend start page
Picture 2: Ndepend start page

I think the UI is made with the help of DevExpress controls (http://www.devexpress.com/Products/NET/Controls/WinForms/Bars/), so the app has dockable windows like we know and love from Visual Studio and MS Office. NDepend is skinable. In this post I started out using the default skin, but from picture 9 (Dependency Graph) on I use another skin. When I load the first assembly I must admit that I experienced exactly what Scott Hanselman describes in his post about NDepend.

<QUOTE>
The first 10 minutes of NDepend is the hardest. It has to click first. There's the whole "what the hell am I looking at" process, often followed by the "screw this" declaration, followed by a quick uninstallation and a sense of "what happened."
</QUOTE>

For this post I use the Enterprise Library 4.1 and I am going to analyze the DataAccess Application Block by selecting all dll's and .pdb files in the bin directory of the application block's source folder and dragging and dropping them onto the NDepend assembly grid (pic. 3).

Picture 3: Ndepend drag and drop assemblies
Picture 3: Ndepend drag and drop assemblies

After we dropped the grid (pic. 4) shows the assemblies that we dropped onto the grid.

Picture 4: Ndepend drag and drop assemblies
Picture 4: Ndepend drag and drop assemblies

When I click on OK, NDepend starts it's magic, after a minute Internet Explorer is loaded with a report that contains all information on the project and the NDepend start page (pic. 2) is replaced with multiple dockable windows, containing multiple windows that present information about the codebase in their own way (pic. 5).

Picture 5: Ndepend First analysis
Picture 5: Ndepend First analysis

While the analyzing takes place NDepend shows what it is doing in a for Visual Studio users very familiair way.
The Visual Studio Output Window and the error list rolled into one. It looks the same and it behaves the same. The window in picture 6 shows what NDepend is doing and what the results of it's actions are.

Picture 6: Ndepend Error list
Picture 6: Ndepend Error list

NDepend calls this the Error List (familiair?). Because of the complexity that NDepend is dealing with, I think that the familairity with Visual Studio is a good thing. If you are like me, deep inside you know that static code analysis is necessary, but it can get really overwhelming. Making NDepend familair helps getting over the initial "why do I need all this?" feeling, it does not completely remove it, but it helps. In other words: IMO this approach is good .

CLASS BROWSER
As shown in picture 5 left the 'Class Browser' window is shown, again exactly like we are used to in Visual Studio, the NDepend 'Class Browser' shows a treeview with all classes and their methods, properties, interfaces and fields (pic. 7). Not exactly the same, but close enough.


Picture 7: Ndepend class Browser

CONTEXT (sensitive)
Everything in the NDepend UI is context sensitive, by that I mean wherever you select an item in a list or in a picture the other windows of NDepend show data that is relevant to the selected item.

METRICS
This window (pic. 8) puzzled me a lot at first. what am I looking at?
It is a visual way of showing the codebase, all elements are shown as grey rectangles. which are grouped into a rectangle which is the assembly or class. all methods and members are grey rectangles inside the class rectangle. The rectangles are bigger if they contain more lines of code. You can hover over them with your mouse and information (names etc.) is shown in a context sensitive way. Again, the other windows react to these changes and show data accordingly.


Picture 8: Ndepend Metrics

DEPENDENCY GRAPH
The Dependency Graph (pic. 9) window shows an image that is a visual represantation of the code base (or selected part of the code base!).


Picture 9: Ndepend Dependency Graph

Again it is context sensitive, if you select some class or member in another window, the content of the Dependency Graph changes accordingly and when you hover over a class in the Dependency Graph, the other windows react to this change.

Picture 10: Ndepend Dependency Graph context
Picture 10: Ndepend Dependency Graph context

DEPENDENCY MATRIX
The Dependency Matrix shows the coupling of the classes in  the code base. It shows exactly how many methods and fields are used between all classes.


Picture 11: Ndepend Dependency Matrix

Picture 11 shows that 74 methods of Microsoft.Practices.EnterpriseLibrary.Data are using 71 members of Microsoft.Practices.EnterpriseLibrary.Common, so green are methods and blue are members.
By right clicking on an item in the matrix a contect menu is opened where several actions can be chosen.


Picture 12: Ndepend Dependency Matrix contect menu

CQL QUERIES WINDOW
In this window (pic. 13) the CQL Queries can be selected. When selected the query is done during the analysis. The queries are grouped. NDepend comes with a lot of pre-defined queries. They are called queries for a reason, Patrick Smacchia created his own query language called CQL (Code Query Language). With this language it is possible to query code. CQL is the heart and soul of NDepend, it makes NDepend flexible and extensible. It is possible to create your own groups and CQL queries.
It goes too far for this article to go into detail, but I think it is brilliant to use a query language to analyse code.


Picture 13: Ndepend CQL Queries window

You might think: "real nice that I can write my own queries, but such a query language must be time consuming to learn", and discard this option right away, DON'T! Patrick did not only created his own query language, he also made an editor with intellisense! And it really works, it is really easy to write your own CQL query. Give it a try and you know what I am talking about.


Picture 14: Ndepend Roll your own CQL Queries

While I was working on this article, I came to appreciate NDepend more and more. I think it is a mature and well structured tool.
The integration with NCover, Reflector, Visual Studio 2005 and 2008, CruiseControl.NET, VSTS Build Server and Nant are impressive.
It also provides the possibility to choose another code editor over Visual Studio, all these integration possibilities make it very strong, because no matter what your preference is, NDepend will work with the tools you work with. 

The UI provides all functionality needed, but I hope that in the future we get a WPF based version of NDepend. The Windows forms UI and the DevExpress dockable windows provide all functionality, but in this day and age I just expect that slick look and feel.

Because NDepend focusses on static analysis only and does this very well. The use of CQL, the query language created to query code is brilliant. Every weird aspect that you need to report over in your codebase is possible through this language and it's editor with intellisense.

The way all windows show information about the code base in their own unique but comprehensive way is exactly what you would expect from a tool like this. The way all windows react in a context sensitive way to selections or changes made in other windows, gives me the feeling that this tool is created with a professional in mind and makes it a pleasure to work with NDepend.

My thoughts exactly...
Henry Cordes

Currently rated 3.7 by 3 people

  • Currently 3.666667/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

.NET Framework version... (2)

Published 12/12/2005 by Henry in ASP.NET
Tags:

I found a tool that does all the stuff I wrote about in this article. I think this is a helpful tool even if in version 2005 of Visual Studio Microsoft added something similar. I work on a project were no Visual Studio 2005 or Framework 2.0 is available and I use the tool a lot.

Here you can find the tool I talk about http://www.denisbauer.com/NETTools/ASPNETVersionSwitcher.aspx, it is called: Version Switcher.

Henry Cordes
My thoughts exactly...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Puk

Published 7/28/2005 by Henry
Tags:
I'm proud to announce:
Saturday 23 july 2005 on 12:11 my son Puk was born.
He and his mother both are doing very well.
We are proud, tired and very happy!

Puk
PUK

Henry Cordes
My thoughts exactly...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Domain 'henrycordes.nl'!

Published 7/18/2005 by Henry
Tags:

Today the domain henrycordes.nl is officially claimed. In the next few days, this blog can be reached through:
http://blog.henrycordes.nl

noavatar

Henry Cordes
My thoughts exactly...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

New in ASP.NET 2.0: Cross-page postback

Published 7/10/2005 by Henry
Tags:

Cross-page postback is a feature that makes it possible to post values from one page to another, without Server.Transfer or other far fetched techniques. We all know that in ASP.NET 1.xx you could only post a page back to itself, which was pretty annoying.

What do we do?

The way it works is that all controls that implement the new System.Web.UI.WebControls.IButtonControl got a property called:PostBackUrl

When we have a Button on a WebForm (a Button implements IButtonControl), we set the PostBackUrl to the Webform we want to postback to.

What we get is:

postoneline 

How does it work?

When the PostBackUrl property of the 'IButtonControl' is set, the ASP.NET framework binds the corresponding HTML element to new JavaScript function named 'WebForm_DoPostBackWithOptions'. The corresponding HTML rendered by the ASP.NET 2.0 will look like this:

 

postsubmit

One problem with cross-page posting is the new page presumably needs the view state of the page posted from. The view state is page specific; it contains information, for example, about controls embedded on the particular page. ASP.NET 2.0 resolves this by embedding a hidden input field name, '__POSTBACK' . This field is embedded only when there is an 'IButtonControl' on the page and its 'PostBackUrl' property is set to a non-null value. This field contains the view state information of the poster page. To access the view state of the poster page, you can use the new PreviousPage property of the page:

 

postter

 

And with:

 

posterText2

 

We can find all controls on the posting (previous) page and read it's state.

Henry Cordes
My thoughts exactly...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5