Process with an ID of #### is not running. output says: "The program '[4560] iisexpress.exe' has exited with code 0 (0x0)." - asp.net

so I was previously using VS2015 in Windows 10. I had built one simple ASP.NET MVC project and never faced any issue while running it. However, I have been using Windows 8.1 now and installed VS2019. Running the same application and been facing the error "Process with an ID of #### is not running".
output says: "The program '[4560] iisexpress.exe' has exited with code 0 (0x0)."
So I tried to open a new dummy ASP.NET Web MVC project to check if that works and it didn't.
Now, there are a myriad range of solutions provided all over and I have tried every last one of them. With no luck.
1. Delete the hidden .vs file.
2 Rename/ remove the IISExpress folder and its config file under documents.
3. Removed the specific code snippet from the solution .csproj file
4. Of course tried running VS as ADMIN.
5. Realised that IIS exress was not installed. So completed that.
6. Then realised that VS 2019 needed to have the IIS support for ASP.net core installed additionally, so done that.
Now I'm out of ideas. It would be really helpful if you could provide some more suggestions or work arounds for this problem.
Thanks.

So, what finally worked for me were the following steps:
Install IIS using this link -
IIS Manager in Windows 10
Run the IIS from command line by following this link -
https://learn.microsoft.com/en-us/iis/extensions/using-iis-express/running-iis-express-from-the-command-line
Opened VS 2019 in admin mode.
Project -> (right click)Properties -> Web -> Servers -> Select local IIS from dropdown. -> Create Virtual Directory -> click ok. -> ctrl+S
Run the application.

I was getting same issue. This problem can be resolved by explorin project directory and remove the .vs hidden folder.

Related

.NET Core 31 - Single EXE - The application to execute does not exist

Converted an old .NET Framework project to .NET Core 3.1 yesterday. The application runs fine on my own machine and debugs correctly.
I have put both the following into my .vbproj/.csproj
<PublishSingleFile>true</PublishSingleFile>
<RuntimeIdentifier>win81-x64</RuntimeIdentifier>
However when I move the .EXE to a remote machine and attempt to run said EXE on that remote machine I get told that the DLL (for the project in question) does not exists.
I moved the .dll to the same directory that the exe is in (not ideal) and get the following error instead
A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\Program Files\dotnet'.
I used to use Costura.Fody to create a single file exe without any issues in .NET Framework, I was under the impression the above would do the same for the .NET Core packages.
Can someone point me in the right direction please.
For anyone else that may find this question and find it useless.
I was 'Building' the project instead of 'Publishing' the project, this in-turn wasn't creating the self-contained exe properly.
Don't be a donut like me.
In Visual Studio 2019, go to Build > Publish MyApp. This will open a tab in the editor area. Click on Show all settings to open the Profile settings dialog. Then click on File publish options and check Produce single file.

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.

asp.net Attempting to create publish settings in vs 2012 gives strange error

I recently updated my asp.net 3.5 web project from Visual Studio 2010 to Visual Studio 2012. Every time I try to create publish settings it says the following:
{There are errors in web.config. Please correct these errors and try again.
The first error is: "Web.config appears to be in invalid state. Please correct it and try again."}
I have been unable to determine what this means. I have no errors in my web.config that it is telling me about. I have search for this error and have come up with nothing.
Can someone please help me out?
I should also mention this entire project resides on a mapped drive. I am still able to open the project and publish it in Visual Studio 2010 but can't even create the publish settings in Visual Studio 2012.
I think the below steps would help you out.
Before performing publish make sure the project is changed to Release mode.
Do not perform publish as a website. Try and publish your website to a file system.
create a virtual directory and point that virtual directory to the published folder.
The above mentioned steps worked for me.

breakpoints in code behind not hit

common problem I guess, but no solution has worked so far:
my breakpoints (asp.net 2.0) get hit nicely in "backend" assemblies but not
in the code behind.
i can even see the
<% Response.CacheControl="no-cache"; %> line being hit in my asp.net master file
but still not the code behind.
I'm using VS 2005, windows 7 32 bit.
Any idea what else could I check?
If your code file is newer than the compiled version that is being run against (on the web server, whether it be IIS or the dev server), breakpoints will not be hit (the red circles will be hollow).
Try doing a clean / rebuild and see if that works.
EDIT:
I just noticed something in your last comment; you said you are attaching to the asp.net process. To which process are you attaching? It should be w3wp.exe.
My problem ended up being that I'd created a new configuration for the project, but that none of the debug properties on the project were set for it. So this is what I had to do:
Right click the web project and select Properties.
Go to the Build tab.
Click Advanced.
In the dialog, ensure that in the Output section, Debug Info is NOT set to none.
I'm guess there is a problem in loading the symbols for the page, and hence the breakpoint is not hitting,
try this
1 - While debugging in Visual Studio, click on Debug > Windows > Modules. The IDE will dock a Modules window, showing all the modules that have been loaded for your project.
2 - Look for your project's DLL, and check the Symbol Status for it.
3 - If it says Symbols Loaded, then you're golden. If it says something like Cannot find or open the PDB file, right-click on your module, select Load Symbols, and browse to the path of your PDB.
4 - I've found that it's sometimes necessary to
stop the debugger
close the IDE
close the hosting application
nuke the obj and bin folders
restart the IDE
rebuild the project
go through the Modules window again
Once you browse to the location of your PDB file, the Symbol Status should change to Symbols Loaded, and you should now be able to set and catch a breakpoint at your line in code.
hope it helps !
Answer source
Ugh. In my case I had mapped the right folder in IIS, but the application was set on IIS Express.
So the correct assemblies where loaded when I went to the URL, but the application was attached to a IIS Express version that never got any hits.
In my case I updated my repo from Git and the Project changed from Local IIS to IIS Express (Project > Properties > Web tab). This somehow messed up my configuration and I was not able to debug.
My problem was fixed by setting it to "Startup Project"
Solution Explorer -> Right Click on the project -> Set as StartUp Project
or
Menu bar -> PROJECT or WEBSITE -> Set as StartUp Project
Just to help others who come across this question, I too had this issue where none of my breakpoints where being hit.
It turned out that the project was originally created in Visual Studio 2015. I have 2008, 2010, 2015, 2017, 2019 installed. I accidentally opened it in 2017 and then this issue occurred. Opened it back up in 2015 and back to normal.

Visual Studio 2003 - opening ASP.NET project - getting "The operation timed out" error message

Occasionally, when I open a visual studio 2003 ASP.NET project it seems to spend forever loading up then finally displays the following error message:
"The web server reported the following error while attempting to create or
open the web project located at the following URL:
http://localhost/myprojectname. The operation timed out."
Any idea why this happens and how to fix it?
The fix for me was to unregister the re-register iis for .net:
Open command window and navigate to C:\windows\microsoft.net\framework\v1.1.4322
Type in aspnet_regiis -u
Once finished uninstalling ASP.NET type in apsnet_regiis -i
Just performing aspnet_regiis -i by itself did not work.
Still unsure as to why this is happening but probably something to do with switching dev environments between Eclipse\Java\JBoss to VS2003\C#\IIS
This worked for me...
http://forums.asp.net/p/1192304/2066860.aspx
On my XP development machine I went to "C:\Documents and Settings\USERNAME\VSWebCache\USERNAME\" and deleted the folder matching my VS2003 solution name. (Actually I moved the folder to C:\Temp just in case). This worked, although one designer file would not load without a re-build and the start-up page needed to be re-marked. I don't understand why my solution depends on this VSWebCache (it re-appeared when I re-built my solution.) Can anyone explain this dependence? It's un-settling.
This Worked for me. Hopefully it will work for you people also.
Initially, I had tried these many things :
Open command window and navigate to C:\windows\microsoft.net\framework \v1.1.4322 Type in aspnet_regiis -u Once finished uninstalling ASP.NET type in aspnet_regiis -i (It was working sometimes but not always).
I tried by Clearing the vswebcache of Visual studio 2003, as per some forum answer, but didn't work out.
Then finally, I used my own technique and it worked for me. I took the old dll's for the project which was not getting load and i had replaced the dll's with old project dll's. After that my project got load into visual studio 2003. There will be one dll and pnb file with name of project which will get corrupted sometime and your project wont get load into IDE.
So, if you face similar issue, then you have two options:
1) Replace the Dll's with old dll's.
2) Delete the Dll and pnb file with project name and try to reload it again.(Deleting the dll is not going to affect your code and other dll's).
Hopefully it will work for you too :)

Resources