Replacement for WsrpHelper in EPiServer 4.62



 I did upgrade from EPi 4.51 to 4.62 and now when I trying to compile the solution I receive errors connected with WsrpHelper (The type or namespace name 'WsrpHelper' could not be found...). I see that in the EPiServer.dll library this class dosn't exists anymore (namespace EPiServer.Util). I search for 'wsrp' keyword on EPiServer site and found only configuration of the wsrp, but nothing about WsrpHelper class. Is this class moved to some other place? Or is there any other class which I can use instead? Below are all occurences of the helper in the code:

foreach (DictionaryEntry entry in WsrpHelper.ConsumerEnvironment.ProducerRegistry)


ConsumerContext.ConsumerEnvironment = WsrpHelper.ConsumerEnvironment;

IUser user = WsrpHelper.ConsumerEnvironment.UserRegistry[Context.User.Identity.Name];

WsrpHelper.ConsumerEnvironment.UserRegistry.Add( user );

 In addition I received error that LanguageManager.GetContextLanguage() is obsolete (namespace EPiServer.Core). Instead of this I used LanguageContext.Current.CurrentLanguageBranch. Is this property an equivalent to the obsolete method?

 Regards, Andrzej

#19575 Apr 18, 2008 13:25
  • Petter Klang
    Member since: 2008

    Hi Andrzej 

    From what I can tell, we never accessed WsrpHelper from our own classes, and the ConsumerEnviroment should be accessible via ElektroPost.Wsrp.Consumer.ConsumerContext.ConsumerEnviroment.

    All the helper class had was a property to hold the ConsumerContext, and a function to create the contet if it was null.

    The EnsureConsumerEnvironment function used ConsumerFactory.CreateConsumerEnviroment() to set it's enviroment property, but that method has been marked as deprecated in favor for ConsumerFactory.ConsumerEnviromentInstance.

    #30109 Jun 02, 2009 14:33
  • Svein Terje Gaup
    Member since: 2003

    Hi, I have done the exact same upgrade, and got the same problems.

    You failed to answer the second question Andrzej asked, the one about which property of the LanguageContext.Current should be used. I am guessing Andrzej was wrong, and have tried using CurrentUILanguageID as a replacement for the GetContextLanguage() function. Is this a good code rewrite?

    I solved the WsrpHelper problem by creating a new class in the WsrpPortal.aspx.cs file called WsrpHelper:


    #36990 Feb 16, 2010 14:44