Register .NET Framework 4.5 in IIS 7.5 - asp.net-mvc-4

Pieces of the puzzle:
Windows 7
.NET Framework 4.5 (installed)
IIS 7(Version 7.5.7600.16385)
Visual Studio (Ultimate 2013)
MVC4 (multiple projects in the solution)
The solution I'm running in Visual Studio works and runs as expected with IISExpress.
To set up my site to use IIS, I tried the following steps:
Right-click the projects in the solution that are currently being hosted by IISExpress.
Click Properties.
Toggle the Servers drop-down from IISExpress to Local IIS
Try to build/run the application
At this point, I get an HTTP 500.21 error.
I have also tried to run aspnet_regiis.exe -i using Visual Studio's command prompt (as an Administrator), but each time I run the command, I receive the following error:
Command 'aspnet_regiis.exe' is not valid.
I also confirmed that I do have the right aspnet_regiis.exe installed (by checking here) (.NET Framework version 4 (64-bit systems)).
What do I need to do to register .NET Framework 4.5 in IIS 7.5?

You can find the aspnet_regiis in the following directory:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319
Go to the directory and run the command form there. I guess the path is missing in your PATH variable.

Hosting asp.net 4.5/4.5.1 Web application on Local IIS
1)Be Sure
IIS Installation before Visual Installation Installataion then aspnet_regiis will already registerd with IIS
If Not Install IIS and then Register aspnet_regiis with IIS by cmd Editor
For VS2012 and 32 bit OS Run Below code on command editor :
1)Install IIS First & then
2)
cd C:\Windows\Microsoft.NET\Framework\v4.0.30319
C:\Windows\Microsoft.NET\Framework\v4.0.30319> aspnet_regiis -i
For VS2012 and 64 bit OS Below code on command editor:
1)Install IIS First & then
2)
cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319
C:\Windows\Microsoft.NET\Framework64\v4.0.30319> aspnet_regiis -i
BY Following Above Steps Current Version of VS2012 registered with IIS
Hosting (VS2012 Web APP)
Create VS2012 Web Application(WebForm/MVC) then Build Application
Right Click On WebApplication(WebForm/MVC) go to 'Properties'
Click On 'Web' Tab on then 'Use Local IIS Web Server'
Then Uncheck 'Use IIS Express'
(If Visul Studio 2013 Select 'Local IIS' from Dropdown)
Provide Project Url like "http://localhost/MvcDemoApp"
Then Click On 'Create Virtual Directory' Button
Then Open IIS by Prssing 'Window + R' Run Command and type 'inetmgr' and 'Enter' (or 'OK' Button)
Then Expand 'Sites->Default Web Site' you Hosted Successfully.
If Still Gets any Server Error
like 'The resource cannot be found.'
Then Include following code in web.config
<configuration>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"></modules>
And Run Application
If still problem occurs
Check application pool by : In iis Right click on application->Manage Application->Advanced setting->General. you see the application pool.
then close advance setting window.
click on 'Application Pools' you will see the all application pools in middle window.
Right click on application pool in which application hosted(DefaultAppPool).
click 'Basic Setting' -> Change .Net FrameWork Version to->.Net FrameWork v4.0.30349

For Windows 8 and Windows Server 2012 use dism /online /enable-feature /featurename:IIS-ASPNET45
As administrative command prompt.

I got into this mess twice and after searching long and hard and following what others did absolutely nothing worked for me but to uninstall and install IIS back once on Windows 7 machine and then on Windows server 2012 R2.

use .NET3.5 it worked for me for similar issue.

Related

Running IIS Express in 32-bit crashes my ASP.NET Core web application

I have an ASP.NET Core web application which I'm trying to run in 32-bit with IIS Express. I followed other guides and tips to make IIS run in 32-bit, but every time i try to run the application it crashes with the error message:
System.BadImageFormatException: Could not load file or assembly. An
attempt was made to load a program with an incorrect format.
I have tried the following:
Set the build and debug to run x86
And unchecked the Use the 64 bit version of IIS Express for web sites and projects
But my project still closes almost immediately with the error mention above. Is there a setting that I am forgetting about or something else I need to do before the project can run in 32-bit.
I'm using visual studio 2017 on Windows 10 with IIS Express version 10.0.14393.0 and AspNetCore 2.1

IIS Express not stopping when debug session ends

All of a sudden IIS Express no longer stops when I stop debugging a web site in Visual Studio 2017.
I'm not sure when this behaviour started, but I have the following setup:
Visual Studio 15.5.2 (Has been repaired)
IIS Express 10.0 x64 (Reinstalled)
An ASP.Net Core 2 project targeting net461
I have disabled "Enable edit and continue" in Tools -> Options -> Debugging -> General
Not sure when this started happedning, maybe when I updated to the lastest VS version.
What more can I try?
If Enable Edit and Continue is unchecked
Then IIS Express stays running even after debugging is stopped.
You can uncheck it if you want here:
Right click your project » click Properties » select the Web tab » Enable Edit and Continue checkbox
For .net Core web projects in Visual studio 2017
If you add:
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
or:
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
in the first PropertyGroup in your project.csproj config you will alter the iis express behavior.
InProcess will kill iis express after debug.
If the setting is missing or set to OutOfProcess iis express will keep the process running.
-
This setting updates the .vs\config\applicationhost.config of your solution and hostingModel="InProcess" will be added/removed to the iis express launch config for the project.
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" hostingModel="InProcess" />
(You don't need to change the applicationhost.config, only for reference)
There is an option to control the behaviour in Visual Studio.
Edit and Continue Location
The latest VS 2017 update must have turned it on.
When turning the marked option off again, IIS Express stops when ending the debugging session.
For .net Core web projects in Visual studio 2019
Right click your project » click Properties » select the Debug tab » Select the Hosting Model.
In Process: IIS Express will stop when you stop the debugger.
Out Of Process: IIS Express will continue after you stop the debugger.
Apparently the not stopping of IIS Express in ASP.NET Core is by design: https://github.com/dotnet/project-system/issues/3394#issuecomment-378307654
In Visual Studio 2019:
Tools -> Options -> Project and Solutions -> Web Projects: "Stop debugger when browser window is closed".
If the issue appears sporadically (with no-reproducibility) it maybe an issue or bug somewhere on asp or vs, why not save the project, then kill directly the process and re-run it ?
IIS Express keep the site on ( like an IIS ), you could go to your taskbar, right click on IIS Express Icon and you will be able to stop each site manually.

Error Occurs to run local IIS in visual studio 2013 ultimate

I have configure the IIS server 8.5 in my windows 8.1. But when i tried to run my mvc project on Local IIS server an error occurs. A dialog box appears having the statement "cannot debug some of the code in process w3wp.exe[3276]. IntelliTrace code failed. The System cannot find the file specified. Managed (v4.5, v4.0) code succeeded"
What I supposed to do now?
Check your App Pool on your IIS is set to Enable 32bit Applications to True, Rebuild your Project and try again.

wcfsvchost and VS 2012 express

I'm trying to get started on WCF using VS Studio 2012 Express for Web 32bit on a Win7 x64 machine. THe debugger is supposed to launch wcfsvchost.exe to test out my WCF service, but this file is nowhere on my machine. I have tried re-installing VS 2012 and updating to Update 3 but still no sign of this exe on my machine. I cannot find any info on the net indicating this utility is not provided with the Express version of VS.
Any help on what I am missing greatly appreciated.
You need to set few things in the WCF project Properties in order to open the WCFService test Client.
Project-> Right Click -> Debug -> Chooose Start Project radio Button.
and set the following parameter in commandlike argument.
/client:"WcfTestClient.exe"

How do I get SvcConfigEditor.exe onto a server?

Over a year ago I wrote a WCF service, which runs on a Windows 2003 Server, under the auspices of a Windows Service (which I also wrote). (I wrote it using VS 2008.) I've not had a chance to continue working with it for a long time, but would now like to pick up where I left off back then. However, now I'm trying to use VS 2010, and see if I can interact with it.
The first thing I did was run SvcUtil from the command line, to get the information I would need to put into my App.Config file. However, it gave me an error (#415) saying that the server had rejected the network request. I've been asking around as to how I can fix this problem, and was told that I should run SvcConfigEditor.exe on the server in order to get better logging information. So I RDP onto the server and tried running it. Only, it isn't installed on the server. The .NET Framework 2 and 3.5 are installed, but I wouldn't think it would matter if .NET 4 was installed on the server, if I'm trying to run SvcConfigEditor.exe from .NET 3.5.
Bottom line: how do I get SvcConfigEditor.exe onto the server?
It installs it with WindowsSDK for Windows Server.
If you don't see it available in Start > All Programs > Windows SDK > Tool > Service Configuation Editor OR can't find the file "SvcConfigEditor.exe" you haven't to added the feature.
To add...
Control Panel > Programs and Feature > (Right-click) Microsoft Windows SDK for Server > Change
Check on Developer Tools> Windows Development Tools > .NET Development Tools
After the install of the feature, you should see it now.
You can just copy your config from the server to you workstation and then run svcconfigeditor then copy it back to the server. Your config is just a text file so treat it as such.
Get it from your local development machine where Visual Studio is installed:
Microsoft Service Configuration Editor
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\SvcConfigEditor.exe
You might want to get the following tools as well:
Service Trace Viewer (Of you have WCF tracing enabled)
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\SvcTraceViewer.exe
WCF Test Client
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\WcfTestClient.exe