In the source code of the RefreshApp.aspx (RefreshApp.aspx.cs) file,
the code that is generated causes a profile refresh to fail. The
following is the default code:
private void ProfileRefresh()
{
// Implement Profile Service Refresh here
// Please see the Profile Service documentation for more information on
// implementing a refresh of the Profile Service
// This will cause "Publish failed" to appear in the Business Desk application status
throw new Exception("Publish failed");
}
If you use the default profile system, you can replace the default code with the following code to provide valid profile refresh
functionality. To do this, follow these steps:
- Add the following references to the code:
using Microsoft.CommerceServer.Runtime;
using Microsoft.CommerceServer.Runtime.Profiles;
- Replace the existing code with the following sample code:
private void ProfileRefresh()
{
ProfileContext profContext = CommerceContext.Current.ProfileSystem;
string bdaoConnectionString;
string providerConnectionString;
string profilesConnectionString;
bdaoConnectionString = (string)CommerceApplicationModule.Resources["Biz Data Service"]["s_BizDataStoreConnectionString"].ToString();
providerConnectionString = (string)CommerceApplicationModule.Resources["Biz Data Service"]["s_CommerceProviderConnectionString"].ToString();
profilesConnectionString = (string)CommerceApplicationModule.Resources["Biz Data Service"]["s_ProfileServiceConnectionString"].ToString();
profContext = new ProfileContext(profilesConnectionString, providerConnectionString, bdaoConnectionString, CommerceContext.Current.DebugContext);
CommerceProfileModule.ProfileContext = profContext;
}