When we are logged in SharePoint, site Web.config file its get updated with following line.

<SafeControl Assembly="MyCustomAssembly" Namespace="MyCustomNamespace" TypeName="*" Safe="True" />

from web.config if we remove this line and i did iisreset.

Again this same line generating in web.config file.

so i am getting the same error again.

How to resolve this issue?

why its happening ?

enter image description here

2 Answers 2


<SafeControl> must reside in the <SafeControls> element. See SafeControls Element (Solution).

  • yes but this tag was automatically added in inside of <system.serviceModel> tag. why this happening ?
    – Elina
    Commented Aug 10, 2017 at 5:50
  • This would be due to incorrect configuration of your (likely) WebConfigModification configuration.
    – user6024
    Commented Aug 11, 2017 at 14:52

When you install the solution then it should registered safe control like below. I think u have to update ur manifest.xml file. or manully update the web.config.


        <SafeControl Assembly="MyCustomAssembly" Namespace="MyCustomNamespace" TypeName="*" Safe="True" />

  • it was adding inside the <system.serviceModel>.If manually i updated the web.config also after few minutes again it was adding.
    – Elina
    Commented Aug 10, 2017 at 5:13
  • what u have in ur manifest.xml file?
    – Waqas Sarwar MVP
    Commented Aug 10, 2017 at 12:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.