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.
Related
I'm trying to upload my c# site,
The sites seems to upload correctly,
But when I try to enter, I get the next 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 tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off".
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Now I add the customErrors mode="Off" to my Web.config:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<customErrors mode="Off"/>
</system.web>
</configuration>
And the new error is:
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: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.
Source Error:
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.
Source File: \blablablablablabla\public_html\myweb\web.config Line: 8
Version Information: Microsoft .NET Framework Version:2.0.50727.8793; ASP.NET Version:2.0.50727.8762
I tryed modifying it to 2.0 (because the error signature), also tryed to delete the targetFramework attribute, but nothing works.
Thaaaaanks.
Go to IIS,
Click on Application Pool--> on the right side --> Select your Site--> double click on it and change the .Net Framework to v4.0
I hope it will solve your problem.
Thnks.
I have asp.net project that I need to publish to Azure
Here is My webconfig file
<?xml version="1.0"?>
<!-- For more information on using Web.config transformation visit https://go.microsoft.com/fwlink/?LinkId=301874 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<connectionStrings>
<add name="MyDB"
connectionString="Server=tcp:vchasnotestserver.database.windows.net,1433;Initial Catalog=vchasnotestdb;Persist Security Info=False;User ID=***;Password=********;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
</system.web>
</configuration>
When I deploy to azure, I get this warning in output
2>C:\Users\nemes\Source\Repos\vchasnocrm-new\vchasnocrm\Web.Release.config(7,8): Warning : No element in the source document matches '/configuration/connectionStrings/add[#name='MyDB']'
How I can fix this?
According to your Web.config transformation under Web.Release.config, the transformation code is valid. For the warning message you provided:
Warning : No element in the source document matches '/configuration/connectionStrings/add[#name='MyDB']'
Per my test, it means that there does not exist a connectionString named MyDB under your Web.config file. So you could ignore this warning message. For overriding your connectionString before deploying to azure, you need to make sure there has a connectionString named MyDB, or you need to adjust the connectionString name under your Web.Release.config file.
Moreover, if you use Azure Web Apps to host your web application, you could leverage Application settings in Azure App Service to override your existing settings at run-time. For your requirement, you could log into Azure Portal and choose your web app, click "SETTINGS > Application settings" and add your connection string with the same name defined under your Web.config file. Details you could follow here.
I've been investigating this thing for hours but couldn't understand what's the problem causing this behavior.
I have built a simple ASP.NET MVC app to upload and delete photos from a predefined container on the Azure Storage Server.
It works perfectly when I run the application on my machine, locally.
Also, it works perfectly when I run this on my machine but the Data service is located on Azure.
But, when Publishing the application to Azure, surfing to this website runs to this uninformative error:
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 tag within
a "web.config" configuration file located in the root directory of the
current web application. This 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 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>
This doesn't tell me anything, also - nothing like this happens when running on my machine with Visual Studio.
If you have any idea what's going on here I'd really appreciate your help, thanks.
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
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="ConnectionInfo" value="server=127.0.1.1;database=Info_mgmt;Integrated Security=SSPI"/>
</appSettings>
<connectionStrings>
<add name="Info_mgmtConnectionString" connectionString="Data Source=daffodils\sqlexpress;Initial Catalog=Info_mgmt;Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0">
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/></system.web>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
</configuration>
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 7:
Line 8:
Line 9:
Line 10:
Line 11:
Source File: D:\Infopass\Infopass-Web\Infopass-Web\web.config Line: 9
The targetFramework attribute is specified on the <compilation> element under <system.web>. I have seen that error message when running sites in IIS 7.5 using ASP.NET 2.0 instead of ASP.NET 4.0. If this site is in IIS, then check the Application Pool the site is running under to make sure the Application Pool is using the .NET 4.0 Framework (instead of .NET 2.0 Framework).
Similarly, if you are attempting to run the site from the default web server in Visual Studio and you are seeing this error, you'll want to make sure the Target Framework for the project is set to .NET Framework 4.0 (under Properties > Build > Target Framework).
You need to set your application to use .Net 4.0 in IIS.