viewing site from server - asp.net

ok i'm trying to put my asp.net website onto my university's web server but when visiting my webpage I get the following problem:
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 13: </connectionStrings>
Line 14: <system.web>
Line 15: <roleManager enabled="true" />
Line 16: <authentication mode="Forms" />
Line 17: <compilation debug="false" targetFramework="4.0" />
Source File: F:\users\1010033\co5027\web.config Line: 15
I can't get this working at all. I presume it's to do with the user security and roles I set up in Visual Studio but I have no idea about what to do to fix the problem. Bear in mind I don't have access to ISS as that is all set up by the university.
I have a second web.config file in a folder called AdminSecured in my root folder which holds all the secured pages.
Any ideas?

You need set up your virtual directory in the control panel of your hosting.

I've only seen this if you haven't set your site as an Application in IIS or if you have two web.configs on the root.

Related

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

Have tried to publish an MVC app through visual studio to an IIS server.
When trying to run it i am getting the error:
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 20: <httpRuntime targetFramework="4.5" />
Line 21: <!---->
Line 22: <authentication mode="Windows" />
Line 23: <authorization>
Line 24: <!--<deny users="?" />-->
there are a lot of articles around this but can't seem to work it out.
I have read that when deploying through visual studio it deploys it as a web app so no need to convert, well actually can't find the option to even do it.
The web.config is in the C:\inetpub\wwwroot\MyApp\ and can't see any others in the views or other sub folders.
really stuck on this!

<trust level="Full" /> error on godaddy server

I have uploaded website on godaddy web server.On localhost it is working fine but on web server it is showing me an error like this
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 24: </compilation>
Line 25:
Line 26: <trust level="Full" />
Line 27:
Line 28: </system.web>
The only way I was able to get around this issue was to do a Clean, Rebuild, and redeploy all files to GoDaddy.
If you're using GoDaddy's Classic Hosting and running ASP.NET 4.0/4.5, then the default trust level is Full, and you need the <trust level="Full" /> config entry as specified in the OP's question.
More info can be found here.

ASP.Net wont launch - IIS error because it's not in root?

I have a ASP.Net solution that I have checked out of SVN. I have saved it under c:\inetpub\solution-name\. The file I am trying to launch is in c:\inetpub\solution-name\trunk\project-name\Default.aspx. When I access that via the browser http://localhost/solution-name/trunk/project-name/, I get the following 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 253: </controls>
Line 254: </pages>
Line 255: <roleManager enabled="true" cacheRolesInCookie="true" defaultProvider="AspNetSqlRoleProvider">
Line 256: <providers>
Line 257: <clear/>
I think the problem might have something to do with the directory structure of the files. I don't want to change the structure as I need to be able to have multiple solutions under inetpub, etc.
Is there an IIS configuration to fix this?
You need to create a Virtual Directory for each Asp.Net project in IIS. Also if you are on IIS7+ you can right click on folder and click on "Convert to Application". To create a virtual directory you can right-click on the website in IIS, and select "Add Virtual Directory".

asp.net It is an error to use a section registered as allowDefinition='MachineOnly' beyond machine.config

Hey guys i've been trying to upload my website to a remote server, but i keep getting this error. i have changed every 'allowDefinition' to 'Everywhere' in two machine configs, but i did not help. It highlights ' deployment retail="true"/ ' as the problem field. Any help will be appreciated.
Full error description:
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='MachineOnly' beyond machine.config.
Source Error:
Line 23: </compilation>
Line 24: <customErrors mode="RemoteOnly"></customErrors>
Line 25: ***<deployment retail="true"/>***
Line 26: <trace mostRecent="true" enabled="true" requestLimit="1000" pageOutput="false" localOnly="true"/>
Line 27: <authentication mode="Forms" />
According to MSDN, the deployment element can ONLY be set at the machine level.
You need to create a virtual directory. In VS, go to project properties and select the Web tab. There, you will find a button to create it. Leave the machine.config files alone unless absolutely necessary.
My fix was that I edited machine.config and deleted allowDefinition attribute from the declaration of deployment element. I don't claim this is the recommended fix. Note that there are more machine.config files for different .Net versions and also for x86 and x64 applications.
I.e.
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config

Publishing website on IIS error

Hi everyone when i publish my website via IIS, I get this error code as you can see at below. Can you help me ?
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 27: </assemblies>
Line 28: </compilation>
Line 29: <authentication mode="Forms">
Line 30: <forms loginUrl="~/Account/LogOn" timeout="2880" />
Line 31: </authentication>
Source File: C:\Users\furkan\Desktop\WebCity\webcity\web.config Line: 29
Then I converted my root dictionary to Application but I get this error
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: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.
Source Error:
Line 17: <system.web>
Line 18: <httpRuntime requestValidationMode="2.0" />
Line 19: <compilation debug="true" targetFramework="4.0">
Line 20: <assemblies>
Line 21: <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Source File: C:\Users\furkan\Desktop\WebCity\WebCity\web.config Line: 19
The answer to the first issue was this:
This usually means you have not configured the directory for your website as an application. Open up IIS Manager, find the root directory for your website (where web.config is), right click, and select "Convert to Application".
For the new issue, it's a problem of the .NET version. You either don't have asp.net 4.0 installed, or you have the application pool set to use the wrong framework. It's probably the latter, so go to the advanced setting for your site, select the Application Pool setting, and choose an Application Pool called ASP.NET 4.0, or any other that uses the 4.0 framework. If there aren't any, then you need to install .NET 4.0
Did you check if you have multiple web.configs in a sub directory somewhere?
Link describing the problem here

Resources