Unrecognized attribute 'targetFramework' error - asp.net

I have deployed my websitete using filezilla client. But i encounter the following problem.
Collapse | Copy Code
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 6: <configuration>
Line 7: <system.web>
Line 8: <compilation debug="true" targetframework="4.0">
Line 9: <assemblies>
Line 10: <add assembly="sysglobl, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /></assemblies></compilation>
Source File: C:\Inetpub\vhosts\dhuvara.com\httpdocs\sub\asp\web.config Line: 8
I red all the error details regarding this error. everything says that change the framework to 4.0. but actually i am using framework 4.0. i dont know to how to solve it?

Default framework of your webserver may be 2.0 or something.
If you have access to your IIS web server, please check the target framework of the application pool. Change the target framework of the application pool of your website to 4.xxxx.

Related

Server Error in " <authentication mode="None" /> "

I'm following a tutorial that says:
1 - The first step before adding ASP NET Identity is to disable the default authentication mechanism of the application server (IIS) because the framework uses its own. To do this, add the following configuration in the "system.web" section of the Web.config file:
<authentication mode="None" />
So, my web.config now looks like this:
<system.web>
<authentication mode="None" />
<compilation>
<assemblies>
<add assembly="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
</system.web>
but when I try to run the application, I get the 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 35:
Line 36: < system.web >
Line 37: < authentication mode="None" / >
Line 38: < compilation >
Line 39: < assemblies >
I tried to search for answers, but I found nothing. Specially considering that, as this computer is not mine, I can't do anything that requires admin permissions, so, I can't follow this guide to configure a virtual directory as IIS application .
Try the following steps:
Open IIS Manager
Expand the tree: Sites >> Default Web Site
Right click on your site and choose Convert to Application >> OK
I had the error, too.
The answer is:
"This error can be caused by a virtual directory not being configured as an application in IIS."
A virtual directory being configured as an application in IIS. Just try it, and it will ok

Error occurred during the processing of a configuration file required to service this request

I have copied a client's web application to my C:\inetpub\wwwroot.
I aslo run Aspnet_regiis.exe -i to solve a previous error I was having
Now I have 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: 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 31:
Line 32: <compilation debug="true" targetFramework="4.0" />
Line 33: <authentication mode="Forms">
Line 34: <forms loginUrl="~/Default.aspx" timeout="2880" />
Line 35: </authentication>
Source File: C:\inetpub\wwwroot\site\web.config Line: 33
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18408
I have tried to run the application: http://localhost/site/Default.aspx. How do I fix the error?
Go to your IIS management console, find the directory called site under the Default Web Site (which is under the Sites node), right click on site and choose Convert to Application.

How to solve the following errors in Web.config

here is the error that is occuring at runtime
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 25: ASP.NET to identify an incoming user.
Line 26: -->
Line 27: <authentication mode="Forms"/>
Line 28: <!--
Line 29: The <customErrors> section enables configuration
Source File: F:\Final Event Management\event management\web.config Line: 27
and it is the coding in which error is genrating
<?xml version="1.0"?>
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<compilation debug="true" targetFramework="4.0">
</compilation>
<authentication mode="Forms"/>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/></system.web>
</configuration>
please solve this problem.............
Create a virtual directory and see if that solves the problem:
How to: Create IIS Virtual Directories in Visual Studio
Right-click project node in Solution Explorer Window and select Properties, then the Web tab and you should see a button to create a virtual directory for your site.

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

ASP.NET 4.0 runtime error on first loading of page

I newly converted my solution to .NET Framework 4.0
After it I got very wired error. Each first load after building my app I get filenotfound exception. here it is:
Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.
Source Error:
Line 9:
Line 10:
Line 11:
Line 12:
Line 13:
Change in your web.config file
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<customErrors mode="Off"/>
<authentication mode="None"/>
</system.web>
Check if every mdule that you use on web.config is version 4. I think that you have miss a version 2.0 of the System.Windows, or a similar.
Especial Check this entries.
<compilation targetFramework="4.0">
<assemblies>
It happened to me something similar. I had a reference to an assembly in the web.config file and I was missing the ddl file in the project references folder. Try reference this assembly (System.Windows). Also you can check if the referenced version of the ddl has matching version with the one specified in the web.config (Version=2.0.5.0).
Since you said you've recently converted your app to .NET 4.0, please check the .NET version of your app's Application Pool in IIS. If it's 2.0 change to 4.0. Also check if you have properly referenced all your assemblies in your server.

Resources