This is a public Forum  publicRSS

Topic

    bluephlame
    developing an add-in while the previous add-in is still...
    Topic posted June 20, 2010 by bluephlameBronze, last edited October 29, 2011 
    1633 Views, 14 Comments
    Title:
    developing an add-in while the previous add-in is still available
    Content:

    Hi I'm trying to figure out how to contiue upgrading an add-in that we have released to others for testing, in the same enviroment.

    what seems to happen is when the library is sitting in the /rightnowdev directory i get the exception

    An item with the same key has already been added.

    I have disabled the specific add-in in the profile that I am using but the DLL is obviously still downloaded and being read into memory.

    any ideas how to contiue development?

    Answer

     

    • Ryan McCullough

      The add-in must still be enabled somewhere in your profile. When you remove permissions to an addin (via the profile editor or the add-in manager), it should not be downloaded to your SiteFiles directory. Additionally, if it had previously been downloaded, it should be deleted upon your next login.

      I would ensure you do not have this add-in in your "%APPDATA%\RightNow_Technologies\SiteFiles\<site>\AddIns" directory.

    • bluephlame

      Thanks for the response Ryan.

      We had checked that directory and the DLL was not there. 
      the addins directory doesnt exist at all, and there are other addins that should have downloaded.

      however simply changing the asembly name has worked for now but is not the best solution.  We are on November 09 if that makes any difference.

    • Ryan McCullough

      I am not sure if we have a published recommendation, but the way I would tackle this is to have an agent account with a profile you can remove the add-in from and that has the Add-In "Developer" permission. You can test a new version of the add-in (with the same name) on this account, then deploy via the add-in manager to your agents.

      As far as addressing the error message you are receiving, how many add-ins are installed on the profile you are trying to use? Does the add-in you are trying to debug rely on any other add-ins? Can you provide a sample that reproduces the issue?

    • erik nilsson

      I work with bluephlame and have the stacktrace of the exception to add to it hope this helps to resolve the issue:

      <?xml version="1.0" encoding="utf-8"?>
      <ExceptionSerialize xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <ExceptionData>
              <ExceptionDataDictionary>
                  <Key xsi:type="xsd:string">Interface</Key>
                  <Value xsi:type="xsd:string">MyInterface</Value>
              </ExceptionDataDictionary>
              <ExceptionDataDictionary>
                  <Key xsi:type="xsd:string">CgiUrl</Key>
                  <Value xsi:type="xsd:string">https://MyInterface--tst2.custhelp.com/cgi-bin/MyInterface.cfg/php/</Value>
              </ExceptionDataDictionary>
              <ExceptionDataDictionary>
                  <Key xsi:type="xsd:string">CachePath</Key>
                  <Value xsi:type="xsd:string">C:\Users\MyName\AppData\Roaming\RightNow_Technologies\SiteFiles\MyInterface\cache</Value>
              </ExceptionDataDictionary>
              <ExceptionDataDictionary>
                  <Key xsi:type="xsd:string">ExceptionFilePath</Key>
                  <Value xsi:type="xsd:string">C:\Users\MyName\AppData\Roaming\RightNow_Technologies\SiteFiles\MyInterface__tst2\Errors\System.ArgumentException\634130601622881365.xml</Value>
              </ExceptionDataDictionary>
          </ExceptionData>
          <Message>An item with the same key has already been added.</Message>
          <Source>mscorlib</Source>
          <StackTrace>   
              at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
              at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
              at RightNow.Services.AddIns.AddInManager.PopulateAccessible()
              at RightNow.Services.AddIns.AddInManager.Initialize()
              at RightNow.Applications.EM.Forms.CrmConsole.InitializeAddIns()
              at RightNow.Applications.EM.Forms.CrmConsole.InitializeComponent()
              at RightNow.UI.Forms.RibbonForm..ctor()
              at RightNow.UI.Forms.ConsoleBase..ctor()
              at RightNow.Applications.Components.Forms.RightNowConsole..ctor()
              at RightNow.Applications.EM.Forms.CrmConsole..ctor()
              at RightNow.Applications.EM.Controllers.ConsoleController.Initialize()
              at RightNow.Applications.EM.Controllers.ConsoleController.Control()
          </StackTrace>
          <AsString>
              System.ArgumentException: An item with the same key has already been added.
              at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
              at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
              at RightNow.Services.AddIns.AddInManager.PopulateAccessible()
              at RightNow.Services.AddIns.AddInManager.Initialize()
              at RightNow.Applications.EM.Forms.CrmConsole.InitializeAddIns()
              at RightNow.Applications.EM.Forms.CrmConsole.InitializeComponent()
              at RightNow.UI.Forms.RibbonForm..ctor()
              at RightNow.UI.Forms.ConsoleBase..ctor()
              at RightNow.Applications.Components.Forms.RightNowConsole..ctor()
              at RightNow.Applications.EM.Forms.CrmConsole..ctor()
              at RightNow.Applications.EM.Controllers.ConsoleController.Initialize()
              at RightNow.Applications.EM.Controllers.ConsoleController.Control()
          </AsString>
          <Type>System.ArgumentException</Type>
      </ExceptionSerialize>

    • Ryan McCullough

      I think your best bet at this point is to contact RN CC and work with them. It sounds like a profile configuration issue to me, but they will be able to better assist you.

    • bill.shipman

      Hey Guys,

      I'm going to tack onto the end of this because I've had this same problem for quite some time, and still don't know how to resolve it.

      I've started from a clean slate just to eliminate any possible caching issues. It've deleted all files in my <%USERPROFILE%%>\Application Data\RightNow_Technologies\SiteFiles directory. I have VS 2008 open and have a post build event to copy my add-ins to <%USERPROFILE%%>\RightNowDev\AddIns, and they are all there properly. I then open the agent console (Feb '10) and attempt to log in with a staff account attached to a profile that only has RightNow Connect and Developer Access turned on for the APIs. At the Loading Console step it fails with this "an item with the same key has already been added" error. Deleting all the add-ins from the <%USERPROFILE%%>\RightNowDev\AddIns directory at that point fixes the error and allows me to log in, but defeats the purpose of using developer mode.

      So I'm not quite sure how to move forward with this. Chris, I followed your steps on your VS Debugger and Developer Mode Vid but it doesn't speak to this particular situation.

      Any help would be appreciated. Thank you!

      Bill

    • Jack Whitehouse

      I would go to the Add-in Config screen and ensure that the add-in isn't enabled for other interfaces of your site, I believe if even one interface is enabled it will download the add-in when the launcher runs.

      If that isn't it, pull up task manager and make sure there aren't any already running copies of the RightNow.InitEngine.exe process already running (if there are - kill them).

      --Jack

    • Chris Omland

      Hi Bill, if the above suggestions did not work you may also try clearing out one more directory. We discovered a defect that is similar to this problem you are seeing but not exactly the same, the issue was resolved in May 2010 release. I'm wondering if potentially it's causing this problem. Perhaps you can try deleting everything under: C:\Documents and Settings\<username>\Local Settings\Temp\AddInValidation\AddInDir

      Let me know if this helps or not.

    • bill.shipman

      Guys,

      I've confirmed that it's one particular add-in that's causing the problem. If i delete it in my C:\Documents and Settings\<username>\RightNowDev\AddIns directory i can log in fine. If i rebuild my project in VS and it's there, i can't log in (item with the same key... error). I've confimed that this add-in is only enabled on one interface, and i've tried deleting the C:\Documents and Settings\<username>\Local Settings\Temp\AddInValidation\AddInDir folder. Any other ideas?

      Bill

       

    • Kevin Noreus

      Hi Bill,

      In the AddIns tab of the  profile editor, try turning "Developer  Access" off.  I suspect the problem you are encountering is occurring because the console is attempting to activate the same add-in in both developer and production modes.

      This issue was fixed in version 10.5.

    • bill.shipman

      Kevin,

      if i do this will it use the add-ins in my C:\Documents and Settings\<username>\RightNowDev\AddIns directory so i can take advantage of developer mode?

      Bill

       

    • Kevin Noreus

      No.  You'll need to differentiate between when your working in dev mode versus production.  So if you you want to work in dev mode then turn developer access "on" and do not give the profile rights in the Add In manager.  If you want to test production mode then turn developer access "off" and give the profile rights to the add-in in the Add-Ins manager.

      We address this in version 10.5 by letting the "Developer Mode" add-in win if the logged in profile has rights to a matching production add-in.  The work-around for you in 10.2 would be to not give access to the profile you are testing your add-in in developer mode.

      Hope this is clear.  If not please let me know.

      Thanks,

      Kevin

    • bill.shipman

      Kevin,

      Crystal clear and I had my hopes up there for a second, but it's still not working. I've unchecked all the interfaces for the add-in on this profile, and i have Developer Access checked. I made sure there are no remnants of the add-in in my C:\Documents and Settings\<username>\Application Data\RightNow_Technologies\SiteFiles\<sitename>\AddIns directory and that the add-ins were only in my C:\Documents and Settings\<username>\RightNowDev\AddIns directory. I tried to log in and still got the same error.

      Thoughts?

    • Kevin Noreus

      Did that Add-in still get downloaded into SiteFiles even after you unchecked all the interfaces?

      Please try the following.

      1.  Completely remove the add-in from add-in manager.

      2.  Delete the contents of cache directory found under SiteFiles/<SiteName>

      Its possible that production version of the add-in is still cached in the internal list we use.  

      Finally, just to be certain.  Are you seeing the exact same stack trace posted by Erik Nilsson on 6/24?

     

    All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.