web config authentication - c#

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 30: </httpHandlers>
Line 31: <httpRuntime maxRequestLength="3145728" />
Line 32: <authentication mode="Forms">
Line 33: <forms loginUrl="~/admin" timeout="40"/>
Line 34: </authentication>
Am I need Add web site to IIS for authentication

The <authentication> node cannot be inherited. It needs to be defined only once at the top level web.config. Your ASP.NET MVC 3 application needs to be hosted in a virtual directory in IIS or in a separate website.

Related

Error in web.config file in asp.net webform application

I am stuck at this and cannot figure it out why it is not working. When i open my website it shows me this error.If you can help me I'll be grateful. It is giving error at membership line and i cannot figure it out why it is giving this error.It is giving the Configuration Error. Below is the description of the 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 52: </controls>
Line 53: </pages>
Line 54: <membership>
Line 55: <providers>
Line 56: <!--

Configuration Error while running the site from visual studio 2012

I am trying to run my website using The Visual Studio 2012 built in Server. I receive this error. I get this error (Note I am not using a virtual directory or an IIS Server just the Visual Studio 2012):
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 30: </buildProviders>
Line 31: </compilation>
Line 32: <authentication mode="None">
Line 33: <forms loginUrl="~/Account/Login.aspx" timeout="2880" />
Line 34:
Source File: D:\work\latest\NewPortal16-11\NewPortal8\newportal8\web.config Line: 32
Show Additional Configuration Errors:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34249

ASP.NET error with authentication mode Forms

I am trying to use Authentication Forms with my ASP.NET project.
I added the following lines in my web.config:
<system.web>
<authentication mode="Forms">
<forms loginUrl="~/Login/Login"></forms>
</authentication>
</system.web>
and when I run my application, I get this 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.
Now I don't know much about IIS and configurations. But after doing some research, I gotta make sure the virtual directory that the site is in is marked as a application in IIS. How would I do that ?
Below is a screenshot of what I see in IIS

why is my website throwing me Authentication Mode=windows error

When I load my web page its giving me this error, I just published it from visual studio, where it was function perfectly fine and now its giving me an 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 87: ASP.NET to identify an incoming user.
Line 88: -->
Line 89: <authentication mode="Windows"/>
Line 90: <!--
Line 91: The <customErrors> section enables configuration
Whenever a new web application created, using Visual Studio.net it automatically creates a virtual directory in IIS and configures as an application. So you have to manually create a Virtual directory and configure it to application.
Start->All program-mes->Administrative tools->Internet Information service-> Select Server name->Web Site->Default Web site-> right click ->new->virtual directory
this opens a virtual directory wizard. give a name, give path of application. Give appropriate permission. then Finish.
Now to cross check whether its configured to an application or not, select created virtual directory Right click->properties->Select Virtual directory under "Application settings"
http://blogs.msdn.com/b/robgruen/archive/2005/09/12/464196.aspx
delete all code in web.config and paste
<?xml version="1.0"?>
<configuration>
<connectionStrings>
<add name="your connection string name" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\your database name;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
</system.web>
</configuration>
it will work.

Deploying asp.net website under existing web site on FTP?

I have a web site underneath I want deploy another web application. So I created a folder in the ftp site and dumped all my file in it.
Example:
Now I am getting below error when trying to access my application default.aspx file
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 33: </assemblies>
Line 34: </compilation>
Line 35: <authentication mode="Forms">
Line 36: <forms loginUrl="~/Account/Login.aspx" timeout="2880" />
Line 37: </authentication>
I don't know root site asp.net version, but I developed on asp.net 3.5
How to resolve this?
You need to setup the subfolder as an IIS Application
I believe that you would need to go into IIS and ensure that the "OnlineReport" folder is configured as an application

Categories