none
Bewildering problem while debugging Visual Studio sharepoint ribbon project and updating the website RRS feed

  • Question

  • Hello everybody,

     

    I have a confusing problem while debugging a visual studio sharepoint project. I try to build an additional button in the project center.

    My problem is, that when I  try to debug my project,  I can see the button, but the jscript, which is set on it, is not changing after I changed anything in the source code after the first debug run.

    The jscript remains at the first debug run. It seems to be a problem with the caching or something like that, although I tryed to delete the cache of the internet explorer.

    I try to explain with the source code:

     

    This is my elements.xml:

     

    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <CustomAction Id="ProjectCenterPage.AdditionalScript"
        Location="ScriptLink"
        ScriptSrc="myproject/myprojectjscript.js"/>
    
      <CustomAction Id="Ribbon.ContextualTabs.ProjectCenter.Home.Editing.CustonRibbon"
                    Location="CommandUI.Ribbon"
                    Title="Add a custom button to the Project Center">
    
        <CommandUIExtension>
    
          <CommandUIDefinitions>
    
            <CommandUIDefinition Location="Ribbon.ContextualTabs.ProjectCenter.Home.Editing.Controls._children">
    
              <Button Id="Ribbon.ContextualTabs.ProjectCenter.Home.Editing.NewButtonCMD"
                Sequence="40"
                Command="NewButtonCMD"
                LabelText="im OS|ECM oeffnen"
                Alt="im OS|ECM oeffnen"
                Image16by16="/_layouts/images/myproject/ax_128.ico"
                Image32by32="/_layouts/images/myproject/ax_128.ico"
                TemplateAlias="o1"/>
    
            </CommandUIDefinition>
    
          </CommandUIDefinitions>
          <CommandUIHandlers>
            <CommandUIHandler Command="NewButtonCMD" CommandAction="javascript:alert('Hello first debug run');" />
          </CommandUIHandlers>
    
        </CommandUIExtension>
    
      </CustomAction>
    </Elements>
    

     


    When I'm debugging this project the first time, everything happens as expected.

    Then I'm changing just the alert text:

     

    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <CustomAction Id="ProjectCenterPage.AdditionalScript"
        Location="ScriptLink"
        ScriptSrc="myproject/myprojectjscript.js"/>
    
      <CustomAction Id="Ribbon.ContextualTabs.ProjectCenter.Home.Editing.CustonRibbon"
                    Location="CommandUI.Ribbon"
                    Title="Add a custom button to the Project Center">
    
        <CommandUIExtension>
    
          <CommandUIDefinitions>
    
            <CommandUIDefinition Location="Ribbon.ContextualTabs.ProjectCenter.Home.Editing.Controls._children">
    
              <Button Id="Ribbon.ContextualTabs.ProjectCenter.Home.Editing.NewButtonCMD"
                Sequence="40"
                Command="NewButtonCMD"
                LabelText="im OS|ECM oeffnen"
                Alt="im OS|ECM oeffnen"
                Image16by16="/_layouts/images/myproject/ax_128.ico"
                Image32by32="/_layouts/images/myproject/ax_128.ico"
                TemplateAlias="o1"/>
    
            </CommandUIDefinition>
    
          </CommandUIDefinitions>
          <CommandUIHandlers>
            <CommandUIHandler Command="NewButtonCMD" CommandAction="javascript:alert('Hello second debug run');" />
          </CommandUIHandlers>
    
        </CommandUIExtension>
    
      </CustomAction>
    </Elements>
    

     


    When I'm debugging the project now, I have an alert box with: "Hello first debug run" ...

    I'm totally confused. I tryed a lot, but the alert text isn't changing.

    But when I'm changing anything at the button appearance, for example the LabelText, then this happens at the next debug round.

    Don't know, what to do. I need your help, please.

    Thanks in advance.

    Best regards,
    Marc 


    • Edited by Airwave1981 Monday, December 19, 2011 1:27 PM
    Monday, December 19, 2011 1:25 PM

Answers

  • Hello everybody,

     

    after a long search and a lot of tests I finally found the problem! :D

    Although I cleaned the Internet Explorer Cache so many times, there are some files left.
    But, there is a Cachecleaning function in the IE Debugging Tools.
    Press F12 and then STRG+R.

    After this,everything works as aspected. But I didn't find a automatism for this until now.

    Thanks to everybody.

    Best regards,
    Marc

    Friday, December 23, 2011 7:12 AM

All replies

  • Hello everybody,

     

    after a long search and a lot of tests I finally found the problem! :D

    Although I cleaned the Internet Explorer Cache so many times, there are some files left.
    But, there is a Cachecleaning function in the IE Debugging Tools.
    Press F12 and then STRG+R.

    After this,everything works as aspected. But I didn't find a automatism for this until now.

    Thanks to everybody.

    Best regards,
    Marc

    Friday, December 23, 2011 7:12 AM
  • Hi Airwave1981 !

    Thanks a lot for this tips !

    Regards,
    Clem.

    Thursday, March 15, 2012 9:23 AM