>
 Friday, April 28, 2006

I recently updated my PhotoGallery sample code that illustrates many techniques including:

  • The use of profiles that store preferred theme and culture
  • Dynamic theme selection at runtime based on profile settings
  • The use of ASP.NET 2.0 localization features
  • Setting the request thread's culture dynamically based on profile settings
  • Database localization (table selection by culture)
  • Caching by culture and theme
  • Workaround for retrieving profile information for custom caching (GetVaryByCustomString())

The sample update is at this link: http://www.dasblonde.net/downloads/VS2005/Globalization/GalleryDemo20.zip

These features were always in the sample, but I came up with some improvements for caching and profiles, and I updated the sample so that all pages cache appropriately. I also created a full SQL script that would create the database and insert records, so that you no longer have to restore a full databas to create those records. Otherwise the sample is much the same. Enjoy!

4/28/2006 7:04 PM ASP.NET | Globalization  | Comments [2]  |  View reactions  |  Trackback
 Monday, April 10, 2006

Yet another awesome Dev Connections conference has come and gone, in Orlando last week...and if you missed out, make sure you hit the next one in Las Vegas later this year (www.devconnections.com).

For those who attended my sessions this past week, you will be looking for the code I'm sure, and here is all the magic, listed by session:

WCF Tutorial: WCFTutorialCode.zip
Designing WCF Services: DesigningWCFServices.zip 
Patterns in ClickOnce Deployments: listed here in my previous blog entry http://www.dasblonde.net/PermaLink,guid,aa492057-3a39-4ab4-87c4-5adb36d3d41f.aspx
ASP.NET 2.0 Essentials: LookandFeel.zip and GalleryDemo20.zip
ASP.NET 2.0 Security: ASPNETSandboxing20.zip

4/10/2006 4:27 PM  | Comments [28]  |  View reactions  |  Trackback
 Monday, March 20, 2006

Updated 04/09/06

See the previous few entries with code for my interoperability tutorial, and web services tutorial. Collectively they include the code for this session. Thanks!

 

UPDATED: 3/27/06

At last, here are the links to our interop code from the tutorial at SD West. For those that didn't attend, we covered the following:

Please enjoy!

 

3/20/2006 9:20 AM Indigo | Interoperability | Speaking/Events | WebLogic  | Comments [16]  |  View reactions  |  Trackback

For all those who attended my ClickOnce talks at SD West, I have posted the code to this previous blog entry: http://www.dasblonde.net/PermaLink,guid,aa492057-3a39-4ab4-87c4-5adb36d3d41f.aspx

The talks I gave where as follows:

  • ClickOnce Deployment and Versioning Practices
  • Advanced Aspects of ClickOnce Deployments
  • Data and the Smart Client

Cheers!

3/20/2006 9:12 AM ClickOnce | Speaking/Events  | Comments [0]  |  View reactions  |  Trackback

I'm posting references here to the code samples from several tutorials I just completed at SD West in Santa Clara.

  1. Introduction to Web Services (03/13/06) - Christian Gross and I once again joined forces to deliver a half-day tutorial introducing web services. Christian has posted his materials here: http://www.devspace.com/~cgross/sources/2006SDPreConJavaWS.zip and my introduction content can be found here: http://www.dasblonde.net/PermaLink,guid,c56682f0-8351-4f66-9a3a-2015d5a11a66.aspx, and the WCF content will be posted with my "Making Sense of All These Crazy Web Services Standards" post, coming shortly
  2. .NET Web Services (03/13/06) - I delivered a half-day focused 100% on .NET web services (ASMX) for the ASP.NET 2.0 platform. It included some WSE 3.0 introduction as well. The code samples for this can also be found here: http://www.dasblonde.net/PermaLink,guid,c56682f0-8351-4f66-9a3a-2015d5a11a66.aspx

Thanks very much to those that attended our tutorials...I hope you enjoyed them as much as we did :)

 

3/20/2006 8:41 AM Speaking/Events | Web Services  | Comments [2]  |  View reactions  |  Trackback

Here are some ASP.NET 2.0 samples focusing on the fundamentals of ASMX services. Inside the zip you'll find samples for the following:

  • Basics
  • Encoding
  • Serialization
  • IXmlSerializable
  • Faults
  • Headers
  • Session state
  • Asynchronous proxies
  • WSE 3.0 simple example

Cheers!

WebServicesSamples.zip (425.52 KB)
3/20/2006 8:28 AM Web Services  | Comments [6]  |  View reactions  |  Trackback

I have zipped up a collection of ClickOnce samples for your enjoyment. You may find a few of these samples interesting since they touch on some of the practical uses for ClickOnce. Here's the overview of the individual samples you'll find in the zip:

  • ClickOnceContext - shows you how to detect a ClickOnce application from one that is not, along with other important states such as IsNetworkDeployed, etc.
  • ClickOnceFirstRun - includes a utility for detecting first run ever versus first run since last update
  • ClickOnceDataFiles - using the data directory for local user storage
  • ClickOnceIsolatedStorage - using isolated storage for local user storage
  • ClickOnceDeployGAC - shows you how to use a custom setup project (MSI) that deploys a GAC dependency for a ClickOnce application, as a bootstrapped MSI
  • ClickOnceOnlineDetection - includes a utility for detecting when the application is deployed remotely, running as clickonce, and online
  • ClickOnceMsmq - a WCF service with netMsmqBinding provides a reliable message queue to send transactions to a service even if the client is offline
  • ClickOnceOnlineService - illustrates a factory pattern to use a WCF service used for connected clients, local data directory used for offline clients
  • ClickOnceUtils - utilities used for several of these samples
  • LocalizedFileGroups - sample illustrates a globalized application that uses download file groups to initiate download of required files in demand
  • ManualCheckForUpdates - illustrates manually detecting updates

I have another sample for deploying a database script, that I am adding some things to for an upcoming conference, and will post here when I have completed the changes.

Enjoy!

ClickOnceSamples.zip (1.41 MB)
3/20/2006 8:10 AM ClickOnce  | Comments [2]  |  View reactions  |  Trackback
 Wednesday, March 08, 2006

A few people asked me for this, so here you go! Feburary CTP links, and order of installation are:

3/8/2006 6:34 AM Indigo  | Comments [3]  |  View reactions  |  Trackback
 Sunday, February 19, 2006

After rebuilding my machine a few weeks ago, once again I find myself running into old problems and trying to remember how to repair them. This time, generating keys to strongly name my asesmblies through the Signing tab in Visual Studio 2005. I thought I would share it this time in case others have seen this problem...and struggled with it...

The Scenario:

For a Windows client application, open the Properties for the project, navigate to the Signing tab, check Sign the assembly and create a new key. In the Create Strong Name Key dialog, provide a new key name, provide a password, and click "OK".

The Problem:

An error message is presented: Create strong name key the operation could not be completed. Access is denied.

The problem repeats itself when I tried to use the strong name utility (sn.exe), with this error: Failed to generate strong name key pair. Access is denied.

The Solution:

I had to give my user account access to the key container in C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys. It turns out, even administrator rights were disabled on my machine! I am not sure if this was the default installation (I rebuilt the machine a few weeks ago) or if this is modified when I install WinFX, or if when I granted ASP.NET and NETWORK SERVICE access it somehow lost the inherited permissions that were granted when I installed the OS. In any case, at least it seems predictable, you need access to the key store in order to generate keys, makes sense!

How does it work?

Each container created using sn.exe -i is located in the MachineKeys directory (unless you specify elsewhere). The default key container that is used by sn.exe is also in that location.

In the event you reset your key container to a new one, and forget where it is...you can reset the key container for the strong name utility using sn.exe -c. So, if the account access fix doesn't work, you may be using an alternate key store so a reset may be in order.

I googled this topic a bit before writing this blog, and was surprised that very little has been written on this subject for a solution...furthermore...many people actually rebuilt their machines to solve the problem!!!! I hope this blog entry prevents a few more of those!!!

2/19/2006 7:45 PM .NET | ClickOnce  | Comments [13]  |  View reactions  |  Trackback
 Monday, February 13, 2006

Do you remember Killola - our awesome Code Camp band that volunteered their time to rock our socks off???

Well, they have a new video that is in progress…and sneak preview of which is exclusively available through Spread Radio Live! This is part of a special contest and Killola is right now hair to hair with a band from Italy…so they need our help. You can click this link and vote for them and then watch their video!!! It takes just 3 seconds:

  1. Go to Dave Navarro’s Indie Band Spotlight: http://www.spreadradiolive.com/indiebands.php
  2. Click on Killola to vote for them (support our Code Camp band!!!!), click Vote.
  3. Click the Killola link again after you vote, to see their video (work in progress)!!!

Let's show them our geek love for the indie band :)

 

2/13/2006 2:43 AM Music  | Comments [14]  |  View reactions  |  Trackback
 Wednesday, February 01, 2006

I blog when I have time and have something important to share, but I don't always have time to blog everything important I have to share (that's what articles and books are for I guess)...sometimes I blog just to hook you up to content references for events I've been part of...but today...I'm just blogging to vent my frustration with code snippet management in Visual Studio 2005. Aaarrrrghhhh...

Don't get me wrong, code snippets rock for productivity, but creating your own and getting them to freaking appear in the right place seems like a feat of great energy and time that I really do not have...sigh...but I took the time anyways because I figure if I just spend 2 hours (or 7200 seconds) now to get it working, then spend and extra 5 minutes (or 300 seconds) creating snippets for my repeatable code...it will pay off after I use about 200 snippets. Assuming I use about 3 code snippets per code sample, and that I create several code samples per day for my WCF book, not to mention other code samples and vertical slices for clients...I should be able to recover this time about 20 days time or less. Of course, I'm not factoring in time to write this blog...

So here goes my experience creating code snippets:

Creating new XML config snippets, no problem at all. Just copied an existing code snippet sample and away we go! Off to a good start.

Adding the code snippet to the Code Snippet Manager. Well first of all, figuring out what Add... versus Import... mean in that dialog is a pain. No, I didn't take the time to read an article about it...and frankly I expected it to be pretty easy to figure out. Well it seemed like sometimes Add worked, sometimes it didn't, but I seem to have finally figured out that you are supposed to select a directory that holds the code snippet type for the language you are adding folders to.

So, I created a WCFSnippets folder with two subdirectories:

\WCFCode -> holds my C# WCF code snippets

\WCFConfig -> holds my XML WCF code snippets for configuration

Then, from the code snippet manager, you select XML for the language and click Add. What you are supposed to do is find the folder with your XML snippets, so I navigate to \WCFConfig...but don't just navigate to that directory, drill all the way into the directory where the snippets are stored before you select the directory. Here are the screenshots: wrong, right and result...respectively.

For C# or VB.NET snippets, just select the right language, and drill into the directory where those are located.

Extra crap in my code snippets intellisense...make no "sense". I know the above seems really super easy...and it is once you know where to navigate and how to organize your stuff. Still, I had all kinds of extra crap left over in my snippet manager, and in my code snippet intellisense...let me explain.

After trying Add/Import, I was left with extra folders in my code snippet manager, that somehow didn't reflect all the snippets I was creating...it was nuts...I was going nuts...maybe I am nuts...anyways it turns out that Import is not really necessary if you have added your snippets folder according to the Add method I explained. Any new snippets you create in those custom folders will now appear in the magical snippets list. But, if you want to copy (import) a snippet from somewhere and put it into one of your folders (or, one of the predefined snippet folders for VS) you can Import.

If I navigate to my WCF configuration snippets folder and select a snippet, I will be presented with the already existing XML folders (preexisting or resulting from Add). You decide where you want the snippet to go and a copy is made there. Watch out for dupes!

The bugger of it is, you can't remove snippets. You can add them, but they will never go away...that is unless you delete the actual snippet from the file folder. So much for snippet management. You can remove folders, just not those living in the VS snippet folder, that's too official to remove...

Things to watch out for.

1. Beware not to add your snippet directories more than once. Or not to add the parent directory, only to decide on the child directory as in my WCFSnippets and WCFConfiguration example earlier. What happens? Well, somewhere out in snippet configuration land (a lost land that I cannot find) there is memory of every (wrong) directory you ever added using Add...and you can't freaking get rid of it. Well...I'm sure you can, but I care not spend more time to figure out why...perhaps someone else can tell me!!!

2. Make sure you put the correct language in your snippet code. If you call it XML but it's really C# (spelled csharp in snippet terms) you won't see it appear in your C# snippets after all...another ghost I chased...for a short while.

Sample snippet...for your time...more to come :)

<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippet Format="1.0.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<Header>
<Title>system.serviceModel.diagnostics</Title>
<Author>Michele Leroux Bustamante</Author>
<Shortcut>serviceModel.diagnostics</Shortcut>
<Description>Sample system.serviceModel.diagnostics section.</Description>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>perfCounters</ID>
<Default>true</Default>
<ToolTip>Enable performance counters: true|false</ToolTip>
</Literal>
<Literal>
<ID>wmiProvider</ID>
<Default>true</Default>
<ToolTip>Enable WMI provider: true|false</ToolTip>
</Literal>
<Literal>
<ID>logEntire</ID>
<Default>false</Default>
<ToolTip>Log entire message content (beware! production performance hit): true|false</ToolTip>
</Literal>
<Literal>
<ID>logMalformed</ID>
<Default>true</Default>
<ToolTip>Log malformed messages (or, provide your own logging mechanism, don't do both!): true|false</ToolTip>
</Literal>
<Literal>
<ID>logServiceLevel</ID>
<Default>false</Default>
<ToolTip>Log messages at service level: true|false</ToolTip>
</Literal>
<Literal>
<ID>logTransportLevel</ID>
<Default>true</Default>
<ToolTip>Log messages at transport level: true|false</ToolTip>
</Literal>
<Literal>
<ID>maxLog</ID>
<Default>100000</Default>
<ToolTip>Maximum message log count (runs out fast, must backup the file!)</ToolTip>
</Literal>
</Declarations>
<Code Language="XML" Format="CData">
<![CDATA[ <diagnostics performanceCountersEnabled="$perfCounters$" wmiProviderEnabled="$wmiProvider$" >
         <messageLogging logEntireMessage="$logEntire$" logMalformedMessages="$logMalformed$" logMessagesAtServiceLevel="$logServiceLevel$" logMessagesAtTransportLevel="$logTransportLevel$" maxMessagesToLog="$maxLog$" />
     </diagnostics>]]>
</Code>
</Snippet>
</CodeSnippet>

 

2/1/2006 9:05 PM Indigo | Visual Studio  | Comments [14]  |  View reactions  |  Trackback
 Tuesday, January 31, 2006

Ok folks...here's a sample (er full blown wicked application) that makes all my 6 project WCF samples that include security, transactions, reliable messaging, MTOM file uploads and more...look like Hello World...

Clemens Vasters, founder of Newtelligence, leader of the community project dasBlog (my blog engine), well known blogger/speaker/writer/thought leader, and a person I am proud to call my friend...has really done it this time.

Newtellivision, get it here (he's popular, hence the site might be slightly slow)...

http://www.newtellivision.tv/2006/01/30/GoingOutAndInWithABangNewtellivision.aspx

 

1/31/2006 4:59 PM Indigo  | Comments [8]  |  View reactions  |  Trackback
    ON THIS PAGE
    SEARCH
    CATEGORIES
    ARCHIVES
    BLOGROLL

Designed by NUKEATION STUDIOS