According to MSDN, the deployment element can ONLY be set at the machine level.
asp.net It is an error to use a section registered as allowDefinition='MachineOnly' beyond machine.config
-
03-04-2022 - |
Question
Hey guys i've been trying to upload my website to a remote server, but i keep getting this error. i have changed every 'allowDefinition' to 'Everywhere' in two machine configs, but i did not help. It highlights ' deployment retail="true"/ ' as the problem field. Any help will be appreciated.
Full error description:
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineOnly' beyond machine.config.
Source Error:
Line 23: </compilation>
Line 24: <customErrors mode="RemoteOnly"></customErrors>
Line 25: ***<deployment retail="true"/>***
Line 26: <trace mostRecent="true" enabled="true" requestLimit="1000" pageOutput="false" localOnly="true"/>
Line 27: <authentication mode="Forms" />
Solution
OTHER TIPS
You need to create a virtual directory. In VS, go to project properties and select the Web tab. There, you will find a button to create it. Leave the machine.config files alone unless absolutely necessary.
My fix was that I edited machine.config and deleted allowDefinition attribute from the declaration of deployment element. I don't claim this is the recommended fix. Note that there are more machine.config files for different .Net versions and also for x86 and x64 applications. I.e.
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config