0

need your help with this one, i'm running azure deployment on my localhost and get the webpage without css and javascript, when i look in fiddler i see 500 status and the following error: "It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS" on each request for javascript or css file, i already enabled static content on windows feature and it didn't help, i'm using iis 7.5 on windows professional 64 bit with azure sdk 1.7, tried anything, and nothing helped, can't change the site to web application cause the website only exist on iis while i'm running debug, any idea what to do?

1 Answer 1

1

Could it be that the directory from which you're serving JS/CSS files contains a web.config file? If this is the case this will be causing the problem.

Your web.config contains an element which can only be defined in a real web application (in the root of your application for example- or in the machine.config. To fix this issue you'll need to open the machine.config (C:\Windows\Microsoft.Net\Framework\v4.0.30319\Config\machine.config) and look at each configSection defined here that is also included in your web.config (in the folder containing the JS/CSS files).

If the configSection in the machine.config contains the allowDefinition attribute with MachineToApplication as value this means you cannot use that configSection in a web.config that isn't located in a web application. Meaning in your case you'll need to remove that configSection from the web.config in the folder containing the JS/CSS files.

If you're using ASP.NET MVC this is probably your Content folder.

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

2 Comments

didn't find any web.config under my content folder, my machine.config does contain allowdefinition with attribute machine to application, i deleted the configSection from the web.config and i get the error: there was an error attaching the debugger... didn't solved the issue
oh my god i found the web config you were talking about, you were right! YOU ARE A GENIUS !!!! thanks a lot, i spent the whole day trying to solved this issue, you deserve to be happy for the rest of your life!!!!

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.