2

In my app there is a subfolder that contains a Web.config that interferes with my app. E.g. "It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level."-type of errors come up.

I can't remove this problematic Web.config because this folder comes from an external source.

Is there any way I can tell IIS to just fully ignore this Web.config?

2 Answers 2

1

I got it from somebody expert in the field (among the developers of ASP.NET itself) that this is not possible.

Sign up to request clarification or add additional context in comments.

2 Comments

I have an npm package that causes the same error, how did you solve the original problem in the end?
This particular problem I couldn't. It was for an experimental project that was later ditched so it didn't matter. However in the meantime I've heard that putting an empty Web.config will stop IIS serving static files from a folder, even if in the parent folder there is a Web.config configuring StaticFileHandler. So maybe nowadays this works?
0

In case anyone else comes to this due to an npm package, it's possible to remove the web.config on a postscript using rimraf

npm install rimraf

and then add:

'scripts': {
    'postinstall': 'rimraf node_modules/**/web.config'
 }

on packages.json

In my case, the web.config is in the selenium-webdriver package which is not needed to serve the application so I'm fine with just removing it.

https://stackoverflow.com/a/44863212/1102585

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.