# Sunday, April 13, 2008

I have been meaning to post an update on the book, but with the new job and move to Illinois it's been difficult to find the time.  Since Max mentioned on his blog that the Professional Commerce Server book to be published by Wiley (aka Wrox) has been canceled, I think it's appropriate for me to take the time and add a few details.

Fundamentally, the book was canceled because it was not completed in the allotted timeframe (nor the extended timeframe).  Throughout the process we were extremely committed to producing a high quality programming reference.  Writing a professional-level book of this kind—especially for a product as vast and powerful as Commerce Server—takes a significant amount of time and sacrifice.  I personally spent most of my evenings and weekends over the last year holed up in my office, working on the book; I know that the other authors similarly sacrificed a lot of their time.  Nevertheless, the book continued to fall behind schedule until it was canceled.  Wiley was very understanding and supportive throughout the entire process, but in the end things ultimately did not work out.  (I would personally like it to be noted that I do not begrudge Wiley at all.  Everyone I worked with at Wiley was extremely committed to seeing this book published, and I know that they were all disappointed with its cancellation.)

A big apology to all of you that have been excited about the book and awaiting it's release.  As I mentioned, a lot of time and effort has been put into this book, and that Wrox will not publish it is definitely a disappointment.

Having said all this, I have a question for you: what should I do with all the content written for this book?

As Max alluded to on his blog, I plan on making the content produced for this book available one way or another—right now I'm trying to figure out the best way to do this!  Currently I have around 800 pages and 24 chapters of content in various stages of completion.

Given that I know that there's been considerable interest in the community to have this book (and that I don't want to see all the hard work put into it wasted) I can think of a lot of things I can do with the content.  At the moment, though, I prefer the following two options:

  1. Find a new publisher to publish the book.  This would give the community the traditional book, but it would also probably be at least another six or seven months before anything is available.  The scope of the book would obviously have to change, given that we're sure to see a lot of updates regarding product roadmap.
  2. Self-publish the book.  This would give me a lot of freedom with regards to the publishing of the book, and means I could probably start making content available very soon.

I'm leaning towards the latter of the two choices, although I know very little about self publishing books.  If you have any comments or thoughts on this, please feel free to let me know either through comments on the blog or via e-mail (blog@wadewegner.com).

Rest assured that somehow I will make this content available!  Stay tuned for further details, hopefully to come in the next week or so.  Thanks for your support!

posted on Sunday, April 13, 2008 4:52:38 PM (Central Standard Time, UTC-06:00)  #    Comments [8] Trackback
# Sunday, November 25, 2007

There has been some excellent activity by some heavy-weights in the Commerce Server world.  Sadly, I haven't been contributing very much on my blog, as I am desperately trying to complete my book.

It started with Søren Spelling Lund's two-part series (and maybe more?) on what it's like developing with Commerce Server 2007.

In this post, Søren highlights the high-level of security that has gone into Commerce Server 2007, calling it "both a blessing and a curse."  He attributes this to the flexibility and granularity of the security system, in addition to the complexity that comes with it.  Commerce Server 2007 makes use of the Windows Authorization Manager for security.  See the following links for more information: Developing Applications Using Windows Authorization Manager, and Managing Authorization Policies.

Søren also highlights the Distributed Transaction Manager and use of MSDTC and System.Transaction in the .NET Framework 2.0.

Søren discusses three different data access systems for Commerce Server 2007, based on the subsystem with which you're working (i.e. the Profile system, the Catalog system, and the Order system).  Take a look at his post for the specifics.  I would also suggest you take a look at MSDN for some additional information on developing with Commerce Server 2007.

Not to be out-done by Søren, Max Akbar took some time out of his busy schedule to post a great article on caching and Commerce Server 2007.

Max highlights a number of important topics, including: the Catalog cache, Web.Config settings, refreshing the cache, the cache size, the cache location, how to use your own caching.

As always, Max's post is a great blend of information and code snippets.

Last, but certainly not least, Tom Schultz contributed to the discussion of caching by highlighting a mixed-authentication solution for the SiteCacheRefresh HTTP handler.

Tom shows how the SiteCacheRefresh HTTP handler provides Commerce Server with caching capabilities.  He goes beyond this, however, when he points out that by default the ASP.NET site uses forms authentication.  Since the web site can support either forms or windows authentication, a mixed authentication model is required.  Tom shows you how to construct this by taking aspects of the Starter Site

All in all, great stuff!

posted on Sunday, November 25, 2007 2:50:31 PM (Central Standard Time, UTC-06:00)  #    Comments [0] Trackback
# Saturday, October 06, 2007

Note: For those of you that want to skip the explanation, and simply get a converted management pack for Commerce Server 2007, scroll down to download a MOM 2005 pack converted for OpsMgr 2007 for Commerce Server 2007.

I previously blogged about Commerce Server 2007 and Operational Monitoring, and indicated that there is no native OpsMgr 2007 pack for Commerce Server 2007 (although there will be one some day).  For now, we have to convert the MOM 2005 pack.  Fortunately, this is a pretty straightforward process, although there is the potential for things to to fail (learn from my experience!).

In order to convert management packs from MOM 2005 to OpsMgr 2007, you must have the following installed on your server:

  • Operations Manager 2007 (hopefully this is obvious)
  • The MOM 2005 User Interfaces (found on your MOM 2005 disk)
  • The MOM 2005 to OpsMgr 2007 Migration tool (found on your OpsMgr 2007 disk)

Now, before you go and start installing all these bits, let me share my experience.  You should install the MOM 2005 User Interfaces first, followed by Operations Manager 2007, and lastly the MOM 2005 to OpsMgr 2007 Migration tool.  Here's why -- when I originally attempted to convert convert the 2005 pack I started by installing OpsMgr first and then tried to install the migration tool.  The installer told me that in order to install the migration tool I first needed the MOM 2005 UI.  Fair enough, I thought, so I went to install the UI tool.  However, every time the installer went to "Check Prerequisites" I got the following error:

Please verify that the CD or network share is available. 

No matter what I did, I got this error (although this error never occurred on any other machine that didn't have OpsMgr 2007 installed).  I couldn't find any information on this error (evidently I'm the only person to experience this problem), but I think it's some kind of installation failure because OpsMgr 2007 was already installed.  I went to test this theory by trying to uninstall OpsMgr 2007, but then I got a "Fatal error during installation" error when trying to uninstall.  Ugly!

Fortunately, this was a virtual machine so I scrapped it and started over.  This time I installed the bits in the following order:

  1. The MOM 2005 User Interfaces
  2. Operations Manager 2007
  3. The MOM 2005 to OpsMgr 2007 Migration tool

This worked perfectly for me, and I never experience the above error.

Once everything is installed, you can begin the conversion process.  Open Start --> All Programs --> System Center Operations Manager 2007 --> Migration Tool.  The migration tool is a wizard that will walk you through the process, and is very easy.  Simply point to the extracted 2005 management pack file (which you can download here) and either migrate it directly to your OpsMgr group or to a file.

If you have chosen to migrate it to file (like I did), you must then import it into OgsMgr 2007.  Open Start --> All Programs --> System Center Operations Manager 2007 --> Operations Console, choose the Administration tab, right-click Device Management, select Import Management Packs, and point to your converted MOM pack.  It's as easy as that!

Now when you go to the Monitoring tab, you'll see the following:

Commerce Server 2007 Monitoring

All you need to do now is provision the agents on your Commerce Server 2007 machine, and away you go!  Very simple, and very useful.

I hope this helps!

Microsoft_Commerce_Server_2007.XML (2.18 MB)
posted on Saturday, October 06, 2007 3:55:00 PM (Central Standard Time, UTC-06:00)  #    Comments [0] Trackback
# Sunday, September 16, 2007

Operational monitoring (OM) is a practice that is sorely underused, in my opinion.  OM is a performance and event monitoring practice that allows you to respond to errors and gain insight into machines on your network.  Microsoft has two flagship products for operational monitoring: Microsoft Operations Manager (MOM) 2005 and System Center Operations Manager (SCOM) 2007.  Through MOM and SCOM you can monitor your Microsoft server products, such as SQL Server, Web Sites, and even Commerce Server 2007.

There are a number of benefits to using OM, including:

  • Receive notification of critical errors and warnings
  • Automatically respond to errors and warnings
  • Gain insight into performance and trends to preempt future problems

Both MOM and SCOM use an agent (a piece of software installed on the monitored machine) to track the performance and events on monitored machines.  The agent watches a number of different sources on the computer, such as the Event Log, and then centralizes this information on the OM server where it is stored in a database.  The OM server applies filters and rules, and will notify individuals and/or groups if necessary.  Additionally, they can respond to events by running scripts or executables on the monitored machine.

While you can define your own events and thresholds to monitor your machines, you can also take advantage of pre-built management packs.  These management packs are designed by the corresponding product team (e.g. the Commerce Server 2007 MOM pack is designed by the Commerce Server team) so that the monitored events and defined thresholds are most appropriate for the product.

Installing MOM 2005

The process for installing MOM 2005 with Service Pack 1 is pretty straightforward (especially if you're installing it on one machine).  Take a look at the following documentation for detailed steps:

http://www.microsoft.com/technet/prodtechnol/mom/mom2005/Library/b7b0c768-64d1-486e-b9ed-7292c9e545f9.mspx?mfr=true

There are four steps involved in installing MOM 2005:

  1. Installing SQL Server and MOM 2005
  2. Discovering computers and deploying agents
  3. Install MOM 2005 reporting (optional)
  4. Import management packs

I suggest that, before you install MOM 2005, you take advantage of the "Check Prerequisites" tool to make sure that you've properly configured your server.

Check Prerequisites for MOM 2005 

If you have problems installing agents on step two, take a look at the following KB article: ttp://support.microsoft.com/kb/883335/en-us.  Turns out I had a DNS issue on one of the machines I wanted push an agent onto; after resolving the DNS issue I had no problems.

Once you have successfully installed and configured MOM 2005 (steps 1 through 3) you are ready to import various management packs.

Configuring the MOM Pack for Commerce Server 2007

You must first download the MOM 2005 pack for Commerce Server 2007.  When you run the executable you must specify the location to place the files.

Commerce Server 2007 MOM Pack 2005

I suggest you use the default location for management packs: C:\Program Files\Microsoft Operations Manager 2005\Management Packs\.  This way, when you run the import from the MOM 2005 Administrator Console, you won't have to change the default location.

To import the management pack you must do the following:

  1. Open the MOM 2005 Administrator Console
  2. Browse to Microsoft Operations Manager (<Computer Name>) --> Management Packs
  3. Right-click Management Packs and select Import/Export Management Pack.
  4. Choose the Import a management pack, and click Next.
  5. Lave the default location for the management packs, which is where you installed the Commerce Server 2007 MOM Pack.  Click Next to continue.
    Management Pack Import/Export Wizard
  6. Select the Microsoft Commerce Server 2007.akm management pack to import.  Click Next to continue.Management Pack Import/Export Wizard
  7. On the summary page, click Finish.

Once you have installed the management pack you must then specify your Commerce Server 2007 servers.  To do this, you must do the following.

  1. Open the MOM 2005 Administrator Console
  2. Browse to Microsoft Operations Manager (<Computer Name>) --> Management Packs --> Computer Groups --> Microsoft Commerce Server 2007.
  3. Right-click Microsoft Commerce Server 2007 and choose click Properties.
  4. Select the Included Computers tab and click Add.
  5. Select the Commerce Server computers you wish to monitor, and click OK.

Now your Commerce Server 2007 servers are being monitored by MOM 2005.

I would say that the "out-of-the-box" settings for the MOM pack are okay about 90% of the time.  The key is to get a baseline for your environments and potentially fine tune the settings based on your findings.

SCOM 2007 and the 2005 MOM Pack

According to the CS product team there is no native SCOM 2007 pack planned at this time.  However, the MOM 2005 pack is supposed to work with SCOM 2007.  While I haven't tried this myself, I've been told by multiple sources that it should work and that this is the supported model.

If I get the opportunity to test this I'll be sure to update this post.

Additional Resources

In addition to the Commerce Server 2007 MOM Pack you may also want to use the following MOM packs:

While the Commerce Server 2007 MOM Pack tracks the health of your Commerce Server environment, it doesn't really monitor the health of your Web Site (i.e. IIS).  Additionally, there are events and thresholds in the SQL Server pack that are also worthwhile.

At the very least, make sure you review the following white paper: Microsoft Commerce Server 2007 MOM Pack White Paper.

Also, here are some good blogs/sites to track:

MOM 2005 and SCOM 2007 are great resources and you should definitely take the time to learn more about them.

I hope this helps!

posted on Sunday, September 16, 2007 5:50:41 PM (Central Standard Time, UTC-06:00)  #    Comments [0] Trackback
# Friday, September 14, 2007

04/13/2008 - Please see this post for information regarding this book.

Microsoft Commerce ServerIt has been awhile since I last posted about the status of the book Professional Commerce Server 2007, so I thought I'd share some news and exciting developments.

First of all, I am very happy to announce that Tom Schultz has agreed to participate in writing the book and will author a number of chapters.  Tom is a senior consultant with the Microsoft Consulting Services (MCS), and is particularly focused on e-commerce and the Commerce Server product.  Tom's extensive real world knowledge and expertise will bring tremendous value to this book, and I am really excited to work with him.

The book is on schedule and still targeted to hit the shelves in Q1, 2008.

Here is the table of contents for the book.  At this point there really won't be any major changes:

Part I: Getting Started

1    Technology Primer
2    First Steps
3    The Commerce Server Architecture

Part II - Commerce Server Overview

4    The Catalog System
5    The Inventory System
6    The Orders System
7    The Profiles System
8    The Marketing System
9    The Commerce Server Adapters for BizTalk Server 2006
10    Commerce Server Staging
11    The Data Warehouse Analytics System
12    The Business Processing Pipeline System

Part III: Developing with Commerce Server

13    Commerce Server 2007 Development
14    Developing with the Catalog System
15    Developing with the Inventory System
16    Developing with the Orders System
17    Developing with the Profile System
18    Developing with the Marketing System
19    Customizing the Business Management Applications
20    Modifying and Extending the Data Warehouse
21    Building and Customizing SQL Reporting Services
22    Advanced Topics with the Commerce Server Adapters
23    Operational Monitoring

Part IV: Commerce Server in Production

24    Production Architectures
25    Building Your Production Environments
26    Deploying Commerce Server

Appendix

A    APIs
B    FAQ and Answers
C    Tips and Tricks

Tom and I will continue to work diligently on finalizing the content of the book.  Our goal is to provide our peers (i.e. you!) with the knowledge required to successfully architect, implement, deploy, and support enterprise solutions using Commerce Server 2007.

posted on Friday, September 14, 2007 1:10:21 PM (Central Standard Time, UTC-06:00)  #    Comments [5] Trackback
# Saturday, August 11, 2007

Commerce Server 2007 I often get asked about how development environments should be configured and what practices should be implemented when building a Commerce Server 2007 solution.  I have found this to be a difficult question to answer, as everyone has their own preferences and "best-practices" when it comes to development environments.  Additionally, we are often constrained by the following variables:

  • Relative importance placed on time, cost, and quality
  • Available development and QA skills
  • Software development methodology
  • Scope and function of the application

Over my career I've come up with a number of things I try to have when building a Commerce Server solution (or any enterprise-level application).

Development Environments

I believe that developers need a place to integrate their code, QA and UAT require a sandbox independent of development, that you must have a staging environment to prepare your data for production, and that production should be completely isolated from your other environments.

While I don't always get my way, I try to always have the following environments defined (in addition to production, of course):

  • Development (each developer has their own local development environment)
  • Development integration
  • Quality Assurance (QA) / User Acceptance Testing (UAT)
  • Staging

The lack of even one of these environments puts everything at risk.  For example, if you do not have a development integration environment you'll find that most of the defects QA discovers will relate to simple integration, and that they will be challenged in performing functional testing of your application.  Similarly, if your development and QA environments share resources (such as databases, etc), you'll constantly trip over yourself and find it very difficult to make forward progress.

Note that I make the assumption you will have a separate QA team and initiative.  Ignore this at your own risk!  Never trust developers to QA their own code.  I'm a developer myself, and while I always strive for perfection I have always been more successful when working with a good QA team.

Many of these environments can be virtualized.  There's nothing wrong with having your development integration and QA/UAT environments running on VMWare or Virtual Server (sometimes it's nice, as you can blow it away and revert to an earlier image).

Development Practices and Techniques

A well-architected and designed development environment is useless if you implement sloppy development practices.  It's not enough to isolate your environments - you have to put techniques and practices in place to effectively use them.

In addition to demanding these environments, I always require the following practices and techniques:

  • Source control and versioning
  • Continuous integration
  • Commerce Server Staging (CSS) and build automation
  • Unit testing & test-driven development (TDD)

It's absolutely imperative that you have a source control solution.  Without it you run so many risks that I can't even begin to describe the pains you will feel later on.  It doesn't really matter which source control solution you use, so long as it is stable, reliable, and you back it up!  Don't neglect to backup your source control databases.

Continuous integration (CI) is a practice whereby a development team frequently integrates their work (e.g. source code).  CI should be automated so that it runs regularly.  The whole point is that this automated process can find integration errors very quickly so that it reduces the pains you will feel down the road.  There's nothing worse than having your developers work in isolated environments for a significant period of time only to discover that the their code won't compile once integrated.

Commerce Server Staging (CSS) is the best and preferred way to migrate your web application and business data between environments.  You can setup the CSS services on your Commerce Server machines (not in production, mind you) so that you can deploy your code changes and business data from environment to environment.  It is useful to have a specific staging environment that is identical (or as close as possible) to production, so that your business users can manipulate the data in the staging environment rather than run the risk of screwing up production because they're playing with the data.

I firmly believe in unit testing and test-driven development (TDD).  TDD is a technique in which test cases are written and then code is subsequently written that can pass the test.  Unit tests are written for each aspect of the code and then automated so that you can get quick and effective feedback to confirm that your software is well-written.  While this technique requires discipline and (for some developers) unlearning certain habits, it is a powerful way of writing enterprise-level applications better and faster.

Conclusion

It's no easy or simple task to setup a development environment for a Commerce Server 2007 solution (or any enterprise-level application for that matter).  However, if you spend the time and energy up front to establish a good development environment, you will reap the rewards later on.

A very powerful message was driven into me at one of the first IT shops I worked for: design excellence, and rigorous attention to detail (thanks, RGI).  While I consider it criminal for developers to not religiously adhere to this creed, we are all human and often err or stray from the path.  Putting together a solid development environment and implementing good software techniques and practices can help save us from ourselves.

I would very much like to hear about everyone else's experiences with Commerce Server development environments (or any development environment).  What have you found to be successful?  Please leave a message!

posted on Saturday, August 11, 2007 10:19:16 AM (Central Standard Time, UTC-06:00)  #    Comments [2] Trackback
# Saturday, July 28, 2007

I encountered an error today while setting up a project within the Commerce Server Staging.  I haven't encountered it before, which leads me to believe that I must have done something abnormal on my development virtual machine.

Commerce Server Staging (CSS) is a service that allows you to synchronize content and data between many separate environments. Utilizing CSS, you can reliably update both Web content and business data from the source to one or more destinations.

Using the CSS MMC, I created a simple project that stages my StarterSite content from my local directory (e.g. C:\Inetpub\wwwroot\StarterSite) to a temporary folder (e.g. C:\Temp\Destination).  It was meant to be the start of a proof-of-concept for a more complex network topology.  However, I almost immediately received an error when I attempted to start replication:

CSS: Unspecified Error

I just love errors like this!  Gives me something to research and figure out ...

Fortunately, more valuable information was added to the application log:

Event Type:    Error
Event Source:    Commerce Server Staging
Event Category:    None
Event ID:    61208
Computer:    CS2007
Description:
Error occurred with the database StagingLog.mdb.  Error is: System.Data.OleDb.OleDbException: Operation must use an updateable query.
   at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)
   at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
   at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
   at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
   at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
   at Microsoft.CommerceServer.Staging.Internal.ProjectDeploymentLog.ModifyLog(String projectName, String status).

While this isn't the most explicit error, it provided enough information to track down the problem.

You might be surprised to see that this error refers to an Access database.  CSS makes use of Access database files to store events and information it audits during the staging process.  Specifically, there are these two Access database files:

  • StagingLog.mdb
    • Found here: C:\Program Files\Microsoft Commerce Server 2007\Staging\Data
    • Stores internal replication information used by CSS
  • events.mdb
    • Found here: C:\Program Files\Microsoft Commerce Server 2007\Staging\Events
    • Stores staging information that is made available to reports

Searching on the keywords "mdb operation must use an updateable query" led me to KB article 175168.  This article indicated that the problem is most likely caused by a user not having the proper permissions to open the StagingLog.mdb file.

In comes File Monitor (aka FileMon), by SysInternals, to the rescue.  Seriously folks, save yourself the agony and get to know the tools available from Microsoft and SysInternals.

I was able to capture the following "Access Denied" message via File Monitor:

image

Solution: Turns out that the NT AUTHORITY\NETWORK SERVICE has been attempting to open the StagingLog.mdb file to no avail.  After giving the NT AUTHORITY\NETWORK SERVICE the rights to Modify the StagingLog.mdb file ...

image

... I am now able to successfully start my CSS project and stage my StarterSite data to a separate folder.

UPDATE: Rather than only giving access to the StagingLog.mdb file, give the NETWORK SERVICE account access to the entire Data folder where the MDB file is located.  Otherwise it will have issues trying to write out an LDF (Access log file) file when updates are made.

Hopefully this not only helps someone resolve this particular problem, but also shows how useful it is to equip yourself with good debugging tools!

Good luck!

posted on Saturday, July 28, 2007 2:37:35 PM (Central Standard Time, UTC-06:00)  #    Comments [1] Trackback
# Sunday, July 15, 2007

It was a slower-than-normal week in the world of Commerce Server; that is, slow for everyone except Max.  The man is a Commerce Server animal!

The general slowness and lack of blog posts can probably be attributed to the Worldwide Partner Conference in Denver, CO., this past week.  Lots of activity.  Unfortunately, I was unable to attend.  I've been swamped with BizTalk projects and dirty diapers.

Here's what I read regarding Commerce Server this past week ...

Blogs (posts you should read)

07/10/2007 - Max Akbar - Endeavor Commerce to unveil SmartCatalog TM for CRM 6.1 at Microsoft Worldwide Partner Conference - Max mentioned that Endeavor Commerce announced version 6.1 of their SmartCatalog for CRM application.  You can learn more and SmartCatalog, and all the great stuff they're doing at Endeavor Commerce, here.

07/11/2007 - Max Akbar - Microsoft Commerce Server Webcasts on TechNet - Max has put together two new webcasts: How to Configure Commerce Server 2007 and Schemas for Commerce Server 2007 BizTalk Adapters.  His first webcast shows specific instructions on how to configure Commerce Server applications, and the second provides detailed information how how to use the BizTalk schemas for the Commerce Server adapters.  Be sure and take a look at these two screen casts.  As with most everything Max does, these webcasts are great.

07/13/2007 - CS Team Blog [MSFT] - "Invalid Viewstate" With Load Balancers - Joe Wasson, a member of the Commerce Server product team, provides a solution to a problem that may occur when a client goes through the checkout process.  If you receive the error"Viewstate verification failed. Reason: Viewstate was invalid." during the checkout process, be sure and take a look at this post.

07/14/2007 - Max Akbar - Commerce Server 2007 SP1 Partner SDK - Max reminded us all that the Partner SDK has also been updated: Commerce Server 2007 SP1 Partner SDK.

07/14/2007 - Max Akbar - Catalog Web Service and SetJoin API Configuration - Max discovered a problem with the Set Join API documentation, with regards to the Catalog Web Server web.config file.  Along with the product group, Max was able to find a solution to the issue.

Forum / Newsgroup (answered questions that you might find useful to peruse)

07/09/2007 - CS2007 now fails - An additional tip on how to resolve the "DirectMailer already exists" problem that occurs when configuring a renamed Commerce Server computer.

07/09/2007 - Error while using the Site Connection - Jared Hodges provides two steps that must be taken to make sure that the management applications can connect to the orders service.  These both relate to whether or not your certificate is trusted.

07/10/2007 - Migrating profile data from CS2002 to CS2007 - Max provides two useful links describing how to migrate profile data from Commerce Server 2002 to Commerce Server 2007.

07/10/2007 - Unit Test failing for Starter Site - William was having problems with the BasketHelperTest and CatalogHelperTest for the starter site.  He resolved the problem by installing Service Pack 1 for Visual Studio 2005.

07/10/2007 - HTTP 500 Error When Launching Business User Application - David Lott provides tips on how to configure Commerce Server 2007 on Windows Vista.

07/10/2007 - Product Relationships Question - Describes how to link the product definition data to the product relationships returned from the CatalogRelationshipsDataTable.

07/11/2007 - Error in Getting Profile - Some guidance on how to retrieve profile information.

07/11/2007 - How to determine is user authenticated in current session [sic] - Again, William answered his own question, and discovered the HttpContext.Current.User.Identity.IsAuthenticated property.

Have a great week!

posted on Sunday, July 15, 2007 8:51:41 AM (Central Standard Time, UTC-06:00)  #    Comments [0] Trackback
# Sunday, July 08, 2007

I've been meaning to start posting an aggregation of notable Commerce Server blog and forum postings.  I've never found that Google or Technorati do a great job of searching or summarizing blog topic discussions, so I'll try to do my best to relate what's going on in the Commerce Server community.  Mostly, these posts come from people listed in my Commerce Server blogroll, as well as the Commerce Server forums.

Please let me know if I've missed any notable Commerce Server posts or announcements!

Blogs (posts you should read)

07/01/2007 - Ryan Donovan [MSFT] - The Best is Yet To Come - Ryan reflects on the long-term product roadmap for Commerce Server.

07/01/2007 - Max Akbar - Looking for Commerce Server Training? - Max announces the completion of his first video training tutorial.  This tutorial focuses on the Commerce Server Catalog System.  I  have had the opportunity to review this tutorial, and I can attest that it is great stuff!  Definitely worth the $$.

07/01/2007 - Jeff Lynch [MVP] - E-Commerce News: Commerce Server 2007 & BizTalk Server 2006 R2 - Jeff posts a summary of some news in the CS world, and explains that BizTalk Server 2006 R2 and Commerce Server 2006 play well together.

07/02/2007 - Nick Mayhew [MSFT] - Commerce Server SP1 available and introducing the Commerce Server team blog - A little behind the times <grin>, Nick announced SP1 and the CS team blog.

07/06/2007 - Ryan Donovan [MSFT] - http://blogs.msdn.com/rdonovan/archive/2007/07/06/speaking-in-denver-wpc-next-week.aspx - Ryan mentions that he'll be here in Denver to talk at the WPC (damn, I can't make it!) about Commerce Server.

07/06/2007 - CS Team Blog [MSFT] - http://blogs.msdn.com/commerce/archive/2007/07/06/commerce-server-worldwide-partner-conference-in-denver-next-week.aspx - The CS Team (via Ryan) discusses their presentation at the Worldwide Partner Conference in Denver, CO.

Forum / Newsgroup (answered questions that you might find useful to peruse)

07/02/2007 - StarterSite HelperClasses Source Code [Urgent!!!] - I've seen this one a lot.  People cannot find the source code for the Commerce Components, and only see the assembly (CommerceComponents.dll).  The source code is available in the CommerceComponentsSource.zip file, which is part of the Starter Site zip.

07/02/2007 - Data warehouse - Resolution to the error "Trans-Ctlg DTS task provider wrapper : Cannot Init timezone object"

07/03/2007 - InventoryQuantityDelta and the out of stock mystery - An explanation as to why orders occasionally come through for a product that is out-of-stock.

07/05/2007 - 'Out of Memory Exception' using CatalogWebService for Inventory - Memory leak when using BizTalk 2006 and Commerce Server 2007 Catalog adapter to update inventory.  The leak is fixed with SP1, and can be resolved by restarting the Catalog Import Host COM+ service.

07/06/2007 - Password Strength - Decreasing the password strength required for a profile.

07/06/2007 - Failed to delete inventory skus / Execute permission denied on 'inv_ValidateSkuType' - A potential bug in the inventory system.

posted on Sunday, July 08, 2007 3:18:35 PM (Central Standard Time, UTC-06:00)  #    Comments [0] Trackback
# Saturday, June 23, 2007

In my previous post, I detailed the process for installing the Commerce Server 2007 SP1.  In this post, I have created a walkthrough for the Commerce Server 2007 Upgrade Wizard.  The upgrade wizard should be run for all of your Commerce Server 2007 sites immediately after you have installed SP1.  So, before you begin this process, be sure you have successfully installed SP1.

(Note: I created this walkthrough, along with verbose screen shots and text, largely for documentation I am delivering to clients.  Please feel free to use these screen shots and/or text for your own documentation.)

A couple comments based on my experience installing SP1 and upgrading through the wizard:

  • Immediately upgrade all of your Commerce Server 2007 sites.  Do not reboot your machine before you run the Upgrade Wizard.
  • Make sure SQL Server 2005 is running with the appropriate built-in account.  For example, when I initially installed SP1 my SQL Server 2005 instance ran as "Local System".  However, post install, I had to switch the built-in account to "Network Service" for SQL Server 2005 to start-up properly.  I will write a separate post about some issues I had the first time installing SP1.

That said, here's the process for using the Upgrade Wizard to upgrade your Commerce Server 2007 sites.

  1. Launch the Upgrade Wizard.  You can launch this application automatically after installing SP1 or by running the Upgrade Wizard (Start -> All Programs -> Microsoft Commerce Server 2007 -> Tools -> Upgrade Wizard).  Click Next to begin.

    CS 2007 Upgrade Wizard: Welcome
  2. On the Select Options screen, specify the log file path.  I left the default location.  Click Next to continue.

    CS 2007 Upgrade Wizard: Select Options
  3. On the Select a Commerce Site screen, specify the site you want to upgrade.  Note: if you have more than one site, you can only upgrade on at a time; you can re-run the Upgrade Wizard to upgrade additional sites.  Click Next to continue.

    CS 2007 Upgrade Wizard: Select a Commerce Site
  4. On the Upgrade Site Resources screen, you have the option to choose Migrate or Do Nothing for your various resources.  Select the action Migrate for all your resources.  Click Next to continue.

    CS 2007 Upgrade Wizard: Upgrade Site Resources
  5. The Upgrade Summary screen reviews the selections you have made.  Review the selections, and click Next to start the upgrade.

    CS 2007 Upgrade Wizard: Upgrade Summary

    CS 2007 Upgrade Wizard: Upgrade Process
  6. Once the upgrade is complete you will have to click the Next button to continue.

    CS 2007 Upgrade Wizard: Upgrade Process (summary)
  7. On the Summary screen, you can review the upgrade and click Main error log to review any errors.  Click Next to continue.

    CS 2007 Upgrade Wizard: Summary
  8. You have successfully upgraded  your Commerce Server 2007 site.  Click Finish to complete the upgrade wizard.

    CS 2007 Upgrade Wizard: Complete
  9. After you click Finish you are reminded to restart.  Click OK to continue.

    CS 2007 Upgrade Wizard: Restart notice
  10. If you have additional Commerce Server 2007 sites to upgrade, repeat steps 1-8.
  11. Once you have upgraded all your Commerce Server 2007 sites, restart your computer.

The process is reasonably straightforward, and I encountered no problems.

Please be sure to share your experiences.

I hope this helps!

posted on Saturday, June 23, 2007 12:33:18 PM (Central Standard Time, UTC-06:00)  #    Comments [0] Trackback

I went through the process of upgrading my Commerce Server 2007 sites today.  While I had a few issues with the installation, I was able to get everything updated and functioning.

There are really two parts to the SP1 installation: the first is the installation of SP1 itself, and the second is the upgrade wizard that must run against your Commerce Server 2007 sites.  This post will walk you through the installation of the service pack itself.  The upgrade wizard walkthrough is discussed in a separate post.

Before you install Service Pack 1 for Commerce Server 2007, I recommend you do the following:

  1. Test SP1 by installing first in your development environment.  Ensure that your application continues to function.  If necessary, run regression tests against your application to make sure nothing has been broken.
  2. Install SP1 in your QA or UAT environments, followed by your Stating environment (if you have one).  Again, this is to ensure that your systems are not broken by the installation of the service pack.
  3. Make sure to thoroughly back-up your production environments before you upgrade.  This is VERY important, as you must ensure that you have an exit strategy, should something go wrong.  Do not neglect this step, or you may regret it.

Okay, that said, you must first download SP1 before you can begin.  You can download SP1 for Commerce Server 2007 here: http://www.microsoft.com/downloads/details.aspx?FamilyId=748049C5-A9BF-4AEC-91A0-AFE2DE0BF860&displaylang=en

(Note: I created this walkthrough, along with verbose screen shots and text, largely for documentation I am delivering to clients.  Please feel free to use these screen shots and/or text for your own documentation.)

Once you have downloaded the file, you can begin the following steps:

  1. Double-click "CS2007-SP1-ENU.exe".  You will receive a security warning - click Run to continue.

    WalkThru1
  2. Specify a location to unzip the necessary files, and click Unzip.

    WalkThru2
  3. Browse to the location you unzipped the files and review the ReadMe.htm file.
  4. After you have read the ReadMe.htm file, double-click SP1Setup.exe to launch the installation wizard.
  5. On the CS 2007 SP1 Installation Wizard starter screen, click Next to continue.

    WalkThru3
  6. Read the license agreement, specify that you accept the terms, and click Next to continue.

    WalkThru4
  7. Click Next to begin the installation.

    WalkThru5
  8. A dialog box will indicate that various services will be stopped.  Click OK to acknowledge and continue.  The installation of SP1 will (finally!) begin.

    WalkThru6

    WalkThru7
  9. Once the installation is complete, a summary page displays.  You can take a look at the log file (which I would recommend) and can also immediately launch the Commerce Server Upgrade Wizard (which I would also recommend).  Click Finish to complete the Commerce Server 2007 SP1 upgrade.

    WalkThru8

At this point you must upgrade any Commerce Server 2007 sites you have installed on the machine.  I will discuss this process in a separate post.  I have two recommendations for you at this point:

  • Immediately upgrade all of your Commerce Server 2007 sites.  If you don't upgrade them, you will get errors like the following (notice that I learned this out of experience):

     Error
  • Wait to reboot your server until you have upgraded all of your Commerce Server 2007 sites.  See my post for more details.

I hope this helps!  Best of luck!

posted on Saturday, June 23, 2007 11:57:08 AM (Central Standard Time, UTC-06:00)  #    Comments [0] Trackback
# Friday, June 22, 2007

The Commerce Server team has just announced the release of SP1 for Commerce Server 2007.

Here's the new features/enhancements they highlight:

  • Support for Commerce Server 2007 Developer Edition and business user applications on Windows Vista
  • Ability to create a Commerce Server 2007 Web Application Project in Visual Studio 2005 -- something that  it definitely needed!
  • Performance enhancements
  • Security enhancements
  • Various fixes (here's a list of all the bugs fixed with SP1)

Note the fine print from the site: "Commerce Server 2007 SP1 includes updated binaries in English only. Each business user application that Commerce Server 2007 provides is available in English only. This does not affect your ability to develop a multilingual Commerce Server Web site.  Installing SP1 on non-English versions of Commerce Server 2007 is not supported."

You can download SP1 here: http://www.microsoft.com/downloads/details.aspx?FamilyId=748049C5-A9BF-4AEC-91A0-AFE2DE0BF860&displaylang=en

Also, you can download the updated partner SDK here: http://www.microsoft.com/downloads/details.aspx?FamilyId=BDEA4873-2C06-4C7F-AD51-830A0309FECC&displaylang=en

I plan to update my virtual images with SP1, so I'll be sure and blog about the experience later tonight!

[Update]

posted on Friday, June 22, 2007 5:35:40 PM (Central Standard Time, UTC-06:00)  #    Comments [0] Trackback
# Tuesday, June 19, 2007

As a Commerce Server developer, you are bound to come across a situation where the smart client business user applications (e.g. the Catalog Manager, Catalog and Inventory Schema Manager, Customer and Orders Manager, and Marketing Manager) do not satisfy a business requirement, need to reflect a company's brand or style, or your business users simply want it changed.

Fortunately, you can get the full C# source code for the business user applications (except for the Catalog and Inventory Schema Manager; see Max's comment in this thread) through the Commerce Server 2007 Partner SDK.  This gives you the ability to modify the business user applications and be a hero to all your colleagues and clients (chuckle!).

Yeah, yeah, this is all old news.  However, I just came across a great idea from Søren Spelling Lund in which he talks about his experiences using ClickOnce Deployment along with the business user applications.

What is ClickOnce Deployment?

ClickOnce deployment is a technology designed to ease the difficulty in creating self-updating Windows-based applications.  Using the Publish Wizard in Visual Studio 2005 (or mage.exe, mageui.exe, or MSBuild), you can publish your application in three different ways: to media (such as a CD-ROM), to a network file share, or to a Web page.

When an application is published, two files are created: an application manifest, and a deployment manifest.  The application manifest describes the contents of  the application, including the assemblies, dependencies, and the files that make up the application.  The deployment manifest describes how the application is deployed, the location of the application manifest, and the version of the application that should be run by the clients.

Here's an example of an application published to a Web page (this particular example is from the SpaceWar SDK for the XNA framework - yes, I truly aspire to be an XBOX 360 game developer):

Example of application published to a Web page via ClickOnce

(Note the deployment version number.)

Once the end-user installs the application from the deployment location, the application is, by default, added to the Start menu and the Add/Remove programs group in the Control Panel.  Nothing is added to the Program Files folder, the registry, or the desktop.  When I first played around with ClickOnce this last part caught me unaware -- I couldn't figure out where my application had been installed!  Also, no administrative rights are required to install the application.

Now, remember the deployment version number?  The best part about this technology is that, if a developer publishes a new version of the application, the deployment version number is incremented.  Consequently, the next time the end-user runs the application they are presented with an opportunity to update their application.  What's neat is that, as a developer, you actually have a lot of control: you can require an update, and you can even require that a user rolls back to an earlier version of the application (not that any of us would ever have to roll back to an earlier version ...).

All-in-all, it's neat stuff.  And, while it's not a perfect solution and has it's own problems, you can very rapidly integrate it into your application and quickly reap the rewards.  Oh, and you can easily become a hero to your colleagues and clients (are you starting to sense a pattern?).

Integrate ClickOnce Deployment into the Partner SDK?

So, we're back to the smart client business user applications.  I'm sure you're now asking yourself, what does this have to do with the Commerce Server 2007 business user applications (or maybe not, since I alluded to it above)?

Søren Spelling Lund posted an article about integrating ClickOnce Deployment into the business user applications.  It's a great idea, and one I will definitely use in the future.  Additionally, he takes the time to point out a problem him and his colleagues ran into when they tried to run the ClickOnce installer on the Customer and Orders Manager.  Essentially, it appears that the project file included a <TargetZone> element that interfered with the ClickOnce installer.  Removing the <TargetZone> element resolved the problem.  Check out his blog article for the full details.

What are the benefits of integrating ClickOnce Deployment into the Partner SDK?

  • Ease - Easily deployment of business user applications to end-users
  • Versioning - Make sure your end-users are running the latest and greatest
  • Safety - The ability to roll back to a previous version of the application (just in case!)
  • Security - The applications run in a security context that prevents users from doing malicious things
  • Fame - Yes, you too can be a hero ...

Thanks to Søren for a great idea and a great post!

What great ideas have you put into play?  Please let me know!

posted on Tuesday, June 19, 2007 8:50:33 PM (Central Standard Time, UTC-06:00)  #    Comments [0] Trackback

During the installation of the Commerce Server 2007 Starter Site, I received the following error in the Pup.log file:

[10:57:50] Error importing object data for Transaction Config from file C:\Documents and Settings\Administrator\Local Settings\Temp\Transaction Config 8004E024:COM+ activation failed because the activation could not be completed in the specified amount of time. (Exception from HRESULT: 0x8004E024)

I also saw the following error in the Application Log, written at the exact same time:

Failed to import orders configuration data. System.Runtime.InteropServices.COMException (0x8004E024): COM+ activation failed because the activation could not be completed in the specified amount of time. (Exception from HRESULT: 0x8004E024)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.EnterpriseServices.Thunk.Proxy.CoCreateObject(Type serverType, Boolean bQuerySCInfo, Boolean& bIsAnotherProcess, String& uri)
   at System.EnterpriseServices.ServicedComponentProxyAttribute.CreateInstance(Type serverType)
   at System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(Type serverType, Object[] props, Boolean bNewObj)
   at Microsoft.CommerceServer.Orders.DataManagement.ServerOrderSystem.ImportRegionCodes(String txnConfigResourceConnectionString, DataTable regionCodesTable)
   at Microsoft.CommerceServer.Orders.DataManagement.ServerOrderSystem.ImportConfigurationData(Stream stream, String txnConfigResourceConnectionString)

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

I should note that, rather than install the Starter Site to a virtual directory under the Default Web Site, I decided to create a new Web site to which I installed the Starter Site.  The reason I did this is I already had the CSharpSite installed to the Default Web site, and I didn't want the two sites interfering with each other.

Also, to provide other information regarding this installation (just to show I'm not making an obvious mistake):

  • I ran it as the local Administrator account; full access to the system and SQL Server
  • Windows Server 2003 Standard R2; SQL Server 2005 Standard SP2; Commerce Server 2007 Developer edition
  • All hot fixes have been applied to the O/S
  • Instructions provided by the Commerce Server 2007 Start Site Installation Guide were followed
  • The CSharpSite was previously installed successfully
  • Everything is running locally (CS 2007, SQL Server 2005, BizTalk 2006), so it's not as if DTC (or some nefarious networking issue) is causing problems

This was the only error I received during the installation.  I took note of it, then continued onward.

Lo and behold, when I went to test the installation of the Starter Site, I received the following error:

The specified value for the newOrderStatus attribute is not valid.  The value provided was: 'NewOrder'. Please make sure an entry for this value exists in the AllowedStatus table in the transaction config database.

So, I decided to investigate.  Sure enough, the tables in the StarterSite_transactionconfig database were empty.  Specifically, the AllowedStatus, RegionCodes, and StatusManager tables did not contain any data.  So, I created scripts based on the data contained in these tables in the CSharpSite_transactionconfig database (which installed without any problems).

[Update] Note: see below for the actual resolution to this problem.  Although the following steps will correctly resolve the problem, there's a better way.

For example, here's the script generated for the AllowedStatus table (it's a bit more extensive for the RegionCodes table -- e-mail me if you need a copy of the script):

INSERT INTO [StarterSite_transactionconfig].[dbo].[AllowedStatus] ([Status]) VALUES ('Cancelled')
INSERT INTO [StarterSite_transactionconfig].[dbo].[AllowedStatus] ([Status]) VALUES ('InProcess')
INSERT INTO [StarterSite_transactionconfig].[dbo].[AllowedStatus] ([Status]) VALUES ('NewOrder')
INSERT INTO [StarterSite_transactionconfig].[dbo].[AllowedStatus] ([Status]) VALUES ('Rejected')
INSERT INTO [StarterSite_transactionconfig].[dbo].[AllowedStatus] ([Status]) VALUES ('Shipped')
INSERT INTO [StarterSite_transactionconfig].[dbo].[AllowedStatus] ([Status]) VALUES ('Submitted')

After inserting the missing data into these three tables, and running iisreset from the command-line, the Starter Site ran without any problems.

I still plan to try and investigate the underlying cause of the problem ... when I learn more, I'll update this post.  At the very least, I wanted to post this solution.

I hope this helps!

[Update] The actual solution to this problem.

Shortly after going through the previous steps, I performed the this Google search and noticed the following in the Commerce Server 2007 Readme file:

Unpacking a site might not populate the AllowedStatus table
The following error message might occur in the site packager log file:

"8004E024:COM+ activation failed because the activation could not be completed in the specified amount of time. (Exception from HRESULT: 0x8004E024)"

This error message indicates that Commerce Server could not populate the AllowedStatus table in the transactionconfig database. To populate the AllowedStatus table, open SQL Server Management Studio (open SQL Query Analyzer if you are using SQL Server 2000), and run the regiondata SQL script against the transactionconfig database. The regiondata script is located at %COMMERCE_SERVER_ROOT%\SDK\Samples\SiteCreate\.

So, it appears to be a known issue (previously unknown to me, though!) and easy to resolve!

What's the moral of this story?  Make sure to thoroughly research errors before you try to hack the solution yourself (or blog about it), even if you accidentally get the resolution correct.

I hope this saves someone the 30 minutes it cost me!

posted on Tuesday, June 19, 2007 1:15:30 PM (Central Standard Time, UTC-06:00)  #    Comments [1] Trackback
# Monday, June 18, 2007

Max Akbar, Commerce Server expert and former Senior Product Manager for the Commerce Server team, has announced his new training company and web site.  Training resources include video tutorials, DVDs, PowerPoint presentations, codes samples, and on-site training.  You can find more information on his Web site at http://www.commerceservertraining.com/.

Max recently left Microsoft to consult and train companies using Commerce  Server.  While this is a huge loss for Microsoft, it is a huge win for the Commerce Server community as there has been a noticeable lack of training resources available.  Max is sure to do an excellent job filling this void.  Additionally, Max is acting as the technical editor on my forthcoming book Professional Commerce Server 2007.

Best of luck, Max!

posted on Monday, June 18, 2007 12:18:58 PM (Central Standard Time, UTC-06:00)  #    Comments [0] Trackback
# Thursday, June 14, 2007

One of the more manually intense steps in the installation of Commerce Server is setting up the appropriate SQL logins and Database Role User Mapping.  This task can easily take 30 - 60 minutes to complete if done manually.  Futhermore, it's likely that this is the easiest step to make a mistake, which will cause problems for you down the road.

So, to make this process quicker and less prone to errors, I've created an SQL script that you can run against your database.  This script performs two tasks:

  1. Creates the SQL login accounts (e.g. COMPUTERNAME\CatalogWebSvc).
  2. Associates the SQL login accounts to database roles.

Note: this script is only for SQL Server 2005.  SQL Server 2000 uses a different set of database roles.

Take a look the Grant Web Applications and Window Services Access to the Databases section of the Installation Guide for Commerce Server 2007, and you'll see that the number of role assignments is quite extensive.

Rather than pasting the entire SQL script into this post, I am only going to upload the .SQL file.  You can modify this file as necessary in order to adapt it to your environment (e.g. changing the computer name, you may have different names for logins, or don't need services like the direct mailer).

CreateCSLoginsAndAssignRoles.sql.txt (12.54 KB) (just remove the .txt extension)

I hope this helps!

[Update]

I found it useful to create an abbreviated verion of this script that is used for adding new sites.  Whereas the script "CreateCSLoginsAndAssignRoles.sql.txt" is for brand new installations of Commerce Server 2007, the following script is useful for when you add a new site and re-use users and logins.

CreateCSLoginsAndAssignRolesForNewSites.sql.txt (8.42 KB) (just remove the .txt extension)

posted on Thursday, June 14, 2007 10:46:59 AM (Central Standard Time, UTC-06:00)