Welcome to MSDN Blogs Sign in | Join | Help

The Development Server is Not for Production

After creating a WCF service application in Visual Studio you might have noticed that the project configuration has three choices of web servers for testing the application:

  • Use Visual Studio Development Server
  • Use Local IIS Web Server
  • Use Custom Web Server

The development server (coming from a heritage of web server samples called Cassini) exists to make it really easy to work on your application without having a machine configured to service requests. The development server is not intended to be the actual host for your service. There’s a lot of things that the development server doesn’t try to support. By the time you want people to start using your service you should be self hosting the service or get a real server to run it in.

Posted by Nicholas Allen | 0 Comments
Filed under: ,

Binary Http Binding

Do I need IIS7 to use binary with HTTP for WCF?

No, all you need is a custom binding because we don’t include a standard binding with that configuration out of the box.

Here’s a quick example of putting binary and HTTP together with either code or configuration:

BinaryMessageEncodingBindingElement encoding = new BinaryMessageEncodingBindingElement();
HttpTransportBindingElement transport = new HttpTransportBindingElement();
Binding binding = new CustomBinding(encoding, transport);
<bindings>
<customBinding>
<binding name="BinaryHttpBinding">
<binaryMessageEncoding />
<httpTransport />
</binding>
</customBinding>
</bindings>

You could also make a subclass of Binding if you didn’t want to build a custom binding every time, but no special version of IIS is required.

Posted by Nicholas Allen | 0 Comments
Filed under: , , ,

Michele’s Norwegian Developers Conference Slides

Michele Bustamante has published the slides and demos from her talks at the recent Norwegian Developers Conference. Michele has some great variety in material covering WCF, Azure services, and security.

You can get the complete set of slides which includes:

  • A Lap Around Geneva Framework
  • Access Control Service: Federated Security in the Cloud
  • Windows Azure - Your Operating System in the Cloud
  • Building a Windows Communication Foundation Router - Today and Tomorrow
  • Choosing the Right Data Access Technology
  • Cloud Computing with Windows Azure and the Azure Services Platform

The samples and demos are available on Michele’s blog.

Posted by Nicholas Allen | 0 Comments
Filed under: , , ,

Checking for a 4.0 Framework Install

How can I tell whether a machine has the 4.0 framework installed?

Checking for the presence of the installation registry value is still a straightforward way of doing this reliably. A slight complication is that in 4.0 there has been a split into the full and client framework profiles. Installing the full profile includes a copy of the client profile but the client profile might be used and updated independently. A limited subset of WCF is available in the client profile.

The registry keys for the client and full profiles are:

Software\Microsoft\NET Framework Setup\NDP\v4\Client

Software\Microsoft\NET Framework Setup\NDP\v4\Full

If the corresponding profile is installed, then these keys will contain a value named Install set to 1.

For the historically curious, here are the corresponding registry keys to check for older versions of the framework:

Software\\Microsoft\\.NETFramework\\Policy\\v1.0

Software\\Microsoft\\NET Framework Setup\\NDP\\v1.1.4322

Software\\Microsoft\\NET Framework Setup\\NDP\\v2.0.50727

Software\\Microsoft\\NET Framework Setup\\NDP\\v3.0

Software\\Microsoft\\NET Framework Setup\\NDP\\v3.5

The name and location of the installation registry value varies from version to version a bit. However, the same test as used for 4.0 does work for 1.1, 2.0, and 3.5.

Posted by Nicholas Allen | 2 Comments
Filed under:

Via on Demand

How do I specify a delivery address for messages from a proxy that are different from the service address?

Two different addresses are sometimes both referred to as the address for sending messages. There is a logical address, called the To address, that is the address that identifies the service. There is a physical address, called the Via address, that is the address that identifies where the service is located. The two addresses can be independently specified but when there is only a single address specified it is typically understood that the two addresses are the same.

You’ll see this split of addresses continue throughout the object model from services down to channels. Thus, if you’re just constructing your own proxy objects, you could simply specify the two addresses directly.

However, in other cases you’re relying on a client description to specify the characteristics of the proxy. In that case you can use a ClientViaBehavior on the client endpoint configuration to set a target URI for the Via address. The Via address for the ClientViaBehavior is transferred to the client runtime and causes any proxy built using that client description for which a Via address is not explicitly specified to use this default value. If you don’t explicitly specify a Via and you haven’t set a default Via address, then you’ll get the To address reused for the Via.

WCF Load Test Tool 3.0 Beta

Rob Jarratt has updated the community-driven WCF load test tool with a new beta release. The test tool uses a trace captured from a previous run of a WCF service to automatically generate a test case that performs the same sequence of operations. This allows you to quickly turn a hand-crafted test into one that is reproducible.

This release adds support for testing ASMX services (where a new client proxy has been generated using WCF) as well as a variety of enhancements to support additional WCF features that the tested service can include.

Posted by Nicholas Allen | 1 Comments
Filed under: , ,

Azure Services How To

The Azure Services developer center has a video series based on “How do I?” questions about writing services using the platform. These videos cover a variety of topics for Windows, .Net, Live, and Data cloud services.

For example, here are the videos in the series on .Net services:

Most of the videos in the series are 10-15 minutes long. You can get the complete catalog of videos for Azure services on their developer center learning page.

Posted by Nicholas Allen | 1 Comments
Filed under:

June 2009 Edition of the MSDN Community CD

The MSDN Community Distribution program has put out another developer CD in their mostly-bimonthly series of training programs. The community distribution was designed to increase the availability of development resources to those in emerging countries, but anyone can download and use the content.

The June 2009 edition covers: an introduction to .Net 4.0, new features in Visual Studio 2010, ASP.NET AJAX 4.0, an introduction to SQL Server 2008 devlopment, Windows 7 user interface features, and an introduction to SQL Server Integration Services.

The last few past releases are:

March 2009: Highlights of MIX 09, Microsoft Virtual Earth Silverlight Map Control CTP, ASP.NET MVC Release Candidate 2, Microsoft ASP.NET 4.0 Data Access, Microsoft Silverlight and WPF, Microsoft ADO.NET Entity Framework, Using the Windows Azure Tools for Microsoft Visual Studio to Build Cloud Services

January 2009: Overview videos of Silverlight 2.0, Visual Studio 2008 and the .NET Framework 3.5 SP1, Windows Presentation Foundation, how to Build an Office Application with Visual Studio Tools for Office and how to Create a Dynamic Web Application with ASP.NET 3.5, Windows 7 Developer Guide v1.2, Engineering Windows 7, Internet Explorer 8 Developer Features and a case study on extending HPC capabilities

November 2008: ASP.NET 3.5, Windows 7 Developer Guide,Video Teaching on Windows Communication Foundation, Free E-book Introducing Microsoft Silverlight 2, 2007 Microsoft Office Developer Help files and Help files for Excel, Outlook, Word, PowerPoint, Publisher, Project, SharePoint Designer and Microsoft Script

Posted by Nicholas Allen | 1 Comments
Filed under:

Serialization Methods for Collections

What methods do I need to implement to have data serialized and deserialized for a collection?

Serialization considers there to be three primary types of collections: dictionary-based collections, list-based collections, and plain old collections (everything else that’s enumerable). That’s also the order in which a type is checked for collection support.

Serialization then needs to search for a way to enumerate the collection contents for serialization and a way to add items to the collections for deserialization. These are the collection’s enumerate and add methods. The enumerate and add methods are based on the primary type of the collection.

A dictionary-based collection supports enumeration through its key-value pairs and addition through a method called Add. These methods are generic when the dictionary is generic (and not when it’s not).

A list-based collection supports enumeration of its values through their direct type and again addition through a method called Add. Like dictionaries, these methods are generic when the list is generic (and not when it’s not). Although Add is defined directly on the non-generic IList, it is actually inherited from the base collection type for the generic IList. Therefore, in the generic world, basic collections can function more like lists.

A plain old collection supports enumeration of its values through their direct type (thus making IEnumerable a particularly plain collection) but somewhat lacks an equivalent to Add. In order to deserialize one of these collections you need to have defined your own Add method with the appropriate parameter type (depending on if the collection is generic or not).

Dublin Walkthrough Videos

Stephen Thomas has a two-part series of videos on Channel 9 covering an introduction to features in the Dublin application server. Dublin is a set of enhancements to Windows Server and IIS targeted at high-scale deployments of WCF and WF services.

Inside the Windows Application Server Enhancements known as Dublin: Part 1

Inside the Windows Application Server Enhancements known as Dublin: Part 2

Posted by Nicholas Allen | 0 Comments
Filed under: ,

Platform Changes in 4.0: Debugging

Another change in .Net 4.0 (together with Visual Studio 2010) is an easier debugging experience for investigating production issues in managed applications. One of the frequent challenges of investigating production issues is the need to do the investigation against an offline memory dump rather than a live process. Previously this has required learning how to use windbg or one of the managed debugging extensions such as SOS. These tools are much less friendly than Visual Studio.

For .Net 4.0 applications in Visual Studio 2010 there is additional support for managed and mixed mode debugging from a dump file. Tess Ferrandez has more details about how to use Visual Studio 2010 with dumps. There are some caveats though as heap issues and dumps from earlier framework versions aren’t helped by these new features. However, anyone without a lot of experience doing command-driven debugging will probably find using Visual Studio to be much easier than what was available before.

Posted by Nicholas Allen | 0 Comments
Filed under:

Platform Changes in 4.0: Security

The beta 1 release of .Net 4.0 has some big differences compared to previous releases for dealing with code security. If you’ve used the CAS (code access security) model then you might know it’s a fairly complicated set of policies and assertions for working out whether your program has permission to perform a particular action. In 4.0, desktop applications use a security model more similar to the simpler Silverlight model. Much of the details about the simplified security model are available on MSDN.

You can also read about how to update applications to use the new security model or switch back to the old security model on the CLR team blog.

The WCF users that will care about these changes are primarily those that were using partial trust, such as in a hosting environment.

Posted by Nicholas Allen | 0 Comments
Filed under: , ,

Managed API for Windows Features

The Windows API Code Pack put out a new update recently (version 0.90) that adds new supported APIs to the set of managed wrappers around native Windows features. The code pack is a way to provide access to Windows features that lack an existing managed interface in the framework today, primarily for things added in Windows Vista and Windows 7. For example, the code pack allows you to integrate with newer shell, dialog, power, and DirectX features.

One set of APIs that WCF developers may be interested in that are new in this release of the code pack are the Network List Manager APIs. These allow you to enumerate all of the different networks that the computer has seen, including some properties about the networks and their current connectivity status, which may be useful for applications running on multihomed machines.

Posted by Nicholas Allen | 0 Comments
Filed under: ,

Collection Name Generation

Last time we were looking at how to replace the default names used for serializing collections, such as ArrayOfKeyValueOfstringArrayOfstringty7Ep6D1, with more intelligible names. However, where did that funny looking name come from in the first place?

The generation of default names is based on straightforward substitution and appending of data contract names.

The default name of a list is ArrayOf followed by the name of the data contract that describes the list’s contents.

Similarly, the default name of a dictionary is ArrayOfKeyValue followed by the names of the data contracts that describes the dictionary’s keys and the dictionary’s values. Thus, you can think of a dictionary as being modeled as an array of entries, each entry a data contract named KeyValue followed by the names of the data contracts that describes the dictionary’s keys and the dictionary’s values. In fact, that’s exactly the name of the data contract that describes the entry.

The usual subtleties of data contract naming apply for collection names. For example, when generic parameters are used, the name is further appended with a hash based on the data contract namespace if the types involved are not primitive types. That’s where the ty7Ep6D1 comes from in this case. As another example, you have to be careful to distinguish the data contract names being used here from type names. In some cases, the data contract name and type name look the same, such as string being named string. In other cases, the data contract name and type name look quite different, such as object being named anyType.

RIA Services Roadmap

If you’ve tried out RIA Services for integrating Silverlight with multi-tier distributed applications, you might be interested in their recent roadmap update for getting to a first release.

The existing May preview and samples will be followed by a July preview that tries to shake out the remaining major changes.

The beta is at PDC this year.

The first release is in 2010 using .Net 4.0 as a prerequisite.

Dinesh Kulkarni has more details in the complete roadmap update.

More Posts Next page »
 
Page view tracker