ChatGPT解决这个技术问题 Extra ChatGPT

ASP.NET 4.5 has not been registered on the Web server

In my Win 7 development machine, and in order to use SQL Express instance instead of the localDB installed by default. I unchecked "Use IIS Express" in my MVC 4 project properties page (Web tab), then I got the following error:

ASP.NET 4.5 has not been registered on the Web server. You need to manually configure your Web server for ASP.NET 4.5 in order for your site to run correctly.

I verified that ASP.NET is activated within the IIS features.

Please what could be done to resolve this?

Just for others coming here: You also have to adjust your web.config file by adding the targetFramework="4.5" attribute to the <compilation> element.

A
Alex Filipovici

Maybe you have to execute the following in the Visual Studio Tools command prompt:

aspnet_regiis -i

You can read more about the ASP.NET IIS Registration Tool (Aspnet_regiis.exe) here.


aspnet_regiis -i is not recognized as internal command, this is the returned error message.
I could finaly resolved the issue, I have run Visual studio developper command prompt as Administrator then launched C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis -i
@Sami-L Important note: There's no actual need to use the VS cmd (which you probably don't have when you are installing a new OS). All you need is a command line (cmd) and run aspnet_regiis from the latest .Net framework library: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe /i
Today (2015) the issue is likely the bug mentioned in this answer: stackoverflow.com/a/30352820/1121033
For Visual Studio 2012 you actually need to download an update to fix it from here: support.microsoft.com/en-us/kb/3002339
N
NYCdotNet

On Windows 8.1, since .NET 4.5 is built-in, the fix is to run this from an administrative command-prompt:

dism.exe /Online /Enable-Feature /all /FeatureName:IIS-ASPNET45

Is /all necessary? Here: support.microsoft.com/kb/2736284 they do not specify it...
According to the dism command-line on Windows 8.1, /all automatically enables parent features. In this case, it specifically mentions NetFx4Extended-ASPNET45 and IIS-NetFxExtensibility45 if you don't specify /all.
It shows error:87 and gives a message that this feature is unknown. What to do?
Fixed the issue on Windows 2012 with IIS8
l
lasseschou

If you've installed .NET framework 4.6, you may see this error due to a VS bug. Workarounds and resolutions here:

http://blogs.msdn.com/b/webdev/archive/2014/11/11/dialog-box-may-be-displayed-to-users-when-opening-projects-in-microsoft-visual-studio-after-installation-of-microsoft-net-framework-4-6.aspx

EDIT:

As noted in some of the comments, this can happen behind the scenes after upgrading to Windows 10 or Visual Studio 2015.


Finally found the answer! This happen when I upgrade to Windows 10. Thanks
It happened to me when i added VS 2015 to my computer while i still have 2012
This fixed on Windows 10 with .NET 4.6 and VS 2012
This was the cause of my problem. Note though that update 4 is no longer the latest update.
Thank you so much. You saved my day. I had not installed .Net framework 4.6 explicitly. What I did was that I installed Visual Studio 2015 which resulted in implicit installation of .Net framework 4.6. After installation of VS 2015 I opened an existing solution in VS 2013 ( the solution was created in VS 2013 only) which started giving this asp.net 4.5 not registered error. More interestingly the "Download Visual Studio 2013 Update 4" link on this MSDN blog page takes you to download page of update 5 of VS 2013. I installed update 5 only and it solved my issue.
S
Sooraj

For Windows 8 client computers, turn on "IIS-ASPNET45" in "Turn Windows Features On/Off" under "Internet Information Services-> World Wide Web Services -> Application Development Features -> ASP.NET 4.5".


That's the same as running the command: dism.exe /Online /Enable-Feature /all /FeatureName:IIS-ASPNET45
H
Hugo Yates

The .net framework overwrites 4.0 folder so run this command:

Register .net framework to IIS goto Start -> run-> cmd -> run as administrator type:

cd C:\Windows\Microsoft.NET\Framework\v4.0.30319
aspnet_regiis.exe -i

R
Rahul Sonone

Resolved it with VS update.

Follow this link (https://blogs.msdn.microsoft.com/webdev/2014/11/11/dialog-box-may-be-displayed-to-users-when-opening-projects-in-microsoft-visual-studio-after-installation-of-microsoft-net-framework-4-6/)

Resolution: Microsoft has published a fix for all impacted versions of Microsoft Visual Studio.

Visual Studio 2013 –

Download Visual Studio 2013 Update 4 For more information on the Visual Studio 2013 Update 4, please refer to: Visual Studio 2013 Update 4 KB Article Visual Studio 2012

An update to address this issue for Microsoft Visual Studio 2012 has been published: KB3002339 To install this update directly from the Microsoft Download Center, here Visual Studio 2010 SP1

An update to address this issue for Microsoft Visual Studio 2010 SP1 has been published: KB3002340 This update is available from Windows Update To install this update directly from the Microsoft Download Center, here


Similarly, Microsoft Visual Studio 2013 Update 5 also resolved this issue for me microsoft.com/en-us/download/details.aspx?id=48129
+1 for including a reference link and including the snippet of text that includes the actual fix (so the answer survives the test of time once the url link goes stale).
T
Travis J

tl;dr; Clicking OK is the workaround, everything will work fine after that.

I also received this error message.

Configuring Web http://localhost:xxxxx/ for ASP.NET 4.5 failed. You must manually configure this site for ASP.NET 4.5 in order for the site to run correctly. ASP.NET 4.0 has not been registered on the Web server. You need to manually configure your Web server for ASP.NET 4.0 in order for your site to run correctly.

Environment: Windows 10, IIS8, VS 2012 Web.

After finding this page, along with several seemingly invasive solutions, I read through the hotfix option at https://support.microsoft.com/en-us/help/3002339/unexpected-dialog-box-appears-when-you-open-projects-in-visual-studio as suggested here.

Please avoid doing anything too drastic, and note the section of that page marked "Workaround" as shown below:

Workaround To work around this issue, click OK when the dialog box appears after you either create a new project or open an existing Web Site Project or Windows Azure project. After you do this, the project works as expected.

In other words, click OK on the dialog box one time, and the message is gone forever. The project will work just fine.


B
Bharath T

Not required to type c:\

Start -> run-> cmd -> Run as administrator and execute below command

.NET Framework version 4 (32-bit systems)

%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i

.NET Framework version 4 (64-bit systems)

%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i

Alternatively use Command Prompt from Visual Studio tools: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Visual Studio 2012\Visual Studio Tools>VS2012 x86 Native Tools Command Prompt

Version could vary.. Hope this helps.


M
Miros

I had the exact same problem, despite ASP.NET 4.5 appearing as installed under "Turn Windows Features On/Off". I tried everything until I finally removed ASP.NET 3.5 and 4.5 completely from under "Turn Windows Features On/Off", rebooted my PC and reinstalled them Again. That solved the problem.


And now the problem is back, even nagging me about ASP.NET 4.0 now... Does anybody know if this is a bug in VS2013?
u
user3833104

I was also having that problem. I tried the above solutions but didn't work for me.

The i installed the visual studio update and my issue was fixed.

Download the visual studio update from the link below http://blogs.msdn.com/b/webdev/archive/2014/11/11/dialog-box-may-be-displayed-to-users-when-opening-projects-in-microsoft-visual-studio-after-installation-of-microsoft-net-framework-4-6.aspx

Thanks!


Dead link, it raises "403 Forbidden" error.
B
Bharath T

For windows 10 with below error: Configuring Web http://localhost:64886/ for ASP.NET 4.5 failed. You must manually configure this site for ASP.NET 4.5 in order for the site to run correctly. ASP.NET 4.0 has not been registered on the Web server. You need to manually configure your Web server for ASP.NET 4.0 in order for your site to run correctly. Solution: https://blogs.msdn.microsoft.com/webdev/2014/11/11/dialog-box-may-be-displayed-to-users-when-opening-projects-in-microsoft-visual-studio-after-installation-of-microsoft-net-framework-4-6/


T
TPG

Something you need to add via the Programs & Features. Check out the link below that solved my issue. Just follow the steps below and you should get it.

Quoted from the link:

Once in the Programs and Features window, hit the "Turn Windows Features on or off" in the left pane. Now scroll down through the tree and find: Internet Information Services > World Wide Web Services > Application Development Features ...and then check all the relevant features you require. I chose .NET 3.5 and 4.6.

http://modelrail.otenko.com/electronics/asp-net-4-5-has-not-been-registered-on-the-web-server


E
Ethaan

I have the same problem.

And got the solution turning on the ASP Net from Turn Windows feature on or off menu.


C
Community

I have the same issue when using Visual Studio 2012. By turn on the IIS feature just not working, because I still received the error. Try the method but no lucky.

My solution is:

Download the hotfix.

At the command line, Restart IIS by typing iisreset /noforce YourComputerName, and press ENTER.


M
MarwaAhmad

Some IIS features to be enabled: Reference

DISM /Online /FeatureName:IIS-ApplicationDevelopment 
/FeatureName:IIS-ASPNET /FeatureName:IIS-ASP 
/FeatureName:IIS-NetFxExtensibility 
/FeatureName:IIS-ISAPIExtensions /FeatureName:IIS-ISAPIFilter

Then fix IIS mappings for ASP.NET, run the Aspnet_regiis.exe utility. Reference


D
David Fawzy

this link explains what cause the problem and the quick solve to the problem, it just by updating visual studio and it provide the link for the update

http://blogs.msdn.com/b/webdev/archive/2014/11/11/dialog-box-may-be-displayed-to-users-when-opening-projects-in-microsoft-visual-studio-after-installation-of-microsoft-net-framework-4-6.aspx


This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post.
H
Hema Shetty

Try this Once go to the Programs and Features window->, hit the "Turn Windows Features on or off" in the left pane.

Now scroll down through the tree and find:

Internet Information Services World Wide Web Services Application Development Features ...and then check all the relevant features you require. I chose .NET 3.5 and 4.6.

and if does not work then go to Let it do its work and then you should be back to happy-development-land in VS before you know it. If not, then it could actually be a bug in Visual Studio. Please check the following patches for your version of VS: VS2010, VS2012 or VS2013. This will surely help you out.


M
Mandar

run visual studio in admin rights and execute following "commandaspnet_regiis -i"


v
vaheeds

I had the same problem. After a long search , I change the application pool to ASP.NET v4.x in the IIS manager.