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

Problem :-  It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level

 

Solution :- There Are Mainly One of the Two Reason Why you Got this Error Message.

1.   If you Have Not configured your asp.net application in IIS.  If you have not Configure your application to run on IIS First Configure your Site to Run on IIS.For that Create Virtual Directory From IIS and Give Permission to Application (Read,Write)

 

2. If Above is Not Problem Then There are Mainly Problem of Two or many Web.Config Exists on your Site.When you Open Some Site and if Software Crate Backup of that Application then Software mainly Do Create Subfolder and Copy All Files + Web.Config in Application.Just Remove this Subfolder web.config from Subfolder. 

 

Let me Know if You Know Anything More or want to Know More .....

 . 

 

Prev Post                    All Post                           Next Post

Posted in |

91 comments:

  1. Anonymous Says:

    Thanks Ketan

    I have same Problem but i seen there are two web.config first in main folder and second one in sub folder.

    I remove and My Application now working

    Thanks once again for your Solution.

  2. Anonymous Says:

    Thanks.... when i upgraded to VS2008 it had created a backup folder inside my project folder and this was causing the problem

  3. sandip patil Says:

    Hello
    I Have many web.congig in my application subfolder and i have need of them (for Rolls like admin)whate i do now

  4. Ketan Patel Says:

    Hello Sandip,

    If there are different application in one application then you can create different virtual directory for different application.

    Otherwise for same application there are no possibility two have many configuration file.

    I have done similar type of situation during my project in which i have two application in one application first one main application and second one is Photo capture application which is part of main application but photo capture application also have configuration file.But i have create different virtual directory for it. and there are no problem with this application.




    Can you say me in detail what type of situation in your application ????

  5. Stuart Watton Says:

    When this happens to me it is because the vS conversion wizard automatically creates a backup directory under the root of the website. Just delete the directory and it should then compile

  6. Raining Forever Says:

    Hi, I also got the same error:

    "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."

    -I created vitual directory for that web application and map the directory but it doesn't work when i upload files and run on web server.

  7. Ketan Patel Says:

    Hello Raining Forever.

    There are Many Criteria For This.You can me Write on Detail on ketan_erp@yahoo.com Or Can Caught On Yahoo messenger id : - ketan_patel3536@yahoo.com After 8 P.M (IST)

  8. ewRroA8o0f9kFT.Uxj4HThm0v86EcgG6JJmK Says:

    Thanks; I only realized by this post that I had an extraneous web.config in a subdir

  9. Anonymous Says:

    Hi one doubt since im new to web development. my doubt is even if the application is not configured in iis it will be able to build it locally right?
    I copied an application from another machine to mine and tried to build it Im getting this error.

  10. Anonymous Says:

    i want to know more

  11. Anonymous Says:

    my application is configured as web application in iis and it has just one web.config file on the root, still has the problem, pls help

  12. ketan patel Says:

    @above

    Check that you are running main Folder name Which Contain web.config.

    Exmaple id your site name is Technical then web.config include in Technical/web.config

    Now Suppose there are another folder New folder/Technical Now if you run as a New folder and your config file in New Folder/Technical/web.config then same Error Come.Please check it.

  13. backup solution Says:

    Thanks for the information! I have recieved this error message several times and couldn't figure out what to do. Your post was very helpful! thanks so much

  14. Skywalker Says:

    Thank you for advice! I ran into this error when I ran a conversion from VS2005 to VS2008 and I googled for a resolution.

    For some reason web.config files were placed under application root folder and project stopped compiling.

    After deleting web.config files I am back in the game.

  15. Amit Says:

    I have same problem. I have a visual studio solution of our application. I have two application means I integrated one application , inside another application and we have two config file of these application. I configure both application in IIS but when I build my solution , it is giving same error, Please help me

  16. Amit Says:

    error is

    E:\AmitSamples\YAF\yetanotherforum\web.config(35): Build (web): 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.

  17. Ketan Patel Says:

    Hi Amit,

    I think you have two web application in one solution. in this case it's not cause a problem.I have also same situation in my project. There are four web application (web,mobile,home site etc..)
    but it's not causing any problem.

    you make sure that u have one solution and in that two web application and also set one application as a start up project.

    you can mail me on my email id or cont in this.

    Enjoy !!!!!!

  18. Amit Says:

    Yes I have one solution and also set one application as a start up project but still I am facing same problem.
    I explain my application
    In my web application I have another web application like YetAnotherForum application.
    This application has its web.config and our parent web application its web.config. I add YAF solution inside a folder which is child folder of parent web application.

    I have machine key same in both config file for integration.

    These above all things I have in my application.

    it is not working local its giving same error but on server it is working fine. I need it bcs I wants to do debug in nested application from my web application

    please send me solution asap.

  19. Ketan Patel Says:

    Hi amit,

    In this case u can solve by two way.

    1.) There are two web.config in your solution in root directory and second in sub folder. Do one thing remove some section from Sub folder web.config it's not cause any problem because it's inheritance from root web.config.

    Remove section like , etc .. which are already in root directory.

    Let me know if this is work for you or not.

    2.) If u r running from visual studio then u can run and debug the application. you can run your application by disabling error checking u can search more on google or if want more help on it then let me know.

    Please back to me if any solution work for you.

  20. Anonymous Says:

    Hello,

    I have an app that has admin folder with web.config in it, have tried all of the above but still get the errors. :((

  21. Ketan Patel Says:

    Hi @above

    why u used two web.config.

    All u can archive using single web.config.

    August 27, 2010 1:52 AM

  22. Anonymous Says:

    Hi Ketan,

    I no nothing about the application, I have had to move servers and this one must be setup way different.
    I have removed the duplicate entries from the admin web.config and that fixed the initial error but now get error...

    Exception Details: System.Data.SqlClient.SqlException: Could not find stored procedure 'CMRC_Manf'.

    thanks
    tom

  23. Ketan Patel Says:

    Hi tom,

    Now it's your Database error. in Database given store procedure not found. check whether your given database contain sp name with "CMRC_Manf".

  24. Anonymous Says:

    Hello;

    I am running into a similar issue. I had our web-site hosted on our local server and when I moved to LinkDotNet I get the below error. The web-page works fine it is when I try to go to the Admin Login page that I get this error.

    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='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

    Source Error:


    Line 70:
    Line 71: -->
    Line 72:
    Line 73:

  25. Anonymous Says:

    Ok,

    for some reason it keeps leaving the error information out when I post, so I took the < off to see if that would help

    Line 70:
    Line 71: -->
    Line 72: authentication mode="Forms"
    Line 73: !--AUTHORIZATION
    Line 74: This section sets the authorization policies of the application. You can allow or deny access

  26. Anonymous Says:

    tnx
    2nd one works

  27. Jay Says:

    I had this error and the solution is that I had one extra folder and that had the web.config. The roort folder had no web.congig.

    I recrested the solution where under solution I have a folder that had web.config.

  28. Anonymous Says:

    Thank you, the second one worked for me.

  29. Anonymous Says:

    Thank u. It works

  30. Michel Says:

    for me it was happening after a publish. there were conflicting web.config files.
    Solution was to delete everything in the obj folder

  31. Anonymous Says:

    Thanks. Still relevant.
    I allowed VS2010 to upgrade a VS2008 solution, and it stopped working. I removed the backup files and all OK.

  32. PIYUSH Says:

    Hi I am getting this error when I m trying to consume my own web service in another website, while creating proxy using WSDL I dont have any of the cases unsolved i have applications in IIS and also no subfolders for web.config, Please help me :(

  33. Ketan Patel Says:

    Can u send me coding on ketan_erp@yahoo.com with details. so i can help you.

  34. Anonymous Says:

    Hiii ketan i have a problem i deploying my website on server side please help...!!

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

  35. Anonymous Says:

    in line 36 itis written as

  36. sivasankararao Says:

    hi, thank you so much its working now. this was very helpful to get a success of me.
    siva sankar

  37. santhosh.padamatinti Says:

    hi , thank you so much its working fine now...

  38. Anonymous Says:

    Thanks Yaar..

  39. Mutiara_Sabah Says:

    Hi,
    i also have same problem..
    in my case, my system is in asp classic..and i have to create one module using asp.net, then once the user login in using asp and go to the module in asp.net, im stuck in here..
    need help!!!
    Thanks
    Aleesya

  40. sanket Says:

    after sending mail, it should jump on sendmail.asp page. please provide me solution for this..

  41. Avinash Says:

    I have an application which consists of four Projects, in which 1 is Presentation 2 Web Service 3. Web Service 4 Business logic.. The first project depends on 2nd Web Service and the 2nd Depends on 3rd and 3rd Depends on 4th... So I have created web references to connect frm one prj to other prj... but this application is working fine in my local machine but when I deployed in Dev Environment am getting an error. So I tried to make the web ref to be called dynamically through a tool and making stuff in each projects web.config file saying like below... (1st proj refering to 2nd proj and 2nd proj ref to 3rd proj) (add key="localWS" value="//localhost.xxxxx.com/2ProjName/ProductWS.asmx")
    (add key="DevWS" value="//dev1wssupplier.xxxxx.com/2ProjName/ProductWS.asmx"/)
    (add key="TestAWS" value="://tst1wssupplier.xxxxx.com/2ProjName/ProductWS.asmx"/)
    (add key="ProductionWS" value="://wssupplier.xxxxx.com/2ProjName/ProductWS.asmx"/)
    and calling the WS as
    ' call web service
    Dim proxyClass As New ProductProxy.ProdWS ('Where ProductProxy is namespace of the calling tool and ProdWs is the class name and below validateEntry is the function)
    result = proxyClass.ValidateEntry(CType(materialMaster, Integer), shipTo)
    proxyClass = Nothing
    End If
    am getting the value whn I keep the cursor at Proxyclass as "localhost.xxxxx.com/2ProjName/ProductWS.asmx"
    but after passing it am getting an error that
    Unable to automatically step into the server. The remote procedure could not be debugged. This usually indicates that debugging has not been enabled on the server.
    can anybody help me in this how to do???

  42. Avinash Says:

    Kindly some one help me in the above mentioned issue as early as possible... Its vry very urgent...

  43. Kunal Verma Says:

    Hi My site had 2 web config i removed 1 of them still i get this error, even though only 1 web config file

  44. Toby Says:

    Thanks! First solution worked for me! Was driving me nuts :)

  45. Anonymous Says:

    Hi, Actually when i upgrade to VS 2008 It has created a new Folder with name backup inside my Main application folder which cause this Error.

    Resolution : Remove this backup folder from the main application folder.

  46. Sagar Says:

    Hi i m also getting the same 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."
    As i have configure my home directory and having number of supporting web.config file for admin purpose.
    when i double click on the error line its shows its location in web.config file at the line where the is written

  47. Anonymous Says:

    Hi i m also getting the same 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."
    As i have configure my home directory and having number of supporting web.config file for admin purpose.
    when i double click on the error line its shows its location in web.config file at the line where the is written authentication mode="Forms"

  48. Ketan Patel Says:

    Hello sagar,

    You can take multiple web.config in application. But make sure that base tag used only once. If based tag used many times then it's throw compile time error.

    Let me know if want more details on this.

  49. Anonymous Says:

    Thanks a lot. it worked exactly as u told.
    Thanks again

    Nilesh K.
    nileshkolnoorkar@yahoo.com

  50. Anonymous Says:

    Thank you so much! it worked as you suggested and very pleased.

  51. farrukh Says:

    well there is another case. if you open mvc project as a web site, then this error occurs. when you open it as a project then this error does not occur.

  52. Ketan Patel Says:

    yes farrukh, you are rite. even you open simple asp.net projet as a website then you will get this error.

    thanks to point out.

  53. Duncan Says:

    I had the same error on a new MVC3 project, and resolved it by running a 'clean' on the solution and a 'clean' on the project.

  54. pavana Says:

    hi ketan,
    im getting this error if i run that source code.pzl help me out actually im running that code for the first time.i need to do any setting before running code.

    this is the errror
    asp.net runtime error.it is an error to use a section register asallowDefinition='MachineToApplication' beyond application level

  55. Ketan Patel Says:

    @pavana....

    no not need to do any setting.

    please verify above is not case with your application.

    n also verify that you have open solution file.

  56. gopi Says:

    sir i have use visual studio 2010 but not run coding plee help me



    Server Error in '/CODING' 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='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

    Source Error:

    Line 26: ASP.NET to identify an incoming user.
    Line 27: -->
    Line 28:
    Line 29: section enables configuration


    Source File: C:\Users\gopi\Desktop\credit-card-fraud-detection-using-hidden-markov-model-project-source-code\REVIEW MATERIALS\REVIEW MATERIALS\FINAL\CODING\itdns03\web.config Line: 28

  57. Shailesh Sharma Says:

    Hi,
    I also get the same issue and get the best solution on below given link as you may get this error due to multiple reasons and both are explained and solved in below given link ...

    http://blog.geek4support.com/it-is-an-error-to-use-a-section-registered-as-allowdefinitionmachinetoapplication-beyond-application-level/

  58. Snehasish Says:

    i am not able to run .asp file in VS05..please guide me what changes i have to do in IIS as well as in web config to rum the application

  59. Waseem Khan(ITEC) Says:

    Thanks my problem was also had similar resemblance with you problem and i solved it by watching your suggestion.

  60. Harshada Dumbhare Says:

    Hi my website run well upto 15 min after that i get the following
    error

    Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.

    so I set MachinKey in my web.config file. its getting another 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.


    i am using only one web.config file in project please can any one help me out to resolve this error.

  61. Anonymous Says:

    great thanks

  62. Ajay Panchal Says:

    which one remove ?

  63. Nagammai Says:

    Thanks my pblm also solved.
    i have moved my web config files to my sub folder
    It is working fine

  64. Anonymous Says:

    Thank you. You solution helped me.

  65. anulesh Says:

    Hi,

    I have created a application with one Webform1.aspx (VS2012)and run directly and its work fine, but when i configured the same with IIS then I got 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.'
    I have given Add/Edit permission also.

    Please suggest me

  66. Anonymous Says:

    Hi Ketan
    During debug i got below error

    Error at line 29:


    Error description:
    Error 1 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. C:\Gaurav\PartNumberGenerator09_05_2012\PartNumberGenerator27\Web.config 29

    I have already excluded 2nd web.config file from project

  67. Anonymous Says:

    Clean solution, Rebuild solution, and everything works. (in my case).

  68. Ketan Patel Says:

    Hi Anulesh,

    Problem is not with your Add/edit Permission but it's seem that your root director is not your application please confirm with this. Application should be on root directory.


    Ketan Patel

  69. Ketan Patel Says:

    Hello @Above,

    Some time Visual studio act like childy :D

  70. Ketan Patel Says:

    Hello,

    Are you sure you have only one web.config and also make sure that if you are running main website.

  71. Anonymous Says:

    i have an app deployed, next I added a new folder and placed new app in it. originalApp/newApp/page

    both originalApp and newApp has web.config

    what to do ? pls help

  72. manjunath Says:

    thanku guys... but one thing i never created ../ccbweb/ccbweb folder i dont know what was the problem i just renamed inner most ccbwe folder like ../ccbweb/ccbweb_useless after that all working fine

  73. Anonymous Says:

    Thanks The solution of this error you are not chooseing correct path when deploying!!!

  74. Anonymous Says:

    In my case the Publish tool created a copy in obj\Release\Package\PackageTmp\. Possibly a previous publish failed and it did not tidy up on completion. Clean did not remove it.

  75. Niranjan Says:

    i copy the connection string from second web.config file and paste it in first. Then i removed second web.config. Now its working fine for me.

  76. Anonymous Says:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Data;
    using System.Data.SqlClient;
    using System.Configuration;
    using System.Collections;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using System.Net.Mail;


    ///
    /// Summary description for DAL
    ///
    public class DAL
    {

    public string _ConnString = System.Configuration.ConfigurationManager.ConnectionStrings["CRM"].ConnectionString;

    public SqlDataReader GetDataReader(string sSQL)
    {
    // Create Instance of Connection and Command Object
    SqlConnection myConnection = new SqlConnection(_ConnString);
    SqlCommand cmd = new SqlCommand(sSQL, myConnection);
    SqlDataReader result = default(SqlDataReader);

    // Execute the command
    try
    {
    cmd.CommandType = CommandType.StoredProcedure;
    myConnection.Open();
    result = cmd.ExecuteReader(CommandBehavior.CloseConnection);
    }
    catch (Exception ex)
    {
    if (ex.ToString() == "")
    {

    }
    return null;
    }

    // Return the datareader result
    return result;
    }

    public SqlDataReader GetDataReader(string sSQL, SortedList paramList)
    {
    // Create Instance of Connection and Command Object
    SqlConnection myConnection = new SqlConnection(_ConnString);
    SqlCommand cmd = new SqlCommand(sSQL, myConnection);
    SqlDataReader result = default(SqlDataReader);
    int x = 0;
    // Execute the command
    try
    {
    cmd.CommandType = CommandType.StoredProcedure;
    for (x = 0; x <= paramList.Count - 1; x++)
    {
    cmd.Parameters.AddWithValue((String)paramList.GetKey(x), paramList.GetByIndex(x));
    }
    myConnection.Open();
    result = cmd.ExecuteReader(CommandBehavior.CloseConnection);
    }
    catch (Exception ex)
    {
    if (ex.ToString() == "")
    {

    }
    }
    // Return the datareader result
    return result;
    }

    public DataSet GetDataSet(string sSQL, SortedList paramList)
    {
    // Create Instance of Connection

    SqlConnection myConnection = new SqlConnection(_ConnString);
    SqlCommand cmd = new SqlCommand(sSQL, myConnection);
    int x = 0;
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.CommandText = sSQL;
    cmd.Connection = myConnection;
    for (x = 0; x <= paramList.Count - 1; x++)
    {
    //cmd.Parameters.Add(paramList.GetKey(x), paramList.GetByIndex(x));
    cmd.Parameters.AddWithValue((String)paramList.GetKey(x), paramList.GetByIndex(x));
    }
    SqlDataAdapter myAdapter = default(SqlDataAdapter);
    myAdapter = new SqlDataAdapter(cmd);

    DataSet result = new DataSet();
    try
    {
    myAdapter.Fill(result);
    }
    catch (Exception ex)
    {
    if (ex.ToString() == "")
    {

    }
    return result;
    }
    // Return the datareader result
    return result;
    }

  77. avnish kumar singh Says:

    i have make application without configure IIS but now we can configure and then i can upload my file so what i can do coz error is that
    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.
    please give me some solution and also told my how we can configure root directory coz i am hosting first time on server.
    please any one can help me.

  78. ronzul Says:

    Thanks, had the same problem after upgrading to VS2012

  79. Fer_Show Says:

    Two web configs, nice!!

  80. Anonymous Says:

    hai..i have the same problem.."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" but i have not duplicate web.config and i use my own localhost..who can help??

  81. Anonymous Says:

    hai Avnish..how u solve your problem??

  82. Anonymous Says:

    I was pulling my hair out with this message. You solved it!!!

    Thank you very much

    Ned

  83. Anonymous Says:

    thank you

  84. Anonymous Says:

    You rock. thanks dude

  85. Anonymous Says:

    Worked! Thanks-

  86. Amit K Says:

    Thanks ..... The issue has been resolved now :)

  87. Ahmad K Says:

    It's worked!
    Thanks very much

  88. Ahmad K Says:

    It's Worked!!!
    Thanksssssssssssssssssssssss very much

  89. Anonymous Says:

    Thank you ,, solved my issue got more than one web.config :)

  90. Pradip Ghante Says:

    Hi...
    After first web config delete. Gating this error


    The type 'ParserTest.SAXTest' exists in both 'c:\Users\ramesh\AppData\Local\Temp\Temporary ASP.NET Files\root\bbf34d84\124f8f9b\App_Web_oc3nxhh3.dll' and 'c:\Users\ramesh\AppData\Local\Temp\Temporary ASP.NET Files\root\bbf34d84\124f8f9b\assembly\dl3\75ab8424\00350863_994fc501\Parser.DLL' c:\Users\ramesh\AppData\Local\Temp\Temporary ASP.NET Files\root\bbf34d84\124f8f9b\App_Web_uwkjynq0.1.cs 106

  91. Ketan Patel Says:

    Hello Pradip,

    First close visual studio.

    Delete all temp files.
    Then again open visual studio.

    Rebuild your solution.

    it should work. if not then let me know.

Post a Comment