Visual Studio 2015 IIS Express 500 Error - asp.net

I have an ASP.Net website project that I am migrating to .Net 4.6.1 .
I have installed Visual Studio 2015 Community, and I have successfully compiled and built both the website and its component DLL.
When I try to use IIS Express to debug with F5, I get a 500 error...
HTTP Error 500.0 - Internal Server Error
Tracing area "Authentication,Security,Filter,StaticFile,CGI,Compression,Cache,RequestNotifications,Module,FastCGI,Rewrite,RequestRouting" is not recognized
That says to me that IIS Express does not have a module installed that I need. I thought it might be that ARR and URL Rewrite were not installed, so I installed these, no change.
My ApplicationPool in production uses PreWarmCache technology to start up and avoid 'first hit' delays, and do other one-time startup work.
Help with getting IIS Express to run the site would be very useful.

If you have a line like this in your web.config file, can you remove it and try to run it again?
<add provider="WWW Server"
areas="Authentication,Security,Filter,StaticFile,CGI,Compression,Cache,RequestNotifications,Module,FastCGI,Rewrite,RequestRouting"
verbosity="Verbose" />

It is also possible to get the blank page and 500 errors due to a problem with Visual Studio's project migration. Closing the solution and deleting the .vs folder can remedy this.

Related

dotnet "It appears you don't have permission to access this page. 403 Error. Forbidden."

I am trying to publish a dotnet core 6.0 project using FTP in Visual Studio. Visual Studio runs through the process of publishing the page and then when I go visit the page I am getting this 403 error. Other posts say to make changes to the web.config file but there is none in dotnet core 6.0. How do I fix this? I am connecting to MySql on Host Gator

ASP.Net Core 2 - IIS 502.5 Error

I am creating an ASP .Net Core (2.0) MVC application within Visual Studio 2017 which was working absolutely fine.
After turning off my computer yesterday and coming back to my application today, I now receive this browser error when I start the application in chrome without debugging.
Running dotnet run within the directory of the application, I can access the site just fine. It is just when I run it via Visual Studio/IIS Express I get this error.
HTTP Error 502.5 - Process Failure
The application builds and compiles just fine. I have also cleaned the solution.
Looking in the event logs I find:
Application 'MACHINE/WEBROOT/APPHOST/MYAPP' with
physical root 'C:\Users\Ben Hawkins\Desktop\Development Folder
\Dev\Website\Version_2\MYAPP\MYAPP\'
failed to start process with commandline 'C:\Program Files
(x86)\Microsoft Visual
Studio\2017\Community\Common7\IDE\Extensions\Microsoft\Web
Tools\ProjectSystem\VSIISExeLauncher.exe -argFile "C:\Users\Ben
Hawkins\AppData\Local\Temp\tmp3547.tmp"', ErrorCode = '0x80004005 :
0.
Within my output window in Visual Studio 2017 I recieve this message under
ASP NET CORE WebServer
Failed to initialize CoreCLR, HRESULT: 0x80131534
What I have tried:
Cleaning the solution, rebuilding etc
Restarting the computer
Trying to launch another application. (Same result)
Created a new application from scratch. Same result.
Repairing Visual Studio Community 2017. Same result.
Stopping/Closing IIS Express
My setup was working perfectly yesterday and suddenly is not.
Thank you for your time. I hope we can find a solution.
We finally found the issue! After logging on to the machine as a different user, we saw a warning that the main user had ignored initially. There was a 0 byte file in the root of the directory named "Program" with no file extension. It appears that this causes some sort of issue when VSIISExeLauncher.exe is invoked through Visual Studio. (Note it would work if executed from the command prompt). After deleting the file, everything worked!
We do not know how this file was placed there for certain, but suspect it was some sort of copy error when the user was pulling in files from his old hard drive.
I don't know if anyone else will come across this, but if so hopefully this helps!
Maybe you need install previous versions of .NET Core, isn't it? I installed here and it works now. I had only .NET Core 2.0 installed and I realized that applications with 1.1 stopped so when running. In Windows' event logs I've had the same error registered.
Try to change the IISExpress to IIS by creating new IIS profile and change the Lunch to IIS. It resolved my problem.
I have hit a very similar issue with ASP.net Core 2.0. I had copied my VS project to a new one, and I was getting this error message.
After doing some research, I was able to determine that the nlog.config file was not copied into the bin > Debug > net461 folder. Once I did this, I was able to run my application.
I found it by running dotnet run from the command line on my project where the csproj files live.
Had same issue yesterday (windows 10).
Solved it this way:
Update Microsoft.AspNetCore to latest (Nuget manager - 2.1.3)
Make sure the sdk also updated to latest version. if not, update it manually from Nuget console like this:
Install-Package Microsoft.NETCore.App -Version 2.1.3
Download and install latest ASP.NET Core/.NET Core: Runtime & Hosting Bundle
from here
Same problem with version 2.2. Reinstalling .NET Core SDK fixed the problem for us.
In my case, my project was setup as a website in IIS and the file "bin\IISSupport\VSIISExeLauncher.exe" was missing in the project's directory.
I simply selected "IIS" when debugging the project in Visual Studio 2019 and it generated the missing file. It also generated 2 text files (IISExeLauncherArgs.txt, pidfile.txt) in the IISSupport folder, made changes to my web.config file, and my project ran successfully.
After that I was able to access the local website that was setup in IIS without running it in Visual Studio.

Visual Studio Express 2013 Web Site Administration Tool (WSAT)

I am trying to access the Web Site Administration Tool (WSAT) so I can manage the users and roles established by an earlier version of VS. Apparently Microsoft took it away. I have Googled a solution, but I am not successful.
In the command prompt I entered...
iisexpress.exe /path:C:\Windows\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles /vpath:/WebAdmin /port:12345 /clr:4.0 /ntlm
I get an error...
c:\Program Files\IIS Express\iisexpress.exe is not a valid Win32 application.
What could be wrong?
I repaired the IIS Express installation and it fixed the issue. The file had a size of zero when I looked at it before the repair.

Why is IIS exiting with code 0 whenever I preview in Chrome from Visual Studio? [duplicate]

I start a VS2013 VB.Net MVC5 Web Application, set a breakpoint in HomeController About method and run "Start Debugging", navigate to About page and receive the message "Code not running - The current Thread is not currently running or the call stack could not be obtained" preventing any debugging.
If I set a breakpoint in Global.asax Application_Start, the breakpoint works fine. Changing the "Enable Edit & Continue" makes no difference.
Anyone have any ideas what is happening?
Update: My environment was Windows 8.0 Pro with VS2013 Ultimate.
I have since flushed my system and done a completely fresh install of Windows 8.1 Pro, VS2010 Ultimate, VS2012 Ultimate, & VS2013 Ultimate.
Same test done on all 3 versions of VS - File > New Project > MVC (Default). All 3 versions of VS are reporting "Process with an Id of xxx is not running."
VS2013 debug trace reports "The program '[7720] iisexpress.exe: Program Trace' has exited with code 0 (0x0). The program '[xxxx] iisexpress.exe' has exited with code -1073741816 (0xc0000008) 'An invalid handle was specified'."
I have run VS in and out of Administrator mode and receive the same results. I have uninstalled and reinstalled IIS Express 8.0.
For me the solution was a much simpler one. In my Solution Explorer in Visual Studio, I right click on the web project, chose properties and then navigated to the "web" tab. From there I changed the Project URL to another port number. For example, if it was http://localhost:1052 - I changed it to http://localhost:4356.
Not sure if this helps anyone else, but it worked for me - hopefully it will work for you too!
If you are using 64 bit machine
Go to Visual Studio > Tools Menu > Options
I had the same problem and my solution was the following:
Instead of deleting the main applicationhost.config (in your "Documents/IIS Express" folder), check your solution folder for a hidden ".vs" folder with a "config" sub-folder. If that folder exists and it has it's own applicationhost.config file you need to either rename (or delete) that file or edit it and make sure the website(s) configured inside match the ASP.NET web app(s) in your solution that you are trying to debug. Hope this helps.
I had a similar problem while moving from Visual Studio 2013 to Visual Studio 2015 on a MVC project.
Deleting the whole .vs solution worked as a charm as Johan J v Rensburg pointed out.
The following steps fix the problem for VS 2015 and VS 2017:
Close VS.
Navigate to the folder of the solution and delete the hidden .vs folder.
open VS.
Hit F5 and IIS Express should load as normal, allowing you to debug.
The solution to the above problem was a simple one. Close down dev environments, go to Documents folder and rename IISExpress. Now set environment variable _CSRUN_DISABLE_WORKAROUNDS ( ref: http://gauravmantri.com/2013/02/05/workaround-for-iis-express-crashing-when-running-windows-azure-cloud-service-web-role-with-multiple-instances-in-windows-azure-sdk-1-8-compute-emulator/ ).
Now reboot PC, start VS, load website and run in debug. IIS automatically regenerated the IISExpress folder and the environment variable resolved conflicts.
Well.. for me it was Telerik JustMock Q3 2013 (13.3.1015.0) that caused the problem. Uninstalled it from VS 2013 and the problem has gone..
see also ASP.NET-MVC4 Code Not Running
and http://feedback.telerik.com/Project/105/Feedback/Details/63749-unable-to-debug-asp-net-projects-with-q3-2013
One lost day and many new white hairs... Curse on you Telerik guys! ;)
Another scenario may be that the port that IIS is using for your application is already being used by another running application. Try changing the port and see if it works for you.
I started to get this problem with Asp.Net Core Web Applications in Visual Studio 2017. It didn't matter if it was the .Net Core Standard version with .Net 4.5.2 or the Core version with 1.1 in my case. IISExpress crashed when I started debug.
Tried everything, nothing worked until I went into add/remove programs in Windows 10 and I uninstalled .net core 1.0 runtime (I had both 1.0 installed AND 1.1). Once that was uninstalled, I started Visual Studio 2017 and my .Net Core Web applications (both kinds) and they both started working again!
I made it work by doing the following:
Delete the ".vs" folder under the application folder
Delete the "IISExpress" folder from the Document
Enable the 64 bit version of IIS Express on visual studio by going to Tools -> Options -> Projects and Solutions -> Web Projects
May need to delete everything from temp folder
May need to change the port by right click on project, go to properties, under web and change the project url port.
The similar problem occurs in aspdotnet core with the same error The program '[xxxx] iisexpress.exe' has exited with code -1073741816 (0xc0000008).
Log file setup in web.config did not produce any info also:
<aspNetCore stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />
To find exact error the next step with log info in command prompt helped:
> dotnet restore
> dotnet run
In my case the problem was in dotnet core v 1.0.0 installed, while version 1.0.1 was required to be globally installed.
Go to project directory .vs/config/ and remove applicationhost.config . Then restart project.
I have solved this issue for me. Try to change all Deny values to Allow in file %SYSTEM_DRIVE%\Program Files\IIS Express\AppServer\applicationhost.xml. Please, take into account what IIS Express Web Server you are using in Visual Studio Settings, 32 bit or 64 bit, that means I have to check the file in different folders. Then restart Visual Studio. I don't know about security issues for those config lines, so change them at your own risk, but it has solved my problem.
<section name="asp" overrideModeDefault="Allow" />
<section name="caching" overrideModeDefault="Allow" />
<section name="cgi" overrideModeDefault="Allow" />
<section name="defaultDocument" overrideModeDefault="Allow" />
<section name="directoryBrowse" overrideModeDefault="Allow" />
<section name="fastCgi" allowDefinition="AppHostOnly" overrideModeDefault="Allow" />
<section name="globalModules" allowDefinition="AppHostOnly" overrideModeDefault="Allow" />
<section name="handlers" overrideModeDefault="Allow" />
<section name="httpCompression" overrideModeDefault="Allow" />
<section name="httpErrors" overrideModeDefault="Allow" />
<section name="httpLogging" overrideModeDefault="Allow" />
<section name="httpProtocol" overrideModeDefault="Allow" />
etc.
Delete File C:\Users\congt\Documents\IISExpress
None of the above answers worked for me but I finally found what my issue was. Hopefully this will help someone down the line.
First run IIS Express from command prompt to validate that the site can or cannot be run
https://learn.microsoft.com/en-us/iis/extensions/using-iis-express/running-iis-express-from-the-command-line
Im my case, i got an error saying that C:\Windows\Microsoft.NET\Framework64\v4.0.30319\CONFIG\web.config had malformed xml on line 14. Looking at that line in the file it just said null null null null null etc.
The fix for me was to replace the web.config file with one from my coworkers. IMPORTANT you must get the file from someone running the same version ie if you are VS2015 get a copy from someone running VS2015. If you get it from someone running a different version you will see an error saying it could not load an assembly from the manifest.
Hopefully this helps someone that has tried all the suggestions above. I think the cause of this for me was updating from trial mode and adding a product key within VS2017
In my case the issue was that Virtual directory was not created.
Right click on web project file and go to properties
Navigate to Web
Scroll down to Project Url
Click Create Virtual Directory button to create virtual directory
Resolution fix: For me, the problem was related to active chrome sessions. I closed all of my chrome browser sessions and then tried building to chrome again. I am using Visual Studio Professional 2017 version 15.3.2. The VS application I was running into build errors with was a WebAPI project. When trying to click the green play button, I was getting dialog error stating "Unable to start the program 'http://localhost:18980/'. An operation is not legal in the current state. Hopefully this post helps someone.

Visual studio 2005 debugger won't stop at requested break points

I have debug=true both in the web.config and in the requested file but it still won't stop.
Thanks...
There might be several reasons:
There are changes to the assembly and the debugger didn't get updated - try cleaning the solution and the building it again
You are building in release mode - in this case you would get a warning message from the studio
The rest options depends on weather you are using local iis or the Visual Studio web server.

Resources