locked
Add a bindingRedirect to the web.config declaratively in SharePoint 2007 RRS feed

  • Question

  • It is possible to add keys to the web.config by creating a file: 12/CONFIG/webconfig.name.xml
    (See http://msdn.microsoft.com/en-us/library/ee413929.aspx)
    With contents:

    <actions>
      <add path="configuration/SharePoint/SafeControls">
        <SafeControl
          Assembly="CustomWebPart, Version=1.0.0.0, Culture=neutral, PublicKeyToken=123456789abcdefgABC"
          Namespace="CustomWebPart"
          TypeName="*"
          Safe="True" />
      </add>
      <add path="configuration/runtime/assemblyBinding">
       <dependentAssembly>
         <assemblyIdentity name="CustomWebPart" publicKeyToken="123456789abcdefgABC" culture="neutral" />
         <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" />
       </dependentAssembly>
    </actions>
    


    This works great for adding safe controls, but it doens't seem to work for assembly redirects. Does anyone have an idea why this doens't work? Is it maybe the case only tags inside "configuration/SharePoint/" can be added?
    • Moved by Mike Walsh FIN Thursday, March 3, 2011 12:23 PM cust or admin but not certainly a general question (From:SharePoint - General Question and Answers and Discussion (pre-SharePoint 2010))
    Thursday, March 3, 2011 12:17 PM