.NET Developments - A SearchWinDevelopment.com Blog

.NET Developments:

 

A SearchWinDevelopment.com Blog


A blog on all things .NET, with news and tips about Visual Studio, ASP.NET, Visual Basic programming, C# and .NET architecture.

Report from the field: Visual Studio 2008

NOTABLE THIS WEEK - There is little question that tools these days are subject to rolling releases. Noris there much question that bosses still look for reasons to put off new migrations. Developers want to get their hands on the newest stuff so they are ready when the tools and runtimes are truly released. Managers are not always wrong in waiting until the software is more fully baked.

Well, Visual Studio 2008 went to its final debutante ball last week. The event was held in Los Angeles, and it was entitled ‘’Heroes Happen Here.'’ As Microsoft hoped, VS 2008 was rolled out along with Windows Server 2008 and SQL Server 2008 (which, admittedly, is still something of a ‘player to be named later,’ as all of its parts did not get into the box on time for the Heroes launch.)

‘’With the launch of Visual Studio 2008,'’  CEO Steve Ballmer told the Heroes crowd, ‘’you’ll see performance again ramp up dramatically as we improve compiler speeds and developer productivity really quite dramatically. Start times, load times, compile times are all quite dramatically improved with this launch of Visual Studio 2008.'’

After a long journey the tool once code-named Orca is out as Visual Studio 2008. For some of us, the move from code name to product name is anti-climactic. For many more of us, the real game is just about to begin.

To get a gauge of where things are headed, correspondent Coleen Frye spoke to Visual Studio 2008 users, and her work is on display on SearchWinDevelopment.com. In ‘’A view on VS 2008, ‘’ a development manager at a cutting-edge Internet agency tells Frye that improvements to Team Foundation Server are among the keys that led the firm to take the VS2008 plunge. So, Ballmer’s boast of load and compile time improvements may be sound.

SearchWinDevelopment.com has been following Orca elements for a while. A clear area of interest has been LINQ, which spans both VB and C#. Check out the LINQ Learning Guide to get up to speed on this new way of working with data programmatically.

A slew of Visual Studio 2008 tips and tutorials is available as well in the site’s Visual Studio 2008 Learning Guide.

Microsoft releases .NET Micro Framework Version 2.5 updates

Microsoft updated the .NET Micro Framework, releasing Version 2.5 with improvements in Web Services and TCP/IP support.

.NET Micro Framework Version 2.5 includes a Web Services on Devices implementation compatible with Windows Vista and supported by the other Microsoft Windows Embedded platforms.

With Web Services on Devices, Micro Framework devices can discover and communicate with other devices on a network without need for user configuration. While some observers initially scoffed at Web services as a ‘real-time’ embedded solution, a growing consensus hold that it is ‘real-time’ enough for a slew of solutions.
 
Also, with Version 2.5, the framework gains native TCP/IP stack support, and, let’s face it, TCP/IP is nothing short of the greatest protocol of all time.

Microsoft also said it has inked a deal with oft-time rival IBM to collaborate on a pre-installed Windows embedded-based point-of-service solution for the retail and hospitality industries.

Microsoft again vows to promote interoperability - shares new API info

Microsoft said Thursday it will provide extensive documentation for APIs covering its major software products, including Office 2007, the Windows client and server, and the .NET Framework. Much of this information had been closely held, available only along with trade secret licenses or only within the company.

The move is an apparent extension of concessions Microsoft made late last year in the face of a difficult European Union Commission antitrust case. As described by Microsoft Chief Software Architect Ray Ozzie at a press briefing, the API initiative is also a response to an industry-wide move toward software that is delivered as a Web service. Major Microsoft managers Steve Ballmer, Bob Muglia, and Brad Smith appeared at the briefing along with Ozzie.

Ozzie described the API move as a strategy shift. Software users need software and services that are “flexible enough such that any developer can use their open interfaces and data to effectively integrate applications or to compose entirely new solutions,” said Ozzie.

Microsoft’s Muglia said the company would publish the more than 30,000 pages of protocol documents created as a part of the effort to meet requirements set by the European Commission and the Department of Justice to divulge information to independent software and hardware vendors.

“In the coming months, and no later than the end of June, we will publish  the protocols in Office 2007 that are used to connect to any other  Microsoft product, including Exchange Server 2007 and SharePoint Server 2007, as well as — we will take the .NET Framework related protocols and  publish those on our Web site, on MSDN,” said Muglia.

For his part, Steve Ballmer said the company was designing new APIs for Word, Excel and PowerPoint that will allow developers to plug in additional document formats, and enable users to set those formats as their default for saving documents.

In the blogsphere, early reaction to the Microsoft announcement sometimes centered on its relation to the EC’s case against the company, and efforts by Microsoft to gain OSI acceptance for its OOXML format. In his Digital Daily Feed blog John Paczkowski notes that the European Commission seems unimpressed by Microsoft’s declaration of interoperability principles. The EC said in a statement: “This announcement does not relate to the question of whether or not Microsoft has been complying with EU antitrust rules in this area in the past.”

The intersection of patents and open software remain an issue for Microsoft to address. For its part, Linux vendor Red Hat wants more, saying that MS should make additional commitments. Editor Joseph Ottinger discusses this with the Java community at TheServerSide.com.

WCF Certificates, by example

We bought into .NET Remoting early and have quite a few products in place that exploit the .NET Remoting lifestyle. Did I say lifestyle?  Yes. It seems that, once you go remoting, you don’t want to go back — that is, until WCF came along.  It is better (and worse) than remoting.  I won’t go into any comparison here but I do want to show an example of using certificate based security to validate a client process because it is pretty cool.  I’m using my standard Dog Pound example — which, someday, may run humane societies everywhere.

The architecture looks like this:

DogPoundSystem

Both applications are WinForms apps.  The DogServer is configured as the “Host” while DogClient is, you guessed it, the client.  My requirement is to fire up DogClient and talk to the server without logging in but I want to be secure in the fact that I’m being authenticated and authorized.  We can do this with WCF using either an http connection or a tcp connection and either using a self-hosted server or utilizing IIS as the host.  My example is self-hosted because, lets face it, we want that control!

Assuming you have some kind of application architecture set up (download the code and you will) you can make a few minor changes to the config files to enable secure communication between client and host.  Our example will not use https for the transport, but, even so, each message will be encrypted using a certificate.  The first thing we need to do is create some certificates. If you have a Windows domain with a domain controller that you control, it’s fairly easy to get the certificate server service up and running on Windows Server 2003.  For the purpose of this article, we’re using the makecert utility that comes with Visual Studio. Do this:

makecert -n "CN=DogBase" -sk DogBaseKey -pe -sr localmachine -sky exchange -ss TRUST -r DogBase.cer
makecert -n "CN=DogServer" -sk DogServerKey -pe -sr localmachine -ss MY -sky exchange -ic DogBase.cer -is TRUST DogServer.cer
makecert -n "CN=DogClient" -sk DogClientKey -pe -sr localmachine -ss MY -sky exchange -ic DogBase.cer -is TRUST DogClient.cer

After you execute the third makecert statement you should see DogClient and DogServer certificates in the personal store of [Local Computer]. Use the mmc certificate snap-in to view your certificates. You may need to copy the certificate from the Enterprise Trust store to the Trusted Root Certification Authorities store before things will work for you. I’m not a certificate guru by any means and getting this little sample running in a repeatable process was not the easiest thing i’ve ever done.

We’re finally ready to test some code.  If you downloaded the code then you have everything you need to perform a test.  If not then you need to modify your configuration files to use certificates and transport security as follows:

Click here to see the client config file

Click here to see the server config file

Click here to download the sample code

Some things to note about using makecert for your certificates:  It is easy to get things set up and it provides a good learning experience for certificates but the certificates created should not be used in a production environment. There are also a few caveats. I had to configure the client and server to use PeerTrust on each other’s certificates instead of the default ChainTrust (see the config files). I believe this is partly because I’m using makecert for my certificates and partly becaues my computer is part of a windows domain. I didn’t have this trouble when using certificates issued by the certificate authority from my domain controller. For similar reasons, I had to set the negotiateServiceCredential to false and supply the service certificate in the client configuration.

In a future post I will dive into Mixed-Mode security where we use https for the transport and encrypt the messages.

Guidance Automation Toolkit for architects and teams using VS

As part of their job, software architects often try to establish best practices for developers working on a project within an organization. Recently released Guidance Automation Extensions (GAX) for Visual Studio help architects and teams achieve this goal. The extensions can be downloaded from MSDN.

Atop GAX runs the Guidance Automation Toolkit (GAT),l also downloadable. This is described as a package that enables architects to create reusable assets including Software Factories, frameworks, and patterns. The resulting templates and wizards help developers “build solutions in a way consistent with the architecture guidance,” according to posted material on the MSDN site.

Key parts of the toolkit include:

Recipes. These automate activities usually performed manually;

Actions. These are atomic units of work called in a defined sequence by recipes;

Text Template Transformation Templates. Such templates combine text and scriptlets that, when run, return a string that is directly inserted into the output stream of the template;

Type Converters that validate the value of a field and convert this from its user interface representation to a type representation; and

Visual Studio Templates.  These can be associated with recipes, are written in XML, and can be expanded by the Visual Studio template engine.

GAX and GAT must be downloaded and installed separately, notes Microsoft blogger Grigori Melnik. GAT requires that GAX is installed first.