“Unplugged” online talk with me this Friday

This Friday (November 19th) I’m going to be doing another online LIDNUG session.  The talk will be from 10:00am to 11:30am Pacific Time.  I do these talks a few times a year and they tend to be pretty fun.  Attendees can submit any questions they want to me, and listen to me answer them live via LiveMeeting. We usually end up having some really good discussions on a wide variety of development related topics. You can learn more and register to attend the event for free here.

Hope to get a chance to chat with some of you there!

Scott

P.S. In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu

(Not) Using Built-in Service Accounts for BizTalk Server

Recently I tried installing BizTalk Server 2010 in a pretty locked down environment – as in no accounts except a few domain accounts were given the “log on as a service” right. Thus as a first go I was left trying to use the default accounts on the machine.

These are my short summarized findings trying to run BizTalk using built-in accounts:

  • SQL Server – Can run as Local System or Network Service. NOT as Local Service.
  • SQL Server Agent – Can run as Local System or Network Service. NOT as Local Service.
  • For more SQL Server account info see this link.
  • The SSO service – can NOT run as Local Service or as Local System.

    It can run as Network Service, although there are some special requirements – namely: the SSO Administrators group must be pre-created, the Network Service account added to it and the computer restarted.

  • BizTalk Server Runtime – Can NOT run as a any form of local built-in account.
  • At this point I guess I could have gone on to try the other sub-services as well, like BRE, but why bother Lesson learned. You cannot configure BizTalk Server using only the built-in accounts. Also this link from the BizTalk documentation clearly states that these accounts are not supported, though it is non-specific.

Quoted info on what these built-in accounts mean:

Local Service Account

The Local Service account is a built-in account that has the same level of access to resources and objects as members of the Users group. This limited access helps safeguard the system if individual services or processes are compromised. Services that run as the Local Service account access network resources as a null session without credentials. Be aware that the Local Service account is not supported for the SQL Server or SQL Server Agent services. The actual name of the account is "NT AUTHORITY\LOCAL SERVICE".

Network Service Account

The Network Service account is a built-in account that has more access to resources and objects than members of the Users group. Services that run as the Network Service account access network resources by using the credentials of the computer account. The actual name of the account is "NT AUTHORITY\NETWORK SERVICE".

Local System Account

Local System is a very high-privileged built-in account. It has extensive privileges on the local system and acts as the computer on the network. The actual name of the account is "NT AUTHORITY\SYSTEM".

TechEd Europe 2010

TechEd Europe 2010

Back from TechEd in Berlin, a great week with great technology. I focused my interests around Architecture, Azure, AppFabric (hosting WF/WCF) and BizTalk, but the talks that I liked the most were in other technologies, such as PowerPivot (amazing session by Rafal Lukawiecki., where he opened an Excel file with 101 million rows while using around 200 Megs of  RAM), Umbraco (a surprisingly interesting Open Source CMS) and oData (feed-based info distribution and management). Also attended varied sessions on “LiveLabs” Pivot (now Silverlight PivotViewer)), Office 365 (very, very promising, but what about access to the beta??), Agile Project Management, HTML5, and others. And still found the time to do some Hands-On-Labs. 🙂

I did not attend TechEd last year, and this was a most refreshing return.

You can download several session videos from TechEd Online.

Share this post: email it! | bookmark it! | digg it! | reddit! | kick it! | live it!

Review: Applied Architecture Patterns on the Microsoft Platform

Review: Applied Architecture Patterns on the Microsoft Platform

  Recently the book ’Applied Architecture Patterns on the Microsoft Platform’ was released. The book is written by Richard Seroter, Stephen Thomas, Ewan Fairweather, Mike Sexton and Rama Ramani. Yossi Dahan is the technical reviewer. The book is published by Packt Publishing. Shortly before the book was released, an event was held in Stockholm, Sweden. […]

Join The BizTalker-The Newsletter of BizTalkGurus.com

It has been over a year since my list issue of The BizTalker.  With all the excitement in the air about BizTalk in the cloud and AppFabric, I figured now is a good time to bring back the newsletter.  I am planning to send out a new issue monthly with the next one in just a few days.  I am reaching out to various 3rd parties to try to get some freebies to give away for future newsletters. 

In the next issue you will have a chance to win a copy of my new book plus an exclusive discount to order it online. 

If you are not a member of The BizTalker, sign up now at: http://www.biztalkgurus.com/newsletter/index.aspx

SoCal Codecamp Jan 28 and 29

The call for sessions is now open for SoCal Codecamp IV. If you’ve never been to one, Codecamp is a great way to see sessions from the community, for free. Have an idea or a session you’d like to present? Submit it! Want to go? Visit SoCalCodeCamp.com to register.

I missed the last one, and felt guilty about it, so I just submitted the sessions below. Hope to see you there!

Windows Azure Overview

Cloud technologies are transformational, and one of those rare paradigm shifts that we don’t see often. The Windows Azure platform represents a tremendous investment by Microsoft, one that developers can benefit from today. Some of the results of those investments are live today, and you can use them to enable solutions that previously would have been impossible or prohibitively expensive to create. This session will provide an overview of Microsoft’s Windows Azure cloud platform, both the present offering as well as a roadmap of what’s ahead.


Windows Azure Architectural Patterns

Microsoft’s Windows Azure cloud platform is a full Platform-as-a-Service offering, and is much, MUCH more than “Hosting Version 2.0”. Yes, you could do things the way you always have, but as an architect or developer on the Windows Azure platform there are some exciting new architectural patterns that enable the next generation of software. As an architect evangelist on the Microsoft Azure ISV team, I see new patterns regularly. The key takeaway from this session is “question everything”, come and see why.


Windows Azure: what’s in it for an ISV?

Are you currently an Independent Software Vendor, or do you think you have an idea that could be the next Twitter or Facebook? Are you a startup, or would you like to be? As an architect evangelist on the Microsoft Azure ISV team, I get to help people and companies realize their dreams of becoming an ISV, or evolving to the cloud. In this session, we will cover the capabilities and architectural patterns that make the Windows Azure platform so attractive to ISVs, and how it enables possibilities (applications, services, business models) that could not have been done otherwise.

ASP.NET MVC 3: Server-Side Comments with Razor

ASP.NET MVC 3: Server-Side Comments with Razor

Earlier this week we shipped the ASP.NET MVC 3 Release Candidate.  It supports “go live” deployments, and includes a bunch of great improvements/enhancements on top of the features we enabled earlier with the ASP.NET MVC 3 beta and first preview releases.

This is another in a series of “mini-posts” I’m doing that talk about a few of the new ASP.NET MVC 3 Beta/RC features in more detail:

In today’s post I’m going to discuss a small, but useful, feature we’ve recently introduced: server-side comment support in Razor.

Why Server Side Comments?

Scenario: You are working within a view template, and want to temporarily disable some content or view code (potentially to help track down a problem, or to temporarily change the output of your site).

HTML supports client-side comments (<!– –>), which you can use to prevent a browser from parsing/running/displaying the HTML content within it.  The problem with using this approach for many scenarios, though, is that the content contained within the comment is still sent down from the server to the client unnecessarily – and the server-side code within the comment will still execute on the server. 

ASP.NET Web Forms supports a server-side comment syntax (<%– –%>) that you can use to completely disable content/code/controls within a page.  With server-side comments, the ASP.NET Web Forms compiler completely ignore everything within the <%– –%> blocks at parse time, and removes the content completely when assembling the page (like the contents wasn’t there at all).  You can learn more about this feature from an older blog post of mine here.

One question someone asked me earlier this week was “is there an equivalent way to do this with Razor?”.  The answer is – yes!

Server Side Comments with Razor

Razor now allows you to wrap any code/content/region of a view within a @* comment *@ syntax (which works for both C# and VB templates).  This syntax indicates that the Razor parser should ignore everything within that block and treat it like it isn’t there at all (meaning nothing is ever executed, there is no performance overhead at runtime, and nothing is sent down to the client).

For example, below I’ve wrapped some HTML content and server-code within a @* *@ block.  This is equivalent to it not being there at all:

image

Notice above how Visual Studio (starting with this week’s ASP.NET MVC 3 RC build) now colorizes comments (by default in green) to make them more visible within the editor. 

Visual Studio also now enables you to use the comment/uncomment buttons on the text editor toolbar to easily comment/un-comment a block of text/code.  For example, we could select the above @* *@ comment block within the text editor, and then click the “Uncomment” toolbar button (or better yet press Ctrl+K, Ctrl+U) to have VS uncomment the region:

image

When we do this the editor will automatically uncomment the block for us (saving us some keystrokes):

image

We could then highlight another region of text/code within the editor, and then either click the “Comment” toolbar button or press Ctrl+K, Ctrl+C to apply a server-side comment:

image

When we do this the editor will automatically comment the block for us (saving us some keystrokes):

image

Summary

Server-side comments are a small, but useful, feature that can come in handy in a variety of circumstances.  Razor now enables server-side comments at runtime, and Visual Studio provides nice tooling support for them at development time.

Hope this helps,

Scott

P.S. In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu

Simplified Asynchronous Programming Model in WCF with async/await

Managing multiple asynchronous operations in WCF is currently very complex regardless of whether you use the existing event or Begin/End asynchronous patterns. In fact, both internal and external customers frequently ask about how to implement simple coordination of WCF operations, and even though sending multiple requests to a WCF backend is a core scenario, WCF does not provide a satisfactory solution. The amount of code needed to facilitate even simple coordination tasks is large and prone to bugs, handling errors and timeouts. Yet there are some very common communication-oriented scenarios that require managing multiple outstanding asynchronous operations:

  • Execute multiple async operations in parallel and continue when they are all done, either successfully, failed, or timed out.
  • Execute sequence of asynchronous operations, stopping if one of the operations fails or times out.
  • Nest multiple asynchronous operations.
  • Combine asynchronous operations with timers for easy polling at regular intervals.

However, regardless of the current complexity, WCF developers have to use asynchronous requests to write robust implementations, and doing that today is a difficult challenge.

During PDC’10, the C# and VB languages teams released the Visual Studio Async CTP, which aims at providing a new simplified model for doing asynchronous programming in both languages. In WCF, we have decided to adopt this model because we believe it removes the barrier to writing WCF robust asynchronous application, has the least possible learning curve from the existing CLR APM pattern, and provides a simple and consistent model for coordinating, submitting and managing multiple asynchronous WCF operations.

WCF vNext will adopt the Async model in both the client and the server side, and provide new Task-based overloads for some of the most used asynchronous APIs:

Server Side

WCF service developers will be able to define asynchronous operation contracts that return Task/Task<T>:

[ServiceContract]
public interface IServiceContract
{
    [OperationContract]
    Task<string> Hello(string name);
}

As you may notice, there is no need to switch OperationContract.AsyncPattern to true anymore (yeah!), or define Begin/End methods in your service contract.

In the service contract implementation, WCF service developers will be able to implement that operation contract as an async method, and create/start new tasks, etc.:

namespace WCFServiceModelSamples
{
    public class HelloService : IServiceContract
    {
        public async Task<string> Hello(string name)
        {
            return await Task.Factory.StartNew(() => "hello " + name);
        }
    }
}

There is no need to explicitly implement any Begin/End method, IAsyncResult objects or any type of callback. Internally, WCF will add an operation invoker to the dispatcher that will be able to process Task-based operations, which will make all work transparently to the user.

Client side

The support for generating Task-based operations on the client side will be available to users who rely on proxies generated by our client generation tools (svcutil.exe or Add Service Reference), as well as to users who prefer to directly use ChannelFactory<T>.

The client proxy generation tools will generate Task-based overloads for all operations in the contract by default. This means that WCF client application developers will not need to switch any new knob in the tools to be able to use this model. But they will always be able to opt-out with the /syncOnly switch if they wish. The output of executing ’svcutil.exe /async’ will still generate Begin/End methods, as it does today. WCF users should not experience any breaking change in their code. Finally, it is worth mentioning that WCF developers will be able to generate Task-based overloads as well by using ServiceContractGenerator.

From the implementation side, the support for executing Tasks will be implemented directly in the channel, which makes the generated client proxy code look as clean as this:

public partial class HelloServiceClient : ClientBase<IServiceContract>,
                                          IServiceContract {
    public System.Threading.Tasks.Task<string> GetDataAsync(int value) {
        return base.Channel.GetDataAsync(value);
    }
    ...
} 

Finally, a code snippet for a WCF client application calling asynchronously the WCF service defined above will look like the following:

namespace MyAsyncApplication
{
    class AsyncClientApp
    {
        static void Main(string[] args)
        {
            string[] names = { "dan", "john", "tarae" };

            PrintOutNames(names)
                .ContinueWith(delegate { Console.WriteLine("Done."); });

            Console.WriteLine("Hit ENTER to exit.\n");
            Console.ReadLine();
        }

        static async Task PrintOutNames(string[] names)
        {
            foreach (string name in names)
            {
                try
                {
                    Task<string> task = new HelloServiceClient().Hello(name);
                    if (task == await Task.WhenAny(task, Task.Delay(1000)))
                    {
                        Console.WriteLine(await task);
                    }
                    else Console.WriteLine("Timed out");
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }
            }
        }
    }
}

New Task-based public APIs

Even though WCF developers will be able to add their own Task-based wrappers for existing asynchronous APIs based on the Begin/End model via Task.Factory.FromAsync, WCF will provide Task-based overloads for some of the main asynchronous public APIs. In particular, for those in the MEX and Discovery client, for consistency with the tools-generated clients:

  • System.ServiceModel.Description.MetadataExchangeClient.BeginGetMetadataAsync
  • System.ServiceModel.Discovery.AnnouncementClient.BeginAnnounceOnlineAsync
  • System.ServiceModel.Discovery.AnnouncementClient.BeginAnnounceOfflineAsync
  • System.ServiceModel.Discovery.DiscoveryClient.FindTaskAsync
  • System.ServiceModel.Discovery.DiscoveryClient.ResolveTaskAsync

 

That’s all folks! Feedback is always encouraged. Please let us know what you think about this new programming model in WCF. Welcome to the new asynchronous programming world!

Amadeo Casas Cuadrado

Program Manager, WCF

Data Driven Unit Test – Excel DSN Error

Just a little quick one for myself….

When running some data driven unit tests we were getting the below error.

Unit Test Adapter threw exception: System.Data.Odbc.OdbcException: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.

The cause of this was that we had rebuild the machines and somehow when installing office the DSN for Excel hadnt been created. On all of the other machines it had been setup fine but for some reason on my machine it hadnt been setup.

The fix was to create a DSN called Excel Files pointing to excel driversand then just rerun the unit tests.

As a reminder the test attributes for this were below:

[TestMethod][DeploymentItem(@”..\..\..\mappings.xlsx”)]

[DataSource(“System.Data.Odbc”, “Dsn=Excel Files;dbq=|DataDirectory|\\spreadsheet.xlsx”, “worksheet1$”, DataAccessMethod.Sequential)]