ASP.Net - It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level

后端 未结 7 1802
南笙
南笙 2021-01-19 17:34

Getting this error on an intranet application we have running in our development environment, and I\'m not sure where to go/look for a solution. The application used to work

相关标签:
7条回答
  • 2021-01-19 17:35

    I had this problem. I think I caused it to start happening by modifying some settings in the publish profile. Undoing those settings fixed my issue. Here's what I did:

    • Right click on the project and go to publish
    • In the publish tab, in the configuration row, click "configure"
    • go to the settings tab
    • expand File Publish Options
    • I unchecked all of the options that were there. (checking some of these is what i believe caused my problem in the first place)
    • I deleted the bin and obj folders in my publish directory.

    I have VS2017

    0 讨论(0)
  • 2021-01-19 17:42

    Just had this issue ... turned out to be a result of allowing debug information to be produced when publishing the Web App.

    Publish Web App - Settings - File Publish Options - Precompile during publishing (true) - Configure - Emit debug information. (Should actually read "Omit debug information")

    Delete Debug subdirectory of project and republish

    0 讨论(0)
  • 2021-01-19 17:52

    This can also happen when you create a publish folderprofile if you take the default location, which is app.publish folder under your project folder. VS then gets confused and thinks there's another web.config it has to reconcile when building. Why does microsoft allow you to shoot yourself in the foot like this? Moving the Publish FolderProfile to another location stops the error from occuring.

    0 讨论(0)
  • 2021-01-19 17:57

    In my case inside my web directory, I had an other web directory along with its own web.config file. When I removed that sub directory that was a complete website in its own my problem is fixed now.

    0 讨论(0)
  • 2021-01-19 17:57

    any how web.config should be in the root directory most probably it happens when you don't have the solution file for your project. Close VS open it once again and choose the direct folder. Note web.config file should be in root directory or if you want to in sub directory then copy the webconfig file and create a new config file in the root. Caution:if you have mentioned any path in config file that will be lost

    0 讨论(0)
  • 2021-01-19 18:00

    In some cases this could be caused by creating another sub-folder in your project and you added another Web.config file which has the same filename as the other Web.config file in the root folder.

    To resolve this error, rename your newly added Web.config file to another name.

    0 讨论(0)
提交回复
热议问题