i got error in web.config

Posted by Kannan1986 under Regular Expressions on 2/23/2010 | Views : 3047 | Status : [Member] | Replies : 7
Hi,


i got error in web.config............


Parser Error Message: 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.

Source Error:


Line 122: <scripting>
Line 123: <webServices>
Line 124: <authenticationService enabled="true" requireSSL="false"/>
Line 125: <profileService enabled="true" readAccessProperties="FirstName, LastName"/>
Line 126: <roleService enabled="true"/>


Source File: D:\VB\beerhouse35\web.config Line: 124




Thanks & Regards,

kannan.s




Responses

Posted by: Vuyiswamb on: 2/23/2010 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
First Question is How many web config do you have?

In your Application directory if you move to the directory that is the parent of your directory do you have a web config liying around there ?

Thank you for Posting at Dotnetfunda

Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

Kannan1986, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kannan1986 on: 2/23/2010 [Member] Starter

Up
0
Down
Three web.config in the project

Kannan1986, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Abhi2434 on: 2/23/2010 [Member] [Microsoft_MVP] [MVP] Silver

Up
0
Down
Generally if you have web.config more than once, every virtual directory web.config will override the parent one.
You should define only the part of the application Settings in the web.config to child directories. Dont use application specific sections.

Application Specific sections should be configured only once in the home directory of the Application.

See many like you found the same issue here :
http://forums.devarticles.com/net-development-43/section-registered-as-allowdefinition-machinetoapplication-beyond-application-level-10027.html

www.abhisheksur.com

Kannan1986, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 2/23/2010 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
You must have only one Web Config, remove other web config that you dont need and build your application again and see if there is any error.

Thank you for Posting at Dotnetfunda

Vuyiswa Maseko


Thank you for posting at Dotnetfunda
[Administrator]

Kannan1986, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Abhijit Jana on: 2/23/2010 [Member] [MVP] Bronze

Up
0
Down
Hi,

It seems, you are having multiple web.config files in root folder. You can have multiple web.config file in your application, but in a particular folder there should only one web.config file.

Cheers !
Abhijit

Kannan1986, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nishithraj on: 2/24/2010 [Member] Bronze

Up
0
Down
The reason for multiple web config files is not clear here. If your intention is to have different modules in a website. You can add separate websites in a single solution project. In that case you can have multiple web.config files to separate each module level configurations.

Mark this as answer, if it is.....

With regards
Nishithraj Narayanan

Kannan1986, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Abhijit Jana on: 2/24/2010 [Member] [MVP] Bronze

Up
0
Down
Nishithraj,

Using multiple web.config in a single application is a common scenarios. You can have multiple folder in your web application and each folder can have different web pages. If you want to set some restriction on specific pages for some user or anything else which are located in separate folder, you can use web.config for child folder as well.

Here is one small example you can just have a look,
http://www.codeproject.com/KB/aspnet/multipleWebConfig.aspx

Please let me know if you need more information.

Cheers !
Abhijit

Kannan1986, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response