IIS 10 - Missing Managed Handlers Types - windows-server-2016

Recently we upgraded one of our internal servers from Windows Server 2012 R2 to 2016. There were some missing configurations in IIS and I had to reinstall extensions like Web Platform Installer, URLRewrite etc.
This upgrade also broke our .NET Core 3 hosted website and upon some investigation I found that handler configuration seems to be missing in IIS. I need help restoring the handlers.
Thank you

Input your type name manually. Sometimes it could not load type names in dropdown list.

You can try the following steps to solve the problem:
run the aspnet_regiis -ir
For x86, run C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -ir.
For x64, run C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe -ir.
Or
click Revert to Parent in the right nav of IIS in the Handler
Mappings section.

I reinstalled .NET 4.8, .NET 3.1 Core one more time to get it work. Restarted a few times in between. Not sure which one did the trick exactly though!
Thank you all for your help!

Related

"Unrecognized attribute 'secure'. Note that attribute names are case-sensitive." when running website on IIS

I am having a problem with configuring my ASP.NET project on IIS. I have exactly 2 same servers (I mean same IIS settings everything) created from the same image. However, one is working fine, while for the other one, I am facing the problem "Unrecognized attribute 'secure'. Note that attribute names are case-sensitive." (pls see the screenshot below)
Does anyone know what might be the root cause of this and how to resolve it? Thank you.
This error is usually caused by an incorrect .net version, you can try follow steps:
Check on which .NET version the application is developed. Let's assume, it's .NET 4.0.
Open IIS Manager and find the Application Pool, on which your website is hosted.
Go to that Application Pool and check the .NET version and change it to 4.0 accordingly by clicking on Basic and Advanced Settings.
If .NET 4.0 is not listed, go ahead and install it.
If it still won't show up, go to command prompt and fire the below command to find a list of ASP.NET versions installed: C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis.exe -lv
In the output, if .NET 4.0 is not listed, register it by firing the below command: C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis.exe -I.
It should show up as .NET 4.0 in the .NET Framework Version dropdown for the application pool.

Error when trying to open my asp.net 4.5 MVC web application using VS 2012. Asp.net has not been registered on the server

I have a Windows Server 2012 R2 & Visual Studio Professional 2012. now i use to develop an asp.net 4.5 mvc 4 web application without any problem. but now when i try to open the project i will get this error:-
if i click OK then this error:-
if i click OK the visual studio will stop working
so can anyone adivce what is going on ??
and here is how the Turn windows features on/off looks like:-
Now i did this modification, as i read on a post in the internet that deleting the cache might help. so i removed this folder:-
%LocalAppData%\Microsoft\VisualStudio\11.0\ComponentModelCache
then i tried to open the Visual Studio, and i got the same 2 errors, but the visual studio did not stop working, and i was able to modify the code i rebuild the project and run it.. so not sure what is going on ?
aspnet_regiis -i
Using the ASP.NET IIS Registration tool, you can perform tasks such as the following:
Register or remove the .NET Framework ASP.NET installation with IIS.
Create new ASP.NET application pools.
Display the status of all installed versions of ASP.NET.
More here
Edit 1:-
dism /online /enable-feature /featurename:IIS-ASPNET45 /all
Try running this command
Edit 2:-
Try downloading and installing this update
This is a related tweet
If you get KB3002339 hanging kill the VSUpdate process in task manager. Windows Update will finish. Bing/Google KB3002339 install manually.
https://twitter.com/blowdart/status/542542342075346945
In order to resolve this error you have to install related version of .Net framework in your system.
First install IIS if not installed.
Then run following command:
C:\Windows\Microsoft.NET\Framework\v4.0.30319> aspnet_regiis -i
OR (Depens on your OS)
C:\Windows\Microsoft.NET\Framework64\v4.0.30319> aspnet_regiis -i
And in IIS your site should run on pool with version like : .Net FrameWork v4.0.xxxxxx
Open your solution as an Administrator
Maybe this answer comes too late, but I tried the solution from #Sameer referring to this question stackoverflow.com/questions/13749138/asp-net-4-5-has-not-been-registered-on-the-web-server#13749209
aspnet_regiis -i
didn't work for me aswell, but this update fixed the problem for VS 2012
For Visual Studio 2012 you actually need to download an update to fix it from here: support.microsoft.com/en-us/kb/3002339 – Sameer Nov 16 '15 at 21:17
See if the computer has self updated to .NET 4.6 (due to Windows Update task).
In some situations, the installation of .NET 4.6 may impact on Visual Studio 2012.
In my case I had to upgrade my project to NET 4.6 to solve the problem.
In relation to IIS itself, I guess you may be forgotten some feature - as HTTP which I guess is necessary, even if you won't utilize it directly. Check all features and toogle OFF just those really optional (like FTP).
This reminds me of similar issues I have seen in the past and I strongly suspect it's an installation order related thing which ultimately boils down to the aspnet_regiis command which has been mentioned already (here's some more information on this topic: https://rockyprogress.wordpress.com/2011/09/06/iis-7-5-and-net-framework-4-installation-order-does-matter/).
You would generally want to install IIS first and then .NET afterwards. So I suggest you get rid of the .NET 4.5 installation again by using the "Turn Windows Features On/Off" screen and then later simply add it back in.
Please try below point
1) open Visual studio run as administration
2) Please host your site in IIS (Not on port like localhost:65389...)
3) Make sure about application pool (with framework 4.0)
4) run C:\Windows\Microsoft.NET\Framework\v4.0.30319> aspnet_regiis -i command

Not able to install IIRF on Windows Server 2012 / IIS8

Not able to install iirf on Windows Server 2012. I used this msi file from codeplex: "Iirf2.1-x64"
http://download-codeplex.sec.s-msft.com/Download/Release?ProjectName=iirf&DownloadId=261341&FileTime=129654893866170000&Build=21018
Getting below error, couldn't find much help on Google or SO so far!
Setup for Ionic's ISAPI Rewrite Filter 2.1 ended prematurely
Anyone experienced or solved this?
You install IIRF by going to the IIS MMC snap-in and either at server level (for all websites) or on each website, you choose the ISAPI filters and click add, then just look for the DLL, click OK, restart IIS and you are done, no need to use the MSI. For IIS8 you need a version that's not available at the IIRF CodePlex project official site. I have been given a new version revision that works in IIS8+, this is version IIRF-2.1.2.4-x64 and I have made it available on my website (http://www.nelsonpires.com/web-development/ionics-isapi-rewrite-filter-aka-iirf-for-iis8/) for anyone to download and use. I have tested it and confirm it works great on IIS8.5. Hope this works for you too.
See my answer on the other related question here: IIRF on IIS8 / Window Server 2012 Throwing w3wp.exe Exceptions - there's a fix for it.

Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive

I'm trying to up load my site and I'm getting this error message:
Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.
<compilation debug="true" targetFramework="4.0">
The site works fine on my local PC but won't open when I loaded it to my host and tried to view it online.
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.
Registering the framework with IIS is what worked for me:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -i
In IIS
Click on Application Pools
Right Click on DefaultAppPool --->> Set Application Pool Default....--->>Change .Net Version to V 4.0.
open your IIS (type inetmgr in run) and change your Application pool setting,To view large this Image Right Click Image and open image in new tab
In Visual Studio menu:
Website -> Start Options -> build tab -> Select Target Framework in
Dropdown box (.NET FrameWork 4)
I was facing the same issue while publishing my 1'st web services. I resolved it by simply doing this:
Open IIS
Click on Application Pools
Right Click on DefaultAppPool => Set Application Pool Default => Change .Net Version to V 4.0. (You can also change
.Net Framework Version of your application specifically)
Hope, it'll work.
for IIS 7 try according to the given picture ... mark me helpful if it works for you.
I had to register ASP.Net in IIS to get it resolved in the Windows Server 2008 R2. Sreenshot of the commands attched below
cd /d C:\Windows\Microsoft.NET\Framework\v4.0.30319
iisreset /stop
aspnet_regiis -i
iisreset /start
%systemroot%\system32\inetsrv\appcmd set config /section:isapiCgiRestriction /[path='%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll'].allowed:True
%systemroot%\system32\inetsrv\appcmd set config /section:isapiCgiRestriction /[path='%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll'].allowed:True
I'm using IIS Express, rather than IIS.
The problem was in the applicationhost.config file located in: {solution_folder}\.vs\config\applicationhost.config.
One of the application pool entries had a managedRuntimeVersion value of "v2.0". I changed it to "v4.0", and it worked properly.
I'm fairly sure the root cause was one of the NuGet packages I had installed recently.
<system.applicationHost>
<applicationPools>
<add name="BadAppPool1" managedRuntimeVersion="v2.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" />
</applicationPools>
</system.applicationHost>
Change the application pool to target framework 4.0 instead of classic .
RC website ->manage website->advanced setting>
the first option change from classic to framework 4 integrated.
Open Project -> press Shift + F4 (Open properties page) -> Chose Build -> in Target Framework chose .NET Framework 4 -> OK
I also got the same issue while running my application locally which is pointing to .Net Framework 4.7.1.
The bug was "Unrecognized attribute TargetFrameWork" as shown below.
But none of the above answers helped me. At last when I changed my present port (1413) number to some other value(60179) as shown below it worked fine for me.But I am not sure for the actual reason behind this , but it worked.
Create a new pool by selecting .Net Framework v4.0.3xxxxx
use the Manage Pipeline Mode: Integrated
Assign it to your site and done.
To fix this problem simply click the ASP.NET Version icon in the Site Tools section of Control Panel to switch the framework to 4.0.
I had this error from a failed MSBuild compile, in a project file converted from an earlier version of VS into VS2010 and .NET 4.0. It was actually a Web Deployment project, and the solution that worked for me was adding the following entries into the PropertyGroup section at the start of the MSBuild file:
<ProductVersion>10.0.11107</ProductVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
Maybe these get automatically updated when other types of project are converted in VS2010, but they were missing from my Web Deployment project file after it was converted.
What I did:
I did change the value of Application Pool to DefaultAppPool from a previous value. You do this in the Advanced Settings (Website --> Manage Website --> Advanced Setting>.
Just had this in VS 2010.
Fixed by editing the .sln file and changing the TargetFrameworkMoniker to have the value ".NETFramework,Version%3Dv4.0" assigned to it.
If you're using IIS Express, it creates a new configuration for each site that you run, and it's bound to the url (host/port). However, when it opens a new project using the same port it doesn't refresh the configuration.
This means that if you have a project using CLR 2.0 (.NET Framework 2.0 to 3.5) running on some port and then later you open another project in the same port using CLR 4 (.NET Framework 4.x+) the new project will try to run using CLR 2, which fails - and in case it doesn't even recognize the "targetFramework" attribute.
One solution is cleaning IIS Express sites, but the easiest method is changing the port so that IIS Express will create a new site (using CLR 4) for your project.
If you compile the files and the value of the "targetFramework" is set as being a particular version i.e. 4.0,
Make sure the host is running .net framework as the same version stated.
If not, download the .net framework.
After downloading, if it is not automatic being set in the IIS manager to be using the extension of the newly downloaded version of .net framework,
add the extension manually by going to the folder of the recently downloaded .net framework THROUGH IIS manager:
1.right-click website folder
2.go to "Properties"
3.under "virtual directory" , click "configuration"
4.edit the executable path of extension ".aspx" (of which the path being pointed to version other than the version of the recently downloaded .net framework) to the correct path which is the folder of the NEWLY downloaded version of .net framework and then select the "aspnet_isapi.dll" file.
5.click ok!
Just Remove the "Target Framework 4.0" and close the bracket.
It will Work
Follow these two steps:
Register the .net framework version version 4.0 (if it is not registered)
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -i
In the app pool change the .net framework to v4.0
If you install the IIS after the installation of .Net FrameWork. You need install the .net framework again for IIS. So all we need to do is run aspnet_regiis -i. Hope it is helpful.
Saw the error "Unrecognized attribute 'targetFramework'" in the 'Console output' page of Jenkins on a build server.
This was after I changed the 'target framework' for several projects from '.NET Framework 3.5' to '.NET Framework 4' and committed my changes.
In Jenkins the project settings had to be changed. For the solution the 'MSBuild Version' had to be changed from 'v3.5' to 'v4.0'.
Just had this issue deploying a new app to an old IIS box. The investigation led to the v4.5.1 run-time being installed but the app requiring v4.5.2
Nothing apart from installing the correct version of ASP .Net run-time was required.
It could be that you have your own MSBUILD proj file and are using the <AspNetCompiler> task. In which case you should add the ToolPath for .NET4.
<AspNetCompiler
VirtualPath="/MyFacade"
PhysicalPath="$(MSBuildProjectDirectory)\MyFacade\"
TargetPath="$(MSBuildProjectDirectory)\Release\MyFacade"
Updateable="true"
Force="true"
Debug="false"
Clean="true"
ToolPath="C:\Windows\Microsoft.NET\Framework\v4.0.30319\">
</AspNetCompiler>
For layering,
Just change the version of targetFramework in web.config file only, the other things no need change.
I had the same issue and I found this nice poweshell script to update all of your app pools at the same time:
https://gallery.technet.microsoft.com/scriptcenter/How-to-set-the-IIS-9c295a20
Make sure to set you $IISAppPoolDotNetVersion = "v4.0" variable at the top.
following 2 steps will force refresh Visual Studio and IIS Express cache and usually resolve my similar issues:
Simply switch Project framework from 4+ to .Net framework 3.5 and run it
If it ran successfully you can revert it back to your desired 4+ target framework and see that it will probably work again.
Changing the port number for the local development helped me Thanks #Rinay Ashokan.
I have done all the trouble shooting and finally found that the project configurations are stored in the IIS express for the port number.
For anyone having this who doesn't have IIS running on their dev PC, here's what happened to me: I had one website on, overwrote with files from a diff website that was 4 while the previous was 3.5. Got this error. Fixed it simply by changing the directory name of the website, which on a dev PC can be anything, so no problem.
The above are probably more elegant to be sure, but sometimes simple works, IF you can get away with it, i.e., you're in dev rather than QA or Prod.

ASP.Net Application deployment on Windows Server 2003

I'm trying to deploy an ASP.Net application I developed to a Windows Server 2003 System but I get a error message when running the Site.
The first thing is that I get a Null Reference exception when I want to access my custom configuration section. So I figured that maybe the System.Configuration Assembly might not be installed. However I removed the reference and included the database directly into code to see if it works without.
But now I'm getting another error that a third party server control is not recognized.
Error Message: Server label
"trirand:JQGrid" unknown.
The same application runs just fine on my XP machine with IIS 6 installed so I wonder if I'm missing some installation. This is the first ASP.Net Application on that machine as before there were only ASP tools. I think that the .Net Framework 3.5 SP1 is installed but I'm not sure. Another question is if the ASP.Net is integrated into the .Net Framework of if I need a different install package.
Update:
I experienced a weird behaviour: I added the obviously wrong element <asdf> to the web.config file. On my development machine that gave me the expected error, but on the server nothing happened at all. So it seems like it some does not recognize my web.config file.
You need to check if the windows server system is loaded with the software your application required.
The folder v3.5 should be there in the following location.
C:\WINDOWS\Microsoft.NET\Framework\v3.5
Also you need to check if asp.net is installed on the system, if you are not sure then do install it, installing it if it is already there have no side effects.
To install asp.net type the following commands in DOS prompt.
cd C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
// then
aspnet_regiis.exe -i
Then also, confirm in IIS that correct version of asp.net is selected for your website.
To check; go to your website properties in IIS
then select ASP.NET tab then check ASP.NET version it should be 2.0.50727 for websites below .net version 4.0
Good Luck!

Resources