none
Differences between <remove assembly="*"> and <clear/>?

Semua Balasan

  • Hi,

    As you said, this is a ASP.NET Settings Schema, this issue should be posted in Asp.Net forum for better support.

    But I will try my best to help you.

    >>Can you clarify if <remove assembly="*"> is valid or not?

    It is valid. Form my point of view. The following sample from MSDN tell us that we can use <remove> to remove a single assembly, we also can use * wildcards to match all.

    <configuration>
       <system.web>
          <compilation defaultLanguage="VB">
             <assemblies>
                <remove assembly="ADODB"/>
                <remove assembly="*"/>
             </assemblies>
          </compilation>
       </system.web>
    </configuration>

    Here I also create a sample

     <system.webServer>
        <handlers>
          <remove name="BlockViewHandler"/>
          
          <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
        </handlers>
      </system.webServer>

    Please note path="*" verb="*"

    >>If it's valid, what are the differences to <clear/>

    Now focus on <clear/>, per my understanding, it is the same as <Clear/>. but this blog said Using the <remove> tag with web.config can be helpful. So you also need to be careful to use remove assembly="*"

    Best regards,

    Kristin



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    13 Januari 2017 2:47
  • <remove assembly="*"> has an effect only if someone has done <add assembly="*"/> in an inherited configuration file. It does not remove entries that specify an assembly name rather than "*".

    <clear/> removes all entries: both "*" and assembly names.

    This can be seen from the definitions of AssemblyCollection, AssemblyInfo, and CompilationSection.LoadAssembly in Reference Source.

    • Disarankan sebagai Jawaban oleh Kristin Xie 19 Januari 2017 9:54
    13 Januari 2017 8:16
  • Any updates?

    Have you try ranta's suggestion?


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    26 Januari 2017 3:04
  • Hi,

    This forum is discuss and ask questions about issues regarding the very core of .NET, including security, performance, hosting, base classes, interop, reliability, debugging, GC, and profiling. Since you haven't come for a long time, and this issue is out of our topic here. Now I will move this issue to off-topic forum, thanks for your understanding.

    Have a nice day!

    Kirstin


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    06 Februari 2017 7:22
  • Thanks for the info!! And I can add that <add assembly="*"/>, seen in "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config", is used to load all DLL in the bin folder. <remove assembly="*"> thus means to not automatically load all DLL in the bin folder.
    18 Juli 2018 22:01