DCSIMG
April 2008 - Posts - Guy Burstein's Blog

Guy Burstein's Blog

Developer Evangelist @ Microsoft

News

Guy Burstein The Bu

Disclaimer
Postings are provided 'As Is' with no warranties and confer no rights.

Guy Burstein LinkedIn Profile

TwitterCounter for @bursteg

April 2008 - Posts

Copy Source As Html (CopySourceAsHtml) on VPC

Copy Source As Html (CopySourceAsHtml) on VPC

Copy Source As Html CopySourceAsHtml on VPC I've been using Copy Source As Html (CopySourceAsHtml) for Visual Studio 2008 RTM for a while, but recently tried to work with it on a Virtual PC (VPC). When I tried copying a code snippet to the clipboard I ran into an exception: "Requested Clipboard operation did not succeed."

I found the code that I had to change in Mike Glaser's Blog, but to make thinks a little shorter:

1. Download this ZIP file that contains the add in.

2. Extract it to the following folders:

  • Vista:
    • C:\Users\<username>\Documents\Visual Studio 2008\Addins
  • XP:
    • C:\Documents and Settings\<username>\Application Data\Microsoft\VisualStudio\9.0\Addins
    • C:\Documents and Settings\<username>\My Documents\Visual Studio 2008\Addins

Enjoy!

Compare .Net Assemblies with Framework Design Studio

Compare .Net Assemblies with Framework Design Studio

Trying to keep up with all the Alphas, Betas and CTP's, I was looking for a tool that will help me to compare .Net assemblies so that I can easily spot what's new in each drop. Just when I didn't find a suitable tool and was about to write one for my self, I noticed Framework Design Studio, by Krzysztof Cwalina, Hongping Lim and David Fowler.

From the Framework Design Studio Home Page:

"Framework Design Studio is a set of tools for reusable library designers. The package contains a GUI tool for viewing, reviewing, and comparing versions of managed APIs. It also contains a command line tool for generating API diff reports. Simple user guide explaining the basics of the tool is included in the setup."

The rest of this post is a step by step guide on how to compare two assemblies (or two versions of the same assembly) with the Framework Design Studio.

0. Download the latest version of Framework Design Studio from MSDN Code Gallery.

1. Open the studio and start a new project.

2. In the Assembly Explorer add the newer version of the assembly.

 Compare .Net Assemblies with Framework Design Studio

3. Right click the newly added assembly and choose Select Assemblies to Compare...

Compare .Net Assemblies with Framework Design Studio 

4. After you select the older version of the assembly, switch to the Diff tab, and see the differences between the two versions:

  • Red - Removed from the new version
  • Green - Added in the new version
  • Gray - Inherited

Compare .Net Assemblies with Framework Design Studio

Very simple, very helpful!

Enjoy!

Trying out PowerCommands 1.1 for Visual Studio 2008

Trying out PowerCommands 1.1 for Visual Studio 2008

Generally, I don't like to install any Visual Studio extensions at all, but I thought I should give this one a chance. I installed PowerCommands 1.1 for Visual Studio 2008, and went to play with the new functionality. Here is what I found as the most useful:

PowerCommands Visual Studio 2008PowerCommands in Options dialog

Under Tools -> Options, you can find the PowerCommands Node, and change settings. You can set some general settings such as "Format document on save" and enable or disable any of the additional commands.

Format document on save / Remove and Sort Usings on save

What a helpful option! I turned it on immediately!

Before

After

using System;

using System.Collections.Generic;

      using System.ComponentModel;

using System.Data;

    using System.Drawing;

      using System.Linq;

        using System.Text;

using System.Windows.Forms;

namespace WindowsFormsApplication1 {

    public partial

      class Form1 : Form

  {

      public Form1()

    {

        InitializeComponent();

}

  }

}

using System.Windows.Forms;

namespace WindowsFormsApplication1

{

  public partial class Form1 : Form

  {

    public Form1()

    {

      InitializeComponent();

    }

  }

}

Collapse Projects

PowerCommands Visual Studio 2008Sometimes I still can't understand how this command never made it into the Visual Studio IDE. This command collapses a hierarchy in the solution explorer starting from the root selected node. It can be executed from three different places: solution, solution folders and project nodes respectively.

So simple, so helpful!

Undo Close Pane

Ever closed a file in Visual Studio and then had hard time to find it back? With the new Undo Close Pane, you don't have to worry any more. This pane tracks all the documents that you close, and lets you reopen then in a single click.

PowerCommands Visual Studio 2008

To reopen the last document that was closed, you can use Ctrl+Shift+Z.

Copy / Paste References

In large solutions you can find yourself adding references to a lot of projects over and over again. Now, you can select a single or a set of references, copy them to the clipboard, and then paste them to another  project.

PowerCommands Visual Studio 2008

Additionally, you can copy a project as a reference and later paste as a reference to another project. This will add a project reference to the selected project.

PowerCommands Visual Studio 2008

Other Helpful Commands

  • Clear All Panes
    This command clears all output panes. It can be executed from the button on the toolbar of the Output window.
  • Copy Path
    This command copies the full path of the currently selected item to the clipboard. It can be executed by right-clicking one of these nodes in the Solution Explorer:
    The solution node; A project node; Any project item node; Any folder.
  • Show All Files
    This command shows the hidden files in all projects displayed in the Solution Explorer when the solution node is selected.  It enhances the Show All Files button, which normally shows only the hidden files in the selected project  node.
  • Email CodeSnippet
    To email the lines of text you select in the code editor, right-click anywhere in the editor and then click Email CodeSnippet.
  • Insert Guid Attribute
    This command adds a Guid attribute to a selected class.  From the code editor, right-click anywhere within the class definition, then click Insert Guid Attribute.
  • Copy Class
    This command copies a selected class entire content to the clipboard. It can be executed from a single project item or a project item with dependent sub items.
  • Paste Class
    This command pastes a class entire content from the clipboard. It can be executed from a project or folder node.
  • Edit Project File
    This command opens the MSBuild project file for a selected project inside Visual Studio. It can be executed from a project node.
  • Open Containing Folder
    This command opens a Windows Explorer window pointing to the physical path of a selected item. It can be executed from a project item node
  • Open Command Prompt
    This command opens a Visual Studio command prompt pointing to the physical path of a selected item. It can be executed from four different places: solution, project, folder and project item nodes respectively.
  • Unload Projects
    This command unloads all projects in a solution. It can be executed from the solution node.
  • Reload Projects
    This command reloads all unloaded projects in a solution. It can be executed from the solution node.
  • Remove and Sort Usings
    This command removes and sort using statements for all classes given a project. It can be executed from a solution node or a single project node.
    Note: The Remove and Sort Usings feature is only available for C# projects since the C# editor implements this feature as a command in the C# editor (which this command calls for each .cs file in the project).
  • Extract Constant
    This command creates a constant definition statement for a selected text. It can be executed from the code window over a selected text.
  • Clear Recent File List
    This command clears the Visual Studio recent file list.
  • Clear Recent Project List
    This command clears the Visual Studio recent project list.
  • Transform Templates
    This command executes the associated custom tool with text templates items. It can be executed from a DSL project node or a folder node.
  • Close All
    This command closes all documents. It can be executed from a document tab.

Summary

The PowerCommands collection can improve the development experience and I recommend downloading and start using it. If you want to see those commands in action, you can download Deppak Kapoor's video about them.

Looking for the next drops of this collection!

Enjoy!

.NET 3.5 Enhancements Training Kit is available for Download

.NET 3.5 Enhancements Training Kit is available for Download

.NET 3.5 Enhancements Training Kit The Developer and Platform Evangelism Group in Microsoft has created a new training kit for all the enhancements for the .Net Framework 3.5:

  • ASP.NET MVC
  • ASP.NET Dynamic Data
  • ASP.NET AJAX History
  • ASP.NET Silverlight controls
  • ADO.NET Data Services
  • ADO.NET Entity Framework

Download the training kit (34.9 MB)

Enjoy!

DEV353: Data Access in Visual Studio 2008 - Slide Decks and Demos

DEV353: Data Access in Visual Studio 2008 - Slide Decks and Demos

Guy Burstein Teched Israel 2008

Earlier this week I presented at Tech Ed Israel 2008. My session title was What's new around Data Access in Visual Studio 2008, and I talked about the following topics:

I hope you enjoyed this session and filled your evaluation. I ready every single one of them and it is very important for me to know what you wrote.

You can download the slide decks and demos from my presentations page. The file also contains the DB scripts for the schemas I used during the sessions, which are required for of the demos.

Some related posts I've written in the past:

Enjoy!

Screencast - DataSets Enhancements in Visual Studio 2008 [HE]

Screencast - DataSets Enhancements in Visual Studio 2008 [HE]

We've known them for the first release of the .Net Framework, and today, there are many applications that are using DataSets. As on who has developed a few projects using DataSets I can tell that they did a really good job representing the data objects of the application, but developers had to work very hard to write additional components to deal with several limitations of the technology and designer support.

In Visual Studio 2008, things are much better...


View Video
Duration: 11:39

 

Download the screencast(WMV)

Although this screencast is in Hebrew, you can fully understand it by watching the demo.

If you are looking for additional information about using DataSets in Visual Studio 2008, you can find it in a post I've written in the past: How to: Build an N-Tier application with WCF and DataSets in Visual Studio 2008

Enjoy!

Enterprise Library 4.0 March 2008 CTP released

Enterprise Library 4.0 March 2008 CTP released

Enterprise Library 4.0 March 2008 CTP The patters & practices team has announced the release of the EntLib 4.0 March 2008 CTP. This release has been adapted to work with WMI version 2.0 and version 3.5 of the .NET Framework.

Enterprise Library 4.0 has the Allow Partially-Trusted Caller attribute (APTCA) on all assemblies. This means that you can call the methods of Enterprise Library and the application blocks from an application running in a partial trust environment. You can do this with the signed assemblies provided with Enterprise Library. There is no longer any requirement, as there was in version 3.x, to recompile the source code then either use the unsigned binaries or strong-name them yourself.

The Caching Application Block has been refactored to allow developers to replace the CacheManager class with other implementations, including the ones offered by the distributed cache solution providers. This does not affect the API of the application block.

There are also additions in functionality to the Logging Application Block, the Validation Application Block, the Exception Handling Application Block. For details see the change log on the release page.

Note: This community preview does not include the integration with Unity or the integrated Visual Studio 2008 config tool. These features are plannned for the final release.

You can find the Enterprise Library 4.0 March 2008 CTP at codeplex:

EntLib4.0 March 2008 CTP download site

Enjoy!

MSDN Pulse - ניוזלטר חדש למפתחים

MSDN Pulse

MSDN Pulse - ניוזלטר חדש למפתחים

היום בבוקר נשלח הגליון הראשון של MSDN Pulse, הניוזלטר החדש לקהילת המפתחים שישמור עליכם מעודכנים לגבי כל מה שהיה חם בחודש האחרון, ולקראת האירועים החמים של החודש הקרוב. בנוסף, אפשר לקרוא את מאמר החודש מפי טובי המומחים וטיפ חודשי שעושה את החיים יותר קלים!

אם לא קיבלתם את הגליון, תוכלו למצוא אותו כאן.

אנחנו עדיין נמצאים בתקופת ההרצה של הניוזלטר, ונשמח לשמוע כל מה שאתם חושבים על התוכן, המבנה, הצורה של הגליון וכל דבר אחר שעולה דעתכם. אז אם יש לכם משוב כלשהו, שלחו לנו אותו.

לאורך הגליון תוכלו למצוא לא מעט תוכן שנכתב ע"י מובילים מהקהילה, כמו הטיפ החודשי שנכתב ע"י שחר גבירץ, סרטונים שהוקלטו ע"י עדלי משיח וסשה גולדשטיין, מאמר החודש שנכתב ע"י ממי לביא ועוד הרבה לינקים שרבים וטובים שלחו אלינו במהלך החודש האחרון. אם גם אתם רוצים שהטיפ / מאמר / פוסט שלכם יופיע בגליון הבא, שלחו אותם אלינו.

תהנו!