Server error in application как исправить

I am trying to deploy an asp.net application in our server while I am receiving 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 63:             ASP.NET to identify an incoming user. 
Line 64:         -->
Line 65:                  <authentication  mode="Windows"/>
Line 66:                  <!--<forms loginUrl="~/SCR.UI/Login1.aspx"/>
Line 67:                  </authentication>-->
Source File: D:BarclaysPayamentManagementSystemscr.uiweb.config    Line: 65

What is the reason and how to resolve it?

Please help


Matthew Scharley's user avatar

asked Jun 30, 2009 at 11:32

priyanka.sarkar's user avatar

priyanka.sarkarpriyanka.sarkar

25.5k43 gold badges125 silver badges173 bronze badges

1

You may get this error when trying to browse an ASP.NET application.

The debug information shows that “This error can be caused by a virtual directory not being configured as an application in IIS.”

However, this error occurs primarily out of two scenarios.

  1. When you create an new web application using Visual Studio .NET, it automatically creates the virtual directory and configures it as an application. However, if you manually create the virtual directory and it is not configured as an application, then you will not be able to browse the application and may get the above error. The debug information you get as mentioned above, is applicable to this scenario.

To resolve it, right click on the virtual directory – select properties and then click on
“Create” next to the “Application” Label and the text box. It will automatically create the “application” using the virtual directory’s name. Now the application can be accessed.

  1. When you have sub-directories in your application, you can have web.config file for the sub-directory. However, there are certain properties which cannot be set in the web.config of the sub-directory such as authentication, session state (you may see that the error message shows the line number where the authentication or session state is declared in the web.config of the sub-directory). The reason is, these settings cannot be overridden at the sub-directory level unless the sub-directory is also configured as an application (as mentioned in the above point).

Mostly, we have the practice of adding web.config in the sub-directory if we want to protect access to the sub-directory files (say, the directory is admin and we wish to protect the admin pages from unauthorized users).

RBT's user avatar

RBT

23.6k21 gold badges158 silver badges238 bronze badges

answered Jun 30, 2009 at 14:34

Árvíztűrő tükörfúrógép's user avatar

1

I had this error when the .NET version was wrong – make sure the site is configured to the one you need.

See aspnet_regiis.exe for details.

answered Jun 30, 2009 at 11:37

Dror's user avatar

I had this error with VS 2015, in my case going to the project properties page, Web tab, and clicking on Create Virtual Directory button in Servers section solved it

answered Feb 26, 2016 at 6:48

mohas's user avatar

mohasmohas

1,8811 gold badge16 silver badges20 bronze badges

It sounds like the admin has locked the “authentication” node of the web.config, which one can do in the global web.config pretty easily. Or, in a nutshell, this is working as designed.

answered Jun 30, 2009 at 11:57

Wyatt Barnett's user avatar

Wyatt BarnettWyatt Barnett

15.5k3 gold badges33 silver badges53 bronze badges

I just had the same issue on visual studio 2012. For a internet application project.
How to resolve “Server Error in ‘/’ Application” error?

Searching for answer I came across this post, but none of these answer help me.
Than I found another post here on stackoverflow that has the answer for resolving this issue.
Specified argument was out of the range of valid values. Parameter name: site

Community's user avatar

answered Oct 4, 2014 at 12:06

Tigrito's user avatar

When you create an new web application using visual studio.net, it automatically creates the virtual directory and configures it as an application. However, if you manually create the virtual directory and it is not configured as an application, then you will not be able to browse the application and may get the above error.

answered Oct 1, 2015 at 15:11

toqeerawan's user avatar

I also got this error when I moved an entity framework edmx file into a “Models” sub-folder. This automatically changed the metadata in my connection string setting in my app.config.

So before the connection string changed… it looked something like this:

<connectionStrings>
    <add name="MyDbEntities" connectionString="metadata=res://*/MyDb.csdl|res://*/MyDb.ssdl|res://*/MyDb.msl; ...
</connectionStrings>

And after… it added the “Models” subfolder name (btw… it also added “Models” to the namespace for the EF classes generated) and the connection string now looks something like this:

<connectionStrings>
    <add name="MyDbEntities" connectionString="metadata=res://*/Models.MyDb.csdl|res://*/Models.MyDb.ssdl|res://*/Models.MyDb.msl; ...
</connectionStrings>

I have a website project that references this Entity Framework DB project. But its web.config did not have the updates to the connection string… and that’s when I started getting the compilation error being discussed here.

To fix this error, I updated the connection string in the web.config in the website project to match the app.config in my EntityFramework project.

answered May 29, 2018 at 14:47

Denis M. Kitchen's user avatar

Denis M. KitchenDenis M. Kitchen

1,0922 gold badges14 silver badges24 bronze badges

vs2017 just added in these lines to csproj.user file

    <IISExpressAnonymousAuthentication>enabled</IISExpressAnonymousAuthentication>
    <IISExpressWindowsAuthentication>enabled</IISExpressWindowsAuthentication>
    <IISExpressUseClassicPipelineMode>false</IISExpressUseClassicPipelineMode>

with these lines in Web.config
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" maxRequestLength="1048576" />
<identity impersonate="false" />
<authentication mode="Windows" />
<authorization>
  <allow users="yourNTusername" />
  <deny users="?" />
</authorization>

And it worked

answered Sep 4, 2019 at 9:57

mylesdolan's user avatar

I opened the Properties window for the website project in question and changed Windows Authentication to “Enabled” and that resolved my issue in VS 2019.

answered Mar 9, 2020 at 18:01

Ropeh's user avatar

RopehRopeh

436 bronze badges

The error message is quite clear: you have a configuration element in a web.config file in a subfolder of your web app that is not allowed at that level – OR you forgot to configure your web application as IIS application.

Example: you try to override application level settings like forms authentication parameters in a web.config in a subfolder of your application

answered Jun 30, 2009 at 11:37

chris166's user avatar

chris166chris166

4,7694 gold badges24 silver badges25 bronze badges

2

автор: Александр Шарафан

При работе в управляемом приложении через веб сервис пользователь иногда получает сообщение:

Server Error in ‘/’ Application

ошибка веб сервиса 1с

С совершенно не вразумительным текстом описания ошибки и рекомендацией как поступить при этом.

Как решать указанную проблему?

Разделим саму проблему на две части:

Проблема Веб сервиса и проблема 1С.

Проблему 1С можно обнаружить и устранить, если запустить режим отладки Тонкого клиента и проверить работу управляемых форм, ответственных за место в котором происходит ошибка.

Здесь мы будем рассматривать половину относящуюся к Веб серверу.

В некоторых источниках пишут что указанная ошибка является характерной для хакерских атак, но в нашем конкретном случае о такой атаке речь идти не может, т.к. проблема возникает при обращении к сервису не из вне сети, а из интранет.

В переводе на русский язык ошибка звучит как: «Ошибка приложения вызванная на сервере. Текущие настройки сервера для этого приложения ошибочны, приложение было остановлено по соображениям безопасности в привентивном режиме.»

Рекомендация данная ниже отключает режим вывода сообщений, но не дает ответа как устранить причину появления ошибки, при условии правильности работы кода 1С во всех других режимах.

немного манипуляций и страница дает уже более понятную информацию:

image (1)

Если ранее проблема была не понятна, то сейчас более понятно что ошибка относится именно к веб серверу и что вызывается именно привентивным прекращением работы приложения веб сервером.

Проблема же заключается в том, что .net имеет режим валидации исполняемого сервером кода, вот эта валидация и приводит к появлению указанной ошибки.

Для устранения ошибки рекомендуется выполнить настройки вебсервера:

1. ValidateRequest = «False»

например,если в конфигурационном файле у вас уже есть:

<% @ Page Language = «VB» AutoEventWireup = «False» Codebehind = «MyForm.aspx.vb» наследует = «Proj.MyForm»%>

то должно стать:

<% @ Page Language = "VB" AutoEventWireup = "False" Codebehind = "MyForm.aspx.vb" наследует = "Proj.MyForm" ValidateRequest = "False"%>

В более поздних версиях Visual Studio значение этого свойства можно получить на странице свойств, поэтому просто установите » ValidateRequest » на » False«. Любым способом установки можно получить тот же результат.

Примечание:

1.1. Если вы используете. NET 4, то вам необходимо добавить requestValidationMode = «2.0» в HttpRuntime раздел конфигурацииweb.config файла. Например:

<httpRuntime requestValidationMode=»2.0″/>

Если у вас еще нет раздела HttpRuntime в web.config, то это можно сделать такие настройки в разделе <system.web>.

      Чтобы глобально выключить проверку запросов добавьте следующую строку в вашем web.config файла: <pages validateRequest=»false» /> раздела <system.web>.

2. Установить  EnableEventValidation = «False» запретим проверку корректности события.

3. Установить EnableViewState = "False"

и

4. Установить нужное значение в ExecutionTimeout. В моем случае строка выглядит так: ExecutionTimeOut = «20»

Это верно для: NET 1.1,. NET 2,. NET 3.5 и. NET 4.0

Использованы материалы интернет форумов и сайтов:

автор Александр Шарафан

There are various reasons for why you may encounter a “Server error in ‘/’ application”. Often the error message provides a bit more detail of what’s wrong. In most cases, the server-side error message is related to IIS (Internet Information Services) or ASP.NET.

Requirements

  • Cloud Server running Windows Server 2012
  • ASP.NET installed

vServer (VPS) from IONOS

Low-cost, powerful VPS hosting for running your custom applications, with a personal assistant and 24/7 support.

100 % SSD storage

Ready in 55 sec.

SSL certificate

Restart IIS

The “Server error in ‘/’ application” can happen if IIS needs to be restarted. You can restart IIS from the IIS Manager. From your Remote Desktop connection, click the “Start” button in the lower left-hand corner and select “Administrative Tools”.

Windows panel “Administrative Tools”
Windows panel “Administrative Tools”.

Click “Internet Information Services (IIS) Manager” to launch the IIS manager.

Administrative Tools: Internet Information Services (IIS) Manager
Start the IIS manager by clicking on it.

Select the affected server from the left-hand panel.

IIS manager: server selection
Select the affected server in the left tab.

On the right of the IIS Manager, click “Restart” to restart IIS.

IIS manager: Restart
Click on the “Restart” button to restart IIS.

Update the URL

Under some circumstances, a 404 error may be displayed as “Server error in ‘/’ application”. When this is the case, the error description in the browser will clarify that the error has occurred because the file is missing or has been renamed.

http 404 error message
The “Server error in ‘/’ application” can occur as an http 404 error.

To fix this problem, correct the URL in the link that triggers this error.

Cloud backup from IONOS

Make costly downtime a thing of the past and back up your business the easy way!

Add the MIME type

If you are accessing a file with a file extension that does not have permissions to be run on the server, you will see the “Server error in ‘/’ application” along with the explanation that “This type of page is not served”.

Message “This type of page is not served”
The “Server error in ‘/’ application” can occur when a file extension does not have permission to run on the server.

When exploring a solution to a “Server error in ‘/’ application”, first ensure that you are using the correct file name. The “Server error in ‘/’ application” can occur if there is a typo in the file extension, for example a file or URL that references test.htl instead of test.html.

If the file name is correct, then you may need to add the MIME type to the server. MIME stands for Multipurpose Internet Mail Extensions. The MIME type is used to indicate what type of document it is. In the example, we are trying to run a file called HelloWorld.cshtml. The file extension .cshtml is not associated with any MIME type by default on Windows 2012.

You can add the MIME type in the IIS Manager. To open the IIS Manager, from your Remote Desktop connection, click the Start button in the lower left-hand corner and “Administrative Tools”.

Windows panel “Administrative Tools”
The IIS manager can be found in the Administrative Tools section.

Click “Internet Information Services (IIS) Manager” to launch the IIS manager.

Administrative Tools: launch IIS manager
Launch the IIS manager from the Administrative Tools section.

Click the server in the left-hand panel.

IIS manager: select server
You can select the affected server from the left tab in the IIS Manager.

Now click “Sites”.

IIS manager: “Sites”
In the left tab you can access the “Sites” folder.

Then click on your domain. In the central panel, double-click “MIME Types”.

IIS manager: symbol “MIME Types”
Adjust the MIME types individually.

Under the “Actions” column on the right, click “Add”.

IIS manager: add MIME types
Click “Add” to add a MIME type.

In the pop-up window which appears, fill in the “File name extension” and “MIME Type” fields, then click “OK”.

IIS manager: add MIME type window
To add a MIME type, you must specify the file extension and the corresponding MIME type.

Note

You may need to do an Internet search to find the correct MIME Type for your file extension.

Verify the .NET Version

Some programs, features, and file types will only run under certain versions of .NET.

You can also check your .NET version from the IIS Manager. To open the IIS Manager from your Remote Desktop connection, click the “Start” button in the lower left-hand corner and then select “Administrative Tools”.

Windows panel “Administrative Tools”
The IIS manager can be found in the “Administrative Tools”.

Click “Internet Information Services (IIS) Manager” to launch the IIS manager.

Administrative Tools: Internet Information Services (IIS) manager
Launch the IIS manager from the Administrative tools.

Click to expand the server in the left-hand window panel.

IIS manager: server selection
You can select the affected server from the left side of the IIS manager.

Click on “Application Pools”.

IIS manager: “Application Pool” among selected servers
Select the Application Pools from the left panel of the IIS Manager.

Right-click on the Domain Name and click on “Basic Settings”.

IIS manager, Application Pools: contextual menu, “Basic settings”
You can access the settings by right-clicking on the domain name.

In the pop-up window which appears, select the .NET version from the drop-down menu, then click “OK” to confirm your choice.

IIS manager, Application Pools: select .NET version
Select your .NET version.

  • Remove From My Forums
  • Question

  • We recently migrated to Office 365 Government E3.

    All employees in our SharePoint group have been able to access SharePoint without issue… until this morning.

    Admin users are able to select the SharePoint app from the Office 365 homepage and be directed to our organization’s SharePoint sites (https://xxxxxxxxxx.sharepoint.com/_layouts/15/sharepoint.aspx).

    When any other (non-admin) user attempts these steps, they receive the following message:

    Server Error in ‘/’ Application.


    Runtime Error

    Description: An
    application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server
    machine.            

    Details: To enable the details of this specific
    error message to be viewable on remote machines, please create a <customErrors> tag within a “web.config” configuration file located in the root directory of the current web application. This <customErrors> tag should then have its “mode”
    attribute set to “Off”.

    <!-- Web.Config Configuration File -->
    
    <configuration>
        <system.web>
            <customErrors mode="Off"/>
        </system.web>
    </configuration>

    Notes: The current error page you are seeing can
    be replaced by a custom error page by modifying the “defaultRedirect” attribute of the application’s <customErrors> configuration tag to point to a custom error page URL.

    <!-- Web.Config Configuration File --> <configuration> <system.web> <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/> </system.web> </configuration>

    An admin and a regular user can attempt to access SharePoint on the same workstation, and, still, only the admin can view it.

    I have read through forums regarding this message and they all say that it is an IIS issue. We installed IIS on 1 server this morning, which is when people started to report the issue. I stopped IIS on the server, but the issue remains. But, since we aren’t
    hosting SharePoint ourselves and accessing it through a 365 subscription, I don’t think this should matter anyway.

    I also read that the web.config files should be edited at the following directory: C:inetpubwwwrootwssVirtualDirectories… 
      
    We don’t have that directory on the server that is running IIS (or on any other server, for that matter). The furthest
    the directory goes is 
    C:inetpubwwwroot

    • Edited by

      Tuesday, June 5, 2018 5:00 PM

Answers

  • The Microsoft Support team opened a ticket for this issue and it has been “resolved”. They had grant permissions to all of the users again.

    Here it is, Barney style:

    1.) Go to your site page (https://xxxxxxx.sharepoint.com/SitePages/Home.aspx(

    2.) Click on the Settings gear icon on the top right, go to Site Settings

    3.) Click on Site Permissions

    4.) Grant permissions to your users

    So simple, but something that I didn’t even think about because they could still access SharePoint via OneDrive and direct URL.

    THANK YOU, DALE AND ETHAN!

    Bowing Down Waynes World GIF - Find & Share on GIPHY

    • Marked as answer by
      davisa216
      Wednesday, June 6, 2018 9:48 PM

  • Partition Wizard

  • Partition Manager

  • 4 Ways to Fix “Server Error in ‘/’ Application”

4 Ways to Fix “Server Error in ‘/’ Application” [Partition Manager]

By Linda | Follow |
Last Updated December 28, 2022

Have you encountered “Server Error in ‘/’ Application“? The causes of the error may be various. In this post, MiniTool Partition Wizard lists some common reasons of this error and offers you corresponding solutions.

“Server error in ‘/’ application” issue is an application error on the server that prevents the website from running. And this error is usually related to IIS and ASP.NET.

  • IIS (Internet Information Services): It is an extensible web server service created by Microsoft for use with the Windows NT family. It is a kind of web server. Once a website is created, it must have a web server. Thus, others can browse your website.
  • NET: It is a category library provided by Microsoft in the .NET Framework for developing Web applications. It can run on the IIS server with .NET Framework installed, and use HTML, CSS, JavaScript and server scripts to create web pages and websites.

“Server error in ‘/’ application” issue may be caused by various reasons. Some of the most common reasons include:

  • IIS has some problems and needs to be restarted.
  • It’s just a 404 error. The resource you are looking for is missing or has been renamed.
  • You are accessing a file with a file extension that does not have permissions to be run on the server
  • You are using a version of .NET Framework incompatible with some programs, features, and file types.

If you don’t know what causes your “Server error in ‘/’ application”, please check the error description on the error page.

[Solved] 9anime Server Error, Please Try Again on Windows

How to Fix “Server Error in ‘/’ Application”

To fix the “server error in ‘/’ application”, you can use the following methods.

Fix 1. Restart IIS

  • Click the Start button in the lower left-hand corner and then choose Administrative Tools
  • Click Internet Information Services (IIS) Managerto launch it.
  • In the IIS manager, select the server in the left-hand window pane and then click Restart on the left-hand side.

Fix 2. Update the URL

If the “server error in ‘/’ application” is a 404 error, you just need to correct the URL in the link that triggers this error.

Search Google or Type a URL, What Is It & Which to Choose?

Fix 3. Add the MIME Type

If a file does not have permissions to be run on the server, you should first check if you are calling the correct file name. For example, is there a typo in the file extension? If the file name is correct, then you may need to add the MIME type of the file extension to the server.

If don’t know the MIME Type of a file extension, you can search it online. Then, you can add the MIME type in the IIS Manager through the following steps:

  • Open the IIS Manager
  • In the left-hand window panel, expand your server > Sites > Default Web Site.
  • In the central pane, double-click MIME Types.
  • Under the Actions column on the right, click .. button. This will open a window.
  • In the pop-up window, fill in the File name extensionand MIME Type, and then click OK.

Fix 4. Verify the .NET Version

  • Open IIS Manager
  • Expand the server in the left-hand window panel and choose Application Pools.
  • Right-click on an app and choose Basic Settings…
  • In the pop-up window, select the .NET version from the drop-down menu, and then click OKto confirm your choice.

Top 5 Ways to Fix .NET Framework 3.5 Missing in Windows 10

About The Author

Linda

Position: Columnist

Author Linda has been working as an editor at MiniTool for 1 year. As a fresh man in IT field, she is curious about computer knowledge and learns it crazily. Maybe due to this point, her articles are simple and easy to understand. Even people who do not understand computer can gain something.

By the way, her special focuses are data recovery, partition management, disk clone, and OS migration.

Добавить комментарий