We have deployed a .net 4 asp.net site on IIS 6.0.
Default.aspx is configured as one of the default document.
When we access the site using the following url
http://testsite
We expect it to render
http://testsite/Default.aspx
But instead we get 404 Not found error. We did not had this issue when it was deployed on .Net 2.0. Only thing that has changed on the server is that we use .NET 4 instead of .NET 2.0.
UPDATE: I tried the following link but it did not work.
Getting an ASP.NET 4 application to work on IIS6
The framework version on the server is .NET 4 RC. Will it help if we install the latest .NET 4 version on the server?
Update: The issue is resolved now. The problem was a Third party upload control that we were using which added its own HttpHandler in Web.Config. This HttpHandler started failing in the .NET 4.
With the new .NET 4 framework, comes some problems if you are running it on IIS 6 Windows Server. IIS 6 does not let you have more than one framework at the time running in the same instance like IIS7 that can create Application Pool targeting different framework.
When IIS 6 runs under ASP.NET 2.0 (3.0 and 3.5 are superset, not frameworks) you are going to hit this error if the application is 4.0
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 11: </configSections>
Line 12: <system.web>
Line 13: <compilation debug="true" targetFramework="4.0">
Line 14: </compilation>
Line 15: <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/> </ system.web>
You have a few options;
Downgrade the .NET application to 3.5 that Visual Studio 2010 makes it really easy. Just go to the Website properties -> Application tab and there is a drop down with all the framework releases, select 3.5, you VS2010 will reload the project and modify the web.config, if you added web service reference, that you may have to delete them and re-add them under 3.5
To configure the IIS6 and web config to solve the issue.
I deal with the second part:
In IIS 6 console, you need to right click you project and click the property and check the ASP.Net tab whether Framework 4 is selected or not. If not select the framework 4.
But still you might face the same error because of the application pool; you might have same application pool for two different framework web application.
IIS 6 does not let you have more than one framework at the time running in the same instance (means single application pool can’t use for two different frameworks) like IIS7 that can create Application Pool targeting different framework.
To solve this issue you need to create application pool and assigned this application pool to you framework 4 web application.
To assign the application pool, in IIS console open the properties section of the web application, and click on the “Home directory” tab and selection application pool which you have created earlier from drop-down-list.
This two might now solve your problem completely sometime. You can get the error as
“404 Page is not found”.
Though you might now have any issue while in development time.
Basically page is not found issue is cause of other problem which is set hidden by is IIS6 . But you need to see the real cause. What you have do here is go to the IIS6 console open “web service extension node” which is right below the “default website” node. You will see the entire ASP.Net framework list over there, by default these frameworks might be prohibited so please select ASP.Net Framework 4 and click allow button.
Browse you website now, you get other error beside “404 Page is not found”. You might get the error as listed below:
The value for the 'compilerVersion' attribute in the provider options must be 'v4.0'
You’ll see following error when browsing the website
The value for the 'compilerVersion' attribute in the provider options must be 'v4.0' or later if you are compiling for version 4.0 or later of the .NET Framework. To compile this Web application for version 3.5 or earlier of the .NET Framework, remove the 'targetFramework' attribute from the element of the Web.config file.
To solve this issue, you need to modify your web config file as below:
Previously the CompilerVersion value is set as v3.5 but we already change our targetFranework to 4. Thus according to the error message above the 'compilerVersion' attribute in the provider options must be 'v4.0' or later if you are compiling for version 4.0 or later of the .NET Framework.
Hence your new setting will be as below:
<providerOption name="CompilerVersion" value="v3.5"/>
Hope this will solve your ASP.Net 4 migration and hosting issue at IIS6.
Here is a link to a more complete solution and explanation of this:
http://johan.driessen.se/archive/2010/04/13/getting-an-asp.net-4-application-to-work-on-iis6.aspx
Check the server logs, they will probably give you a better idea of what is going on.
You can find the path to the log file by right clicking the website in IIS and go to properties. Then goto the Web Site tab, under 'Enable logging' click properties and the logging properties window will show up which displays the path to the log file.
I think in 4.0 the default page setting is actually stored in the web.config. With the IIS 7.0 , IIS reads the web.config the determine what to do for the default page. I think IIS 6.0 is not reading the setting.
Related
I know there are related posts here on this forum and another resources but I got stuck with this and couldnt proceed.Problem is i've done a website with vs2010 when i publish it to ftp server and navigate to url adress I got this error. Here the things that i've done
-I've enabled IIS services and static content
-I've revert to parent the staticFile under handler mappings
-I've registered the asp.net again in command prompt(the regiis.exe thing)
-In IIS manager i've added my website adress under sites, stopped default web site and started mine.
-I've added my site to classic.NET AppPool(integrated,and v4.0)
-I've enabled the default browsing..
-I've done all the advices that generally covered..
Here is my web.config
<configuration>
<system.webServer>
<directoryBrowse enabled="true" showFlags="Date, Time, Size, Extension" />
<defaultDocument>
<files>
<add value="AnaSayfa.aspx" />
</files>
</defaultDocument>
</system.webServer>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
</configuration>
where am I doing mistake? I've spent 2 days and couldnt proceed an inch.I will burst into tears if this problem solved.Any help will be greatly,greatly,greatly! appreciated,will be my hero,master (: thanks
Go to Command Prompt and install / repair ASP.NET
C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -i
Go to IIS => Select the Server Name (System Name)
Go to ISAPI and CGI restrictions
Allow the Not Allowed restrictions.
I got this working when i change the app pool's .Net framework version to my application's .net framework version.
My application's framework version was 4.0 but app pool's setting was defaulted to 2.0. I had to change it to 4.0, then it worked fine.
+1 with #Dablue, IIS 8.5 does not support the aspnet_regiis command anymore. For me, the issue is resolved by installing the "Asp.Net 3.5" or "Asp.Net 4.5" under
Web Server > Application Development.
#regeme - I was experiencing a similar problem when trying to run my own site and after a lot of digging I finally resolved it. In my case it was related to a *.json file trying to be loaded and no rules being initialized for it. If you look closer at your error it should give you an idea of what it is IIS is not loading.
After looking at the web inspector's network tab I was able to see which items were returning 404's they were all *.json.
I'm assuming since your error is returning a "content appears to be script and will not be served by the..." it is the same case.
My resolution:
A) It is possible you have already done this as it would throw another error, I'm just covering our bases.
Go to IIS HTTP Response Headers
create a mime-type ".json" "application/json"
B) **SEE NOTE
Go to Handler Mappings.
Set Request Path: to "*.json"
Executable: to "C:\Windows\System32\inetsrv\asp.dll"
C) You may want to restart your service at this point again just to be safe this can be done in the IIS panel or cmd prompt.
Windows key + r
type: cmd and hit ctrl+shift+enter
type: iisreset and hit enter
*NOTE: This may save you a lot of headache, in my case I installed the 64 bit dll of asp.dll instead of the 32 bit version the folder for the 64-bit version is in C:\Windows\SysWOW64\inetsrv\asp.dll
IMPORTANT these file locations are in windows 8 and to my understanding are the same in windows 7 but this may not be the case for your OS double check.
Lastly if you are missing the asp.dll this is simply because you are missing windows features. Simply go to add/remove programs (Programs and Features)
Turn Windows features on or off
drop down Internet Information Services
drop down World Wide Web Services
check Application Development Features make sure it's not just a partial check and that all sub-items are being installed
On Windows 2012 and IIS 8.5 aspnet_regiis is no longer valid.
Instead, add the aspnet-4.5 rolefrom within server manager
Open server manager
in the left column select IIS
Scroll the right window until you see "Roles and Features"
Tasks select Add roles
Under "server roles" open "Web Server (iis)
open "Web Server"
open "application development"
Select "ASP.NET 4.5" (the "asp.net 4.5 extensibility" will not do it)
We got the same issue when hosting our MVC application on the web server. All the applications were working fine except the WCF service.
It was resolved, when we added a server role for .NET Framework 4.5 WCF service in Windows Server Manager.
Visit http://community.bamboosolutions.com/blogs/bambooteamblog/archive/2013/02/08/how-to-enable-and-use-net-framework-3-5-and-4-5-in-windows-server-2012.aspx
For me the issue was fixed by right click on Virtual directory-->convert to application
Check out this, in my case this solved the problem
https://support.microsoft.com/en-us/kb/2019689
This might help you
In this case, a 404.17 error is returned if the *.aspx resource being requested from the site is handled in an Application pool that is not running in Classic Mode, is not 32 bit, or is not running the 2.0 version of the .NET Framework. In order for the resource to be served correctly in this example, all 3 pre-conditions must be met. Specifically, the application pool hosting this resource would have to be configured for Classic Mode, it would need to be configured to use the 2.0 version of the .NET Framework, and it would need to be set for 32 bit applications.
I had to create a new Web Site. There was some invalid configuration in my Website level that referenced my application's virtual directory directly.
For example, https://server/app gives me the 404.17 error but https://server/app-test works successfully. Swapping the two application names (using appcmd) caused the working app-test (now renamed to app) to begin failing. After creating a new Web Site named MyApp Web Site I was able to again create a new app, this time named app that worked successfully.
After extensive review of Default Web Site we cannot identify what configuration is causing 404.17 for apps named app and not alternatively named apps like app-test.
I believe the ultimate cause of this, is I did not have .NET Extensibility Services and ASP.NET 4.5 added through the server roles and features—During installation. Thus, the installer of my app failed to successfully configure Default Web Site correctly. For example, the created app pool incorrectly installed with v2.0 Integrated and not v4.0 Integrated. After installing the required roles and features I verified ISAPI (64 bit v4) was configured correctly, and the App Pool was appropriately configured for v4 Integrated. Unfortunately, I cannot identify any additional settings that would cause this issue—especially explicitly targeting the app virtual path.
This solved the issue for me. +1 to all who spoke a reasonable solution without having to pass through a 3 ring circus.
Turn on IIS Windows Features like these
I'm trying to deploy my website on somee.com but keeps getting this error
I've tried googling and it says I have to change my App Pool to ASP.NET 4.0. I've tried that already but with no luck:(
Informations:
-My site was coded in 4.0 Framework
-I'm using .NET Framework v4.0 Integrated
-I have checked needed things already in Windows Features
-Im using ASP.NET MVC3
-I already typed cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319 then aspnet_regiis -ir to cmd
-64 bit OS
This is the steps how I publish my site
First I manually added this things to my Reference then changed the Copy Local to True
Microsoft.Web.Infrastructure
System.Web.Helpers
System.Web.Mvc
System.Web.Razor
System.Web.WebPages
System.Web.WebPages.Deployment
System.Web.WebPages.Razor
I Editted this on my Web Config
<configuration>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true" targetFramework="4.0"/>
<authentication mode="None"/>
</system.web>
</configuration>
I add Deployable Dependencies that created _bin_deployableAssemblies which have this inside
Microsoft.Web.Infrastructure.dll
System.Web.Helpers.dll
System.Web.Mvc.dll
System.Web.Razor.dll
System.Web.WebPages.dll
System.Web.WebPages.Deployment.dll
System.Web.WebPages.Razor.dll
I then click Publish and have this settings
This is how I Publish is this ok or I have to change something here?
I went to my IIS Manager. I right click on Default Web site Under Sites and choose Add Application with this settings
This resulted to this
I went to C:/inetpub/wwwroot and sees this files
I then compressed it as zip then uploaded it in my account in somee.com then checked my site and now I'm getting the Configuration Error above.
ABOVE IS MY UPDATED QUESTION I REPUBLISHED MY SITE AND INCLUDED STEPS HOW I PUBLISHED IT . I INCLUDED IT SO THAT YOU GUYS COULD SUGGEST IF I'M DOING SOMETHING WRONG ON HOW I'M PUBLISHING MY SITE AND COULD BE THE REASON OF THE ERROR ABOVE. THANKS IN ADVANCE :)
My site works fine in the iis of the localhost of my machine it only gets that error when deployed on the internet.
Btw I'm following the tutorials from these sites How to Deploy an ASP.NET MVC 3 App to Web Hosting with "\bin Deployment" Programming ASP.NET MVC 4 Chapter 19. Deployment Deployment ASP.NET MVC 3 project to IIS and somee
Question: What could be the cause of this issue :( It's my first time to deploy a website on the internet. Hopefully you could help me guys.. If you need more info please tell me.
My IIS Manager
My configuration
or could this be the reason of my issue?
OK THIS PROBLEM WAS SOLVED. I FOUND OUT THERE'S NO PROBLEM ON MY SETTINGS. THE PROBLEM IS ON THE SETTINGS OF THE WEBHOSTING SITE. I CHANGED THE ASP.NET VERSION FROM 2.0 TO 4.0 BUT FORGOT TO CLICK THE UPDATE BUTTON :( I FEEL BAD I HAVEN'T REALIZED THAT. I'M NOW FACING ANOTHER ERROR BUT IT HAS NOTHING TO DO WITH THIS QUESTION. THANKS GUYS FOR TRYING TO HELP ME :)
This typically happens when you have an attribute of targetFramework="4.0" in the web.config but the App Pool is set to run ASP.NET 2.0. The targetFramework attribute is entirely unrecognized by ASP.NET 2.0 - so changing it to 2.0 won't have the desired effect.
Contact Support / Your Administrator and have the AppPool switched to 4.0.
You could also remove the attribute entirely, however if your site was coded with the 4.0 Framework, then I'm sure something else will cause an error as well.
Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive
I was now able to find reason behind the error guys. It's on the webhosting site settings not on my app pool or what so ever. I changed the asp.net version from 2.0 to 4.0 but I forgot to click the update button. I feel so embarrased. :( I've been struggling for days to fix this error and only to found out its on the webhosting site settings. GgrrRR.. As of now I'm facing new error but has nothing to do with this question. Anyway thanks guys for your efforts to help me. :)
Try this, instead of selecting your websete's Application Pool to DefaultAppPool, select ASP.NET v4.0
Select your website in IIS => Basic Settings => Application Pool => Select ASP.NET v4.0
and you will be good to go. Hope it helps :)
Also try aspnet_regiis -u then aspnet_regiis -i on below path
C:\Windows\Microsoft.NET\Framework\v4.0.30319
Now restart the IIS and check
Hope this will help !
You could be using the 32 bit version, so you should prob try at the command line from the Framework (not Framework64) folder.
IE Did you try it from
C:\Windows\Microsoft.NET\Framework\v4.0.30319 rather than the 64 version? If you ref 32 bit libs you can be forced to 32 bit version (some other reasons as well if I recall)
Is your site a child of another site in IIS?
For more details on this (since it applies to various types of apps running on .NET) see Scott's post at:
32-bit and 64-bit confusion around x86 and x64 and the .NET Framework and CLR
Make sure that you are building your web app as "Any CPU". Right click your web project --> Properties --> Build --> and look for the "Platform Target". Choose "Any CPU" or play around with it.
Hope this helps!
Each individual Web App under an IIS Web Site can use a different App Pool.
Verify the App Pool assigned to your app (not just the root site per your pictures) is .NET 4.0 compatible:
Expand Default Web Site
Right click on ProjectPALS, choose 'Manage Application' then 'Advanced...'
Observe the 'Application Pool' your app is running as under the site
Change to another App Pool if neccessary
How are you running the application? Are you just hitting the website or are you building and running from within Visual Studio? If you are building and running you may want to tell it to use the local IIS web server. This would make sure it is using the App Pool you have set up to run with v4.0/integrated.
I am guessing that it is using the Visual Studio Development Server when running. This server is probably trying to run with the 2.0 framework. This then causes your error to be thrown.
Edit: To note, I normally just build my website application and then I attach to process w3wp when I want to debug. I do not use the publishing tool. Of course this means my local working directory is within the web root.
Have you tried the aspnet_regiis tool to register .Net 4.0 for IIS? You can check more at msdn
My problem was solved that way:
Your username is probably restricted, You must grant full access to the user.
Right Click on Project and select Properties
Click on Tab Security
Click Edit button
Found Current User and Permission for User Allow Full Control
If your application is 32 bit, and you want to deploy in a 64 bit machine, You need to set 'Enable 32 Bit Applications' property to 'True' in the application pool - advanced settings.
I developed a small ASP.NET 3.5 app. with only few pages and no DB connectivity. I am trying to publish it, but my website gives error:
**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 45:
Line 46: -->
Line 47: <authentication mode="None"/>
Line 48: <!--
Line 49: The <customErrors> section enables configuration
I am using Windows 7 with IIS 7. When I add a new website in IIS there are a few concerns here. Below are the images that show that something is wrong underhood:
While creating new application pool for an application built on .NET 3.5, I could not see the .NET Framework 3.5 in the list:
When I open the Add Website dialog, and click Test Settings, it gives this error:
Please let me know how to fix this issue. I also want to know whether I have to add a website or add a virtual directory?
from the error message you provided, you have to have a virtual directory defined for your app with the pysical path pointing to your ASP.NET app folder, and also have the virtual dir as an application ("Convert to application" in the context menu of the virtual dir node, i think).
you dont need to create an app pool , but its probably a good idea.
also the registration issue that the guys here explain is also a must.
You have to register .Net framework for IIS using aspnet_regiis -icommmand?
I have an asp.net 2.0 user control library that runs within a SharePoint site. We upgraded one of the assemblies that this application depends on to .net 4.0 so we were forced to update the website to an asp.net 4.0 site so that it could use that assembly. That caused us to run into this error:
Could not find permission set named 'ASP.Net'.
Which is documented here: http://www.asp.net/learn/whitepapers/aspnet4/breaking-changes#0.1__Toc256770151
and states:
"This error occurs because the ASP.NET 4 code access security (CAS) infrastructure looks for a permission set named ASP.Net. However, the partial trust configuration file that is referenced by WSS_Minimal does not contain any permission sets with that name."
Their proposed solution is don't attempt to use .net 4.0 which is not really an acceptable solution. So I'm trying to better understand what the actual problem. Our site is actually using a custom permission config based off of WSS_Minimal but it apparently includes the same reference. Can anyone tell me what file they are referring to when they say "the partial trust configuration file"? Where exactly does wss_Minimal reference this file? If the permission set named ASP.Net doesn't exist, I should be able to create my own permission set to take it's place. I'm not CAS expert but I haven't been able to find an ASP.Net permission set using the .net 2.0 configuration tool, and I'm not sure where it's being referenced in the wss_minimal config. Where is this ASP.Net permission set defined?
SharePoint 2010 is based on ASP.NET 3.5 and SharePoint 2007 is based on ASP.NET 2.0. So I'm guessing that you cannot do this (base your site .NET on 4.0).
I have been running a 4.0 App in a virtual directory in a MOSS 2007 site. I just installed Security Update for Microsoft Office SharePoint Server 2007 (KB2687405) 32-Bit Edition and BAM got the same error on the 4.0 App. Added
<trust level="Full" legacyCasModel="true" />
to web.config in the virtual directory and all's well.
You need to update Web.Config:
Set..
<trust level="WSS_Minimal"
As..
<trust level="Full"
Upgraded server Framework to 4.0. Using Godaddy hosting. The website is now showing this error
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
On searching the internet found this:
Error message when you visit a Web site that is hosted on IIS 7.0: "HTTP Error 500.0 – Internal Server Error"
The link above says:
Resolution 2
Make sure that the server that is running IIS 7.0 can access the configured root directory of the requested location.
I am not sure what to do.
Is your Application Pool running on .NET 4.0 or .NET 2.0?
http://technet.microsoft.com/en-us/library/cc754523(WS.10).aspx
Open IIS Manager. For information about opening IIS Manager, see Open IIS Manager (IIS 7).
On the Connections pane, expand the server node and click Application Pools.
On the Application Pools page, select the application pool for which you want to specify a .NET Framework version, and then click Basic Settings in the Actions pane.
In the Edit Application Pool dialog box, in the .NET Framework version list, select the version that you want the application pool to use or select No Managed Code if the application uses only native code.
Click OK.
Moving from comment to answer so answer may be marked for future reference
Not sure if this would help, but it's an issue I ran into when upgrading to .NET 4. The person who had managed the site before me had used IIS manager to configure settings and it added references to .NET 3.5 in the web.config. Removing all references/assemblies related to 3.5 and below fixed the issue.
This can also happen if you are using third party controls like Telerik or if something is wrong in the web.config file. Try to remove the httpHandlers/httpModules from web.config file and if this solves the problem, you can add them one by one to check which handler/module might be causing the problem.